content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using SharpStatusApp.Data;
namespace SharpStatusApp.Areas.Account.Pages.Manage
{
public class ShowRecoveryCodesModel : PageModel
{
[TempData]
public string[] RecoveryCodes { get; set; }
[TempData]
public string StatusMessage { get; set; }
public IActionResult OnGet()
{
if (RecoveryCodes == null || RecoveryCodes.Length == 0)
{
return RedirectToPage("./TwoFactorAuthentication");
}
return Page();
}
}
}
| 24.53125 | 67 | 0.652229 | [
"MIT"
] | TwoPeas/SharpStatusApp | SharpStatusApp/Areas/Account/Pages/Manage/ShowRecoveryCodes.cshtml.cs | 787 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Input.Spatial
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public partial class SpatialHoldCanceledEventArgs
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::Windows.UI.Input.Spatial.SpatialInteractionSourceKind InteractionSourceKind
{
get
{
throw new global::System.NotImplementedException("The member SpatialInteractionSourceKind SpatialHoldCanceledEventArgs.InteractionSourceKind is not implemented in Uno.");
}
}
#endif
// Forced skipping of method Windows.UI.Input.Spatial.SpatialHoldCanceledEventArgs.InteractionSourceKind.get
}
}
| 35.130435 | 174 | 0.774752 | [
"Apache-2.0"
] | 06needhamt/uno | src/Uno.UWP/Generated/3.0.0.0/Windows.UI.Input.Spatial/SpatialHoldCanceledEventArgs.cs | 808 | C# |
namespace Patterns_01
{
/// <summary>
/// Класс Customer
/// </summary>
class Customer : EntityBase
{
/// <summary>
/// Описание объекта
/// </summary>
public string Description { get; set; }
/// <summary>
/// Конструктор с параметрами
/// </summary>
/// <param name="idGenerator">объект генерации id</param>
public Customer(IIdGenerator idGenerator) : base(idGenerator) { }
}
}
| 23.85 | 73 | 0.542977 | [
"MIT"
] | ivancovae/GB_DZ_Patterns_01 | Patterns_01/FirstTask/Customer.cs | 537 | 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 PGViewer.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| 34.290323 | 151 | 0.580433 | [
"MIT"
] | MoravecLabs/pg-viewer | PGViewer/Properties/Settings.Designer.cs | 1,065 | C# |
#region copyright
// Copyright 2015 Habart Thierry
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Linq;
using System.Net;
using System.Reflection;
namespace SimpleIdentityServer.Host.Extensions
{
public static class ObjectExtensions
{
public static string GetQueryString(this object obj)
{
var properties = from p in obj.GetType().GetProperties()
where p.GetValue(obj, null) != null
select p.Name + "=" + WebUtility.UrlEncode(p.GetValue(obj, null).ToString());
return String.Join("&", properties.ToArray());
}
}
} | 33.914286 | 106 | 0.676495 | [
"Apache-2.0"
] | appkins/SimpleIdentityServer | SimpleIdentityServer/src/Apis/SimpleIdServer/SimpleIdentityServer.Host/Extensions/ObjectExtensions.cs | 1,189 | 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.AzureNextGen.Web.V20150801
{
public static class GetSiteHostNameBinding
{
/// <summary>
/// A host name binding object
/// </summary>
public static Task<GetSiteHostNameBindingResult> InvokeAsync(GetSiteHostNameBindingArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetSiteHostNameBindingResult>("azure-nextgen:web/v20150801:getSiteHostNameBinding", args ?? new GetSiteHostNameBindingArgs(), options.WithVersion());
}
public sealed class GetSiteHostNameBindingArgs : Pulumi.InvokeArgs
{
/// <summary>
/// Name of host
/// </summary>
[Input("hostName", required: true)]
public string HostName { get; set; } = null!;
/// <summary>
/// Name of web app
/// </summary>
[Input("name", required: true)]
public string Name { get; set; } = null!;
/// <summary>
/// Name of resource group
/// </summary>
[Input("resourceGroupName", required: true)]
public string ResourceGroupName { get; set; } = null!;
public GetSiteHostNameBindingArgs()
{
}
}
[OutputType]
public sealed class GetSiteHostNameBindingResult
{
/// <summary>
/// Azure resource name
/// </summary>
public readonly string? AzureResourceName;
/// <summary>
/// Azure resource type
/// </summary>
public readonly string? AzureResourceType;
/// <summary>
/// Custom DNS record type
/// </summary>
public readonly string? CustomHostNameDnsRecordType;
/// <summary>
/// Fully qualified ARM domain resource URI
/// </summary>
public readonly string? DomainId;
/// <summary>
/// Host name type
/// </summary>
public readonly string? HostNameType;
/// <summary>
/// Resource Id
/// </summary>
public readonly string? Id;
/// <summary>
/// Kind of resource
/// </summary>
public readonly string? Kind;
/// <summary>
/// Resource Location
/// </summary>
public readonly string Location;
/// <summary>
/// Resource Name
/// </summary>
public readonly string? Name;
/// <summary>
/// Web app name
/// </summary>
public readonly string? SiteName;
/// <summary>
/// Resource tags
/// </summary>
public readonly ImmutableDictionary<string, string>? Tags;
/// <summary>
/// Resource type
/// </summary>
public readonly string? Type;
[OutputConstructor]
private GetSiteHostNameBindingResult(
string? azureResourceName,
string? azureResourceType,
string? customHostNameDnsRecordType,
string? domainId,
string? hostNameType,
string? id,
string? kind,
string location,
string? name,
string? siteName,
ImmutableDictionary<string, string>? tags,
string? type)
{
AzureResourceName = azureResourceName;
AzureResourceType = azureResourceType;
CustomHostNameDnsRecordType = customHostNameDnsRecordType;
DomainId = domainId;
HostNameType = hostNameType;
Id = id;
Kind = kind;
Location = location;
Name = name;
SiteName = siteName;
Tags = tags;
Type = type;
}
}
}
| 28.312057 | 203 | 0.560872 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/dotnet/Web/V20150801/GetSiteHostNameBinding.cs | 3,992 | C# |
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/imapi2fs.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
using System.Runtime.InteropServices;
namespace TerraFX.Interop.Windows;
/// <include file='BlockRange.xml' path='doc/member[@name="BlockRange"]/*' />
[Guid("B507CA27-2204-11DD-966A-001AA01BBC58")]
public partial struct BlockRange
{
}
| 34.933333 | 145 | 0.763359 | [
"MIT"
] | IngmarBitter/terrafx.interop.windows | sources/Interop/Windows/Windows/um/imapi2fs/BlockRange.cs | 526 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace WebAddressbookTests
{
public class TestBase
{
public static bool PERFORM_LONG_UI_CHECKS = false;
protected ApplicationManager app;
[SetUp]
public void SetupApplicationManager()
{
app = ApplicationManager.GetInstance();
}
public static Random rnd = new Random();
public static string GenerateRandomString(int max)
{
int l = Convert.ToInt32(rnd.NextDouble() * max);
StringBuilder builder = new StringBuilder();
for (int i = 0; i <l; i++ )
{
builder.Append(Convert.ToChar(32 + Convert.ToInt32(rnd.NextDouble()) * 65));
}
return builder.ToString();
}
}
}
| 20.363636 | 92 | 0.59933 | [
"Apache-2.0"
] | vds144/charp_training3 | addressbook_web_tests/addressbook-web-tests/tests/TestBase.cs | 898 | 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 kendra-2019-02-03.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.Kendra.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Kendra.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeletePrincipalMapping Request Marshaller
/// </summary>
public class DeletePrincipalMappingRequestMarshaller : IMarshaller<IRequest, DeletePrincipalMappingRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((DeletePrincipalMappingRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeletePrincipalMappingRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.Kendra");
string target = "AWSKendraFrontendService.DeletePrincipalMapping";
request.Headers["X-Amz-Target"] = target;
request.Headers["Content-Type"] = "application/x-amz-json-1.1";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2019-02-03";
request.HttpMethod = "POST";
request.ResourcePath = "/";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetDataSourceId())
{
context.Writer.WritePropertyName("DataSourceId");
context.Writer.Write(publicRequest.DataSourceId);
}
if(publicRequest.IsSetGroupId())
{
context.Writer.WritePropertyName("GroupId");
context.Writer.Write(publicRequest.GroupId);
}
if(publicRequest.IsSetIndexId())
{
context.Writer.WritePropertyName("IndexId");
context.Writer.Write(publicRequest.IndexId);
}
if(publicRequest.IsSetOrderingId())
{
context.Writer.WritePropertyName("OrderingId");
context.Writer.Write(publicRequest.OrderingId);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static DeletePrincipalMappingRequestMarshaller _instance = new DeletePrincipalMappingRequestMarshaller();
internal static DeletePrincipalMappingRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeletePrincipalMappingRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 35.983471 | 159 | 0.616904 | [
"Apache-2.0"
] | Hazy87/aws-sdk-net | sdk/src/Services/Kendra/Generated/Model/Internal/MarshallTransformations/DeletePrincipalMappingRequestMarshaller.cs | 4,354 | C# |
using ParentLoadSoftDelete.Business;
namespace ParentLoadSoftDelete.Business.ERCLevel
{
public partial class F04Level11
{
#region Pseudo Event Handlers
//partial void OnCreate(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnDeletePre(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnDeletePost(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnFetchPre(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnFetchPost(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnFetchRead(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnUpdatePre(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnUpdatePost(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnInsertPre(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
//partial void OnInsertPost(DataPortalHookArgs args)
//{
// throw new System.Exception("The method or operation is not implemented.");
//}
#endregion
}
}
| 31.265625 | 89 | 0.584208 | [
"MIT"
] | CslaGenFork/CslaGenFork | tags/DeepLoad sample v.1.0.0/ParentLoadSoftDelete.Business/ERCLevel/F04Level11.cs | 2,001 | C# |
using Xunit;
using ProjectGenerator;
using Shouldly;
namespace ProjectGenerator.Tests
{
public class SolutionPropertyTests
{
[Fact]
public void OnlyCreated_AllPropertiesAreNull()
{
var solution = Solution.Create();
solution.RootPath.ShouldBeNull();
solution.Name.ShouldBeNull();
}
[Fact]
public void WithName()
{
var solution = Solution.Create().WithName("TestSolution");
solution.Name.ShouldBe("TestSolution");
}
[Fact]
public void InFolder()
{
var solution = Solution.Create().InFolder("/rootfolder/");
solution.RootPath.ShouldBe("/rootfolder/");
}
}
}
| 20.944444 | 70 | 0.566313 | [
"BSD-3-Clause"
] | SabotageAndi/ProjectGenerator | ProjectGenerator.Tests/SolutionPropertyTests.cs | 754 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using ChangeTrackingEvents.Context;
using ChangeTrackingEvents.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
namespace ChangeTrackingEvents
{
class Program
{
static void Main(string[] args)
{
SetupDatabase();
using (var db = new BloggingContext())
{
var blog = new Blog { Name = "Skimedic's Blog", Url = "http://skimedic.com" };
Console.WriteLine("Going to add to DbSet<T>");
db.Add(blog);
Console.WriteLine("Going to save added record");
db.SaveChanges();
Console.WriteLine("Saved the added record");
}
//using (var db = new BloggingContext())
//{
// var blog = db.Blogs.First();
//}
//using (var db = new BloggingContext())
//{
// var blog = db.Blogs.AsNoTracking().First();
//}
Console.WriteLine("Press any key to continue");
Console.ReadKey();
}
private static void SetupDatabase()
{
using (var db = new BloggingContext())
{
db.Database.EnsureDeleted();
db.Database.EnsureCreated();
}
}
}
}
| 30.085106 | 94 | 0.52546 | [
"BSD-3-Clause",
"MIT"
] | MalikWaseemJaved/presentations | .NETCore/EFCoreSamples/ChangeTrackingEvents/Program.cs | 1,416 | C# |
using System.Threading;
using System.Threading.Tasks;
using Alexprof.AutoMoq;
using Domain;
using FluentAssertions;
using Moq;
using Xunit;
namespace ApplicationServices.Tests
{
public class ElevatorInteriorActionsTests
{
[Theory, DapperAutoData()]
public void CheckCurrentFloorAsync_InElevator_ReportsElevatorFloor(
int currentFloor,
[Frozen] Mock<ICallPanel> panel,
[Frozen] Mock<IElevatorService> elevatorService,
ElevatorInteriorActions elevator)
{
// arrange
panel.Setup(x => x.IsDoorOpen).Returns(true);
elevatorService.Setup(x => x.CurrentFloor).Returns(currentFloor);
elevator.EnterDoor();
// act
var reportedFloor = elevator.CheckCurrentFloorAsync();
// assert
reportedFloor.Should().Be(currentFloor.ToString());
}
[Theory]
[DapperAutoData(1)]
[DapperAutoData(2)]
[DapperAutoData(3)]
[DapperAutoData(4)]
[DapperAutoData(5)]
public async void PushButton1_CallFromAnyFloor_NewFloorCallPanelIsSet(
int callingFloor,
Mock<ICallPanel> newPanel,
[Frozen] Mock<IPersonActions> personActions,
[Frozen] Mock<ICallPanel> originalCallPanel,
[Frozen] Mock<IElevatorService> elevatorService,
ElevatorInteriorActions elevator)
{
// arrange
personActions.Setup(x => x.CheckSurroundings()).Returns("In Elevator");
elevatorService.Setup(x => x.GetCallPanelForFloor(It.IsAny<int>())).Returns(newPanel.Object);
newPanel.Setup(x => x.IsDoorOpen).Returns(true);
// act
await elevator.PushButtonNumberAsync(1).ConfigureAwait(false);
elevator.EnterDoor();
// assert
elevator.CallPanel.Should().Be(newPanel.Object);
}
private static void GetInElevator(Mock<ICallPanel> originalCallPanel, ElevatorInteriorActions elevator)
{
originalCallPanel.Setup(x => x.IsDoorOpen).Returns(true);
elevator.EnterDoor();
}
[Theory]
[DapperAutoData(5, 1)]
[DapperAutoData(5, 4)]
[DapperAutoData(4, 3)]
[DapperAutoData(4, 2)]
[DapperAutoData(3, 2)]
[DapperAutoData(2, 1)]
public async void PushButton_FloorAbove_AddDownCallRequest(
int currentFloor,
int desiredFloor,
[Frozen] Mock<ICallPanel> originalCallPanel,
[Frozen] Mock<IElevatorService> elevatorService,
ElevatorInteriorActions elevator)
{
// arrange
GetInElevator(originalCallPanel, elevator);
elevatorService.Setup(x => x.CurrentFloor).Returns(currentFloor);
// act
switch (desiredFloor)
{
case 1:
await elevator.PushButtonNumberAsync(1).ConfigureAwait(false);
break;
case 2:
await elevator.PushButtonNumberAsync(2).ConfigureAwait(false);
break;
case 3:
await elevator.PushButtonNumberAsync(3).ConfigureAwait(false);
break;
case 4:
await elevator.PushButtonNumberAsync(4).ConfigureAwait(false);
break;
}
// assert
elevatorService.Verify(x => x.DownCallRequestAsync(desiredFloor), Times.Once);
}
[Theory]
[DapperAutoData(1, 1)]
[DapperAutoData(1, 2)]
[DapperAutoData(1, 3)]
[DapperAutoData(1, 4)]
[DapperAutoData(1, 5)]
[DapperAutoData(2, 2)]
[DapperAutoData(2, 5)]
[DapperAutoData(3, 5)]
[DapperAutoData(4, 5)]
[DapperAutoData(5, 5)]
public async void PushButton_BelowOrEqual_AddUpCalleRequest(int currentFloor,
int desiredFloor,
[Frozen] Mock<ICallPanel> originalCallPanel,
[Frozen] Mock<IElevatorService> elevatorService,
ElevatorInteriorActions elevator)
{
// arrange
GetInElevator(originalCallPanel, elevator);
elevatorService.Setup(x => x.CurrentFloor).Returns(currentFloor);
// act
switch (desiredFloor)
{
case 1:
await elevator.PushButtonNumberAsync(1).ConfigureAwait(false);
break;
case 2:
await elevator.PushButtonNumberAsync(2).ConfigureAwait(false);
break;
case 3:
await elevator.PushButtonNumberAsync(3).ConfigureAwait(false);
break;
case 4:
await elevator.PushButtonNumberAsync(4).ConfigureAwait(false);
break;
case 5:
await elevator.PushButtonNumberAsync(5).ConfigureAwait(false);
break;
}
// assert
elevatorService.Verify(x => x.UpCallRequestAsync(desiredFloor), Times.Once);
}
}
}
| 34.966667 | 111 | 0.566444 | [
"MIT"
] | riplikash/elevator-tdd-demo | ApplicationServices.Tests/ElevatorInteriorActionsTests.cs | 5,247 | 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.MachineLearningServices.V20200601.Outputs
{
[OutputType]
public sealed class ResourceIdResponse
{
/// <summary>
/// The ID of the resource
/// </summary>
public readonly string Id;
[OutputConstructor]
private ResourceIdResponse(string id)
{
Id = id;
}
}
}
| 24.214286 | 81 | 0.653392 | [
"Apache-2.0"
] | pulumi-bot/pulumi-azure-native | sdk/dotnet/MachineLearningServices/V20200601/Outputs/ResourceIdResponse.cs | 678 | C# |
using NUnit.Framework;
using System;
using System.Reflection;
using System.IO;
namespace SourceCodeUpdater.FileSystems.Tests
{
/// <summary>
/// Tests the <see cref"SourceCodeUpdaterFileSystem"/>
/// </summary>
[TestFixture]
public class SourceCodeUpdaterPhysicalFileSystemTests
{
/// <summary>
/// Test that the <see cref="DirectoryExists"/> method throws an <see cref="ArgumentNullException"/> when the <see cref="path"/> parameter is <c>null</c>.
/// </summary>
[Test]
public void DirectoryExists_ThrowsAnArgumentNullExceptionWhenThePathIsNull()
{
SourceCodeUpdaterPhysicalFileSystem pfs =new SourceCodeUpdaterPhysicalFileSystem();
Assert.Throws<ArgumentNullException>(() =>pfs.DirectoryExists(null));
}
/// <summary>
/// Test that the <see cref="DirectoryExists"/> method throws an <see cref="ArgumentException"/> when the <see cref="path"/> parameter is an empty string.
/// </summary>
[Test]
public void DirectoryExists_ThrowsAnArgumentExceptionWhenThePathPassedInIsAnEmptyString()
{
SourceCodeUpdaterPhysicalFileSystem pfs = new SourceCodeUpdaterPhysicalFileSystem();
Assert.Throws<ArgumentException>(() => pfs.DirectoryExists(String.Empty));
}
/// <summary>
/// Tests that the <see cref="DirectoryExists"/> returns <c>false</c> when the directory passed in does not exist.
/// </summary>
[Test]
public void DirectoryExists_ReturnsFalseWhenTheDirectoryPassedInDoesNotExist()
{
string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "test");
SourceCodeUpdaterPhysicalFileSystem pfs = new SourceCodeUpdaterPhysicalFileSystem();
Assert.False(pfs.DirectoryExists(path));
}
/// <summary>
/// Tests that the <see cref="DirectoryExists"/> returns <c>true</c> when the directory passed in exists.
/// </summary>
[Test]
public void DirectoryExists_ReturnsTrueWhenTheDirectoryPassedInExists()
{
string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "test");
Directory.CreateDirectory(path);
SourceCodeUpdaterPhysicalFileSystem pfs = new SourceCodeUpdaterPhysicalFileSystem();
Assert.True(pfs.DirectoryExists(path));
Directory.Delete(path);
}
/// <summary>
/// Test that the <see cref="EnumerateDirectories"/> method throws an <see cref="ArgumentNullException"/> when the <see cref="parentDirectory"/> parameter is <c>null</c>.
/// </summary>
[Test]
public void EnumerateDirectories_ThrowsAnArgumentNullExceptionWhenTheParentDirectoryIsNull()
{
SourceCodeUpdaterPhysicalFileSystem pfs = new SourceCodeUpdaterPhysicalFileSystem();
Assert.Throws<ArgumentNullException>(() => pfs.EnumerateDirectories(null));
}
/// <summary>
/// Test that the <see cref="EnumerateDirectories"/> method throws an <see cref="ArgumentException"/> when the <see cref="parentDirectory"/> parameter is an empty string.
/// </summary>
[Test]
public void EnumerateDirectories_ThrowsAnArgumentExceptionWhenTheParentDirectoryPassedInIsAnEmptyString()
{
SourceCodeUpdaterPhysicalFileSystem pfs = new SourceCodeUpdaterPhysicalFileSystem();
Assert.Throws<ArgumentException>(() => pfs.EnumerateDirectories(String.Empty));
}
/// <summary>
/// Test that the <see cref="EnumerateDirctories"/> returns an empty collection if the <c>parentDirectory</c> passed in contains no directories.
/// </summary>
[Test]
public void EnumerateDirectories_ReturnsAnEmptyCollectionIfTheParentDirectoryContainsNoDirectories()
{
string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "test");
Directory.CreateDirectory(path);
SourceCodeUpdaterPhysicalFileSystem pfs =new SourceCodeUpdaterPhysicalFileSystem();
Assert.IsEmpty(pfs.EnumerateDirectories(path));
Directory.Delete(path);
}
/// <summary>
/// Test that the <see cref="EnumerateDirectories/> method returns a populated collection when the parent directory passed in contains directories.
/// </summary>
[Test]
public void EnumerateDirectories_ReturnsAPopulatedCollectionWhenDirectoriesExistInTheParentDirectoryPassedIn()
{
string path = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
int lastBackslashIndex = path.LastIndexOf('\\');
path =path.Remove(lastBackslashIndex);
SourceCodeUpdaterPhysicalFileSystem pfs =new SourceCodeUpdaterPhysicalFileSystem();
Assert.IsNotEmpty(pfs.EnumerateDirectories(path));
}
}
} | 50.058252 | 178 | 0.669317 | [
"Apache-2.0"
] | SeanFarrow/SourceCodeUpdater | tests/SourceCodeUpdater.FileSystems.Tests/SourceCodeUpdaterPhysicalFileSystemTests.cs | 5,158 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using UltimateOrb.Collections.Specialized;
using UltimateOrb.Utilities;
namespace UltimateOrb.Collections.Plain.ValueTypes {
using static BitList;
public static class BitListExtensions {
public static ref BitVector32[] GetChunks(this ref BitList list) {
return ref Unsafe.As<Int32[], BitVector32[]>(ref list.Array);
}
public static bool Add<TSpinWait>(this BitListCore list, bool value, ref TSpinWait spinner)
where TSpinWait : IFunc<bool> {
var sdfasd = ChunkBitSize * list.Array.Value.Length;
throw new NotImplementedException();
}
public static bool TryCompareExchange<TSpinWait>(this BitListCore list, int index, bool value, bool comparand, out bool original, ref TSpinWait spinner)
where TSpinWait : IFunc<bool> {
return BitArrayExtenstions.TryCompareExchange(
ref list.Array.Value[index >> Log2DigitBitSize],
DigitBitIndexMask & index,
value, comparand, out original, ref spinner);
}
public static bool TryCompareExchange<TSpinWait>(this ref BitList list, int index, bool value, bool comparand, out bool original, ref TSpinWait spinner)
where TSpinWait : IFunc<bool> {
return TryCompareExchange(
list.Core,
DigitBitIndexMask & index,
value, comparand, out original, ref spinner);
}
public static bool TryExchange<TSpinWait>(this ref BitList list, int index, bool value, out bool original, ref TSpinWait spinner)
where TSpinWait : IFunc<bool> {
return BitArrayExtenstions.TryExchange(
ref list.Array[index >> Log2DigitBitSize],
DigitBitIndexMask & index,
value, out original, ref spinner);
}
}
public readonly ref struct BitListCore {
public readonly ByReference<Array<Int32>> Array;
public readonly ByReference<long> Count;
public BitListCore(ref int[] array, ref long count) : this() {
Array = new ByReference<Array<Int32>>(ref Unsafe.As<Int32[], Array<Int32>>(ref array));
Count = new ByReference<long>(ref count);
}
}
public struct BitList {
public BitListCore Core {
get => new BitListCore(ref Array, ref Count);
}
public const int ChunkBitSize = 32;
public const int Log2DigitBitSize = 5;
public const Int32 One = 1;
public const int DigitBitIndexMask = 32 - 1;
public Int32[] Array;
public long Count;
}
}
| 33.356322 | 160 | 0.64714 | [
"MIT"
] | LEI-Hongfaan/UltimateOrb.Core | UltimateOrb.Core/Collections/Plain/ValueTypes/BitList.cs | 2,904 | C# |
using System;
namespace Monads.POC.Web.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}
| 17.75 | 70 | 0.661972 | [
"MIT"
] | GThibeault/Monads.POC | Monads.POC.Web/Models/ErrorViewModel.cs | 213 | C# |
namespace SmartSql.Filters
{
public interface IInvokeFilter : IFilter
{
void OnInvoking(ExecutionContext context);
void OnInvoked(ExecutionContext context);
}
} | 21 | 50 | 0.698413 | [
"Apache-2.0"
] | Ahoo-Wang/SmartSql | src/SmartSql/Filters/IInvokeFilter.cs | 189 | C# |
using EventsExpress.Core.IServices;
using EventsExpress.Validation.Base;
namespace EventsExpress.ViewModels
{
public class EventEditViewModelValidator
: BaseEventViewModelValidator<EventEditViewModel>
{
public EventEditViewModelValidator(ICategoryService categoryService)
: base(categoryService)
{
}
}
}
| 24.133333 | 76 | 0.720994 | [
"MIT"
] | NastiaGerasymchuk/EventsExpress | EventsExpress/Validation/EventEditViewModelValidator.cs | 364 | C# |
using System.Net;
using NUnit.Framework;
using Resolution.Protocol;
namespace Resolution.Tests.Unit
{
[TestFixture]
public class ResponseTests
{
[Test]
public void should_parse_response_with_empty_header()
{
var content = Common.ReadFixture("Response", "empty-header_basic");
var response = new Response(new IPEndPoint(0, 0), content);
Assert.AreEqual(response.Header.Id, 0);
Assert.AreEqual(response.Header.Ra, false);
Assert.AreEqual(response.Questions.Count, 1);
Assert.AreEqual(response.Answers.Count, 1);
Assert.AreEqual(response.Authorities.Count, 1);
Assert.AreEqual(response.Additionals.Count, 1);
}
}
}
| 31.32 | 80 | 0.618135 | [
"MIT"
] | danielsen/Resolution | src/Resolution.Tests/Unit/ResponseTests.cs | 785 | C# |
// Copyright (c) 2021 Yoakke.
// Licensed under the Apache License, Version 2.0.
// Source repository: https://github.com/LanguageDev/Yoakke
using System;
using System.Collections.Generic;
using Yoakke.Platform.X86.Operands;
namespace Yoakke.Platform.X86
{
/// <summary>
/// A wrapper class for all instructions.
/// </summary>
public static class Instruction
{
#region Generated
/// <summary>
/// ASCII Adjust After Addition.
/// </summary>
public class Aaa : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Aaa"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Aaa(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// ASCII Adjust AX Before Division.
/// </summary>
public class Aad : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Aad"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Aad(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
/// <summary>
/// Initializes a new instance of the <see cref="Aad"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Aad(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// ASCII Adjust AX After Multiply.
/// </summary>
public class Aam : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Aam"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Aam(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
/// <summary>
/// Initializes a new instance of the <see cref="Aam"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Aam(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// ASCII Adjust AL After Subtraction.
/// </summary>
public class Aas : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Aas"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Aas(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Add with Carry.
/// </summary>
public class Adc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Adc"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Adc(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Unsigned Integer Addition of Two Operands with Carry Flag.
/// </summary>
public class Adcx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Adcx"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Adcx(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Add.
/// </summary>
public class Add : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Add"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Add(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Unsigned Integer Addition of Two Operands with Overflow Flag.
/// </summary>
public class Adox : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Adox"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Adox(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Logical AND.
/// </summary>
public class And : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="And"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public And(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Logical AND NOT.
/// </summary>
public class Andn : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Andn"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Andn(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Bit Field Extract.
/// </summary>
public class Bextr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Bextr"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bextr(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Fill From Lowest Clear Bit.
/// </summary>
public class Blcfill : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blcfill"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blcfill(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Isolate Lowest Clear Bit.
/// </summary>
public class Blci : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blci"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blci(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Isolate Lowest Set Bit and Complement.
/// </summary>
public class Blcic : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blcic"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blcic(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Mask From Lowest Clear Bit.
/// </summary>
public class Blcmsk : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blcmsk"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blcmsk(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Set Lowest Clear Bit.
/// </summary>
public class Blcs : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blcs"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blcs(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Fill From Lowest Set Bit.
/// </summary>
public class Blsfill : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blsfill"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blsfill(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Isolate Lowest Set Bit.
/// </summary>
public class Blsi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blsi"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blsi(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Isolate Lowest Set Bit and Complement.
/// </summary>
public class Blsic : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blsic"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blsic(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Mask From Lowest Set Bit.
/// </summary>
public class Blsmsk : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blsmsk"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blsmsk(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Reset Lowest Set Bit.
/// </summary>
public class Blsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Blsr"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Blsr(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Bit Scan Forward.
/// </summary>
public class Bsf : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Bsf"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bsf(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Bit Scan Reverse.
/// </summary>
public class Bsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Bsr"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bsr(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Byte Swap.
/// </summary>
public class Bswap : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Bswap"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bswap(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Bit Test.
/// </summary>
public class Bt : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Bt"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bt(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Bit Test and Complement.
/// </summary>
public class Btc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Btc"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Btc(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Bit Test and Reset.
/// </summary>
public class Btr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Btr"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Btr(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Bit Test and Set.
/// </summary>
public class Bts : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Bts"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bts(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Zero High Bits Starting with Specified Bit Position.
/// </summary>
public class Bzhi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Bzhi"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Bzhi(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Call Procedure.
/// </summary>
public class Call : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Call"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Call(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Convert Byte to Word.
/// </summary>
public class Cbw : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cbw"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cbw(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Convert Doubleword to Quadword.
/// </summary>
public class Cdq : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cdq"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cdq(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Clear Carry Flag.
/// </summary>
public class Clc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Clc"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Clc(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Clear Direction Flag.
/// </summary>
public class Cld : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cld"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cld(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Flush Cache Line.
/// </summary>
public class Clflush : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Clflush"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Clflush(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Flush Cache Line Optimized.
/// </summary>
public class Clflushopt : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Clflushopt"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Clflushopt(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Cache Line Write Back.
/// </summary>
public class Clwb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Clwb"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Clwb(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Zero-out 64-bit Cache Line.
/// </summary>
public class Clzero : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Clzero"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Clzero(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Complement Carry Flag.
/// </summary>
public class Cmc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cmc"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cmc(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Move if above (CF == 0 and ZF == 0).
/// </summary>
public class Cmova : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmova"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmova(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if above or equal (CF == 0).
/// </summary>
public class Cmovae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovae"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovae(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if below (CF == 1).
/// </summary>
public class Cmovb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovb"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovb(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if below or equal (CF == 1 or ZF == 1).
/// </summary>
public class Cmovbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovbe"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovbe(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if carry (CF == 1).
/// </summary>
public class Cmovc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovc"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovc(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if equal (ZF == 1).
/// </summary>
public class Cmove : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmove"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmove(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if greater (ZF == 0 and SF == OF).
/// </summary>
public class Cmovg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovg"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovg(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if greater or equal (SF == OF).
/// </summary>
public class Cmovge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovge"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovge(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if less (SF != OF).
/// </summary>
public class Cmovl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovl"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovl(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if less or equal (ZF == 1 or SF != OF).
/// </summary>
public class Cmovle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovle"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovle(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not above (CF == 1 or ZF == 1).
/// </summary>
public class Cmovna : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovna"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovna(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not above or equal (CF == 1).
/// </summary>
public class Cmovnae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnae"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnae(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not below (CF == 0).
/// </summary>
public class Cmovnb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnb"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnb(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not below or equal (CF == 0 and ZF == 0).
/// </summary>
public class Cmovnbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnbe"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnbe(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not carry (CF == 0).
/// </summary>
public class Cmovnc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnc"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnc(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not equal (ZF == 0).
/// </summary>
public class Cmovne : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovne"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovne(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not greater (ZF == 1 or SF != OF).
/// </summary>
public class Cmovng : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovng"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovng(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not greater or equal (SF != OF).
/// </summary>
public class Cmovnge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnge"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnge(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not less (SF == OF).
/// </summary>
public class Cmovnl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnl"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnl(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not less or equal (ZF == 0 and SF == OF).
/// </summary>
public class Cmovnle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnle"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnle(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not overflow (OF == 0).
/// </summary>
public class Cmovno : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovno"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovno(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not parity (PF == 0).
/// </summary>
public class Cmovnp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnp"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnp(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not sign (SF == 0).
/// </summary>
public class Cmovns : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovns"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovns(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if not zero (ZF == 0).
/// </summary>
public class Cmovnz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovnz"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovnz(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if overflow (OF == 1).
/// </summary>
public class Cmovo : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovo"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovo(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if parity (PF == 1).
/// </summary>
public class Cmovp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovp"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovp(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if parity even (PF == 1).
/// </summary>
public class Cmovpe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovpe"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovpe(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if parity odd (PF == 0).
/// </summary>
public class Cmovpo : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovpo"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovpo(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if sign (SF == 1).
/// </summary>
public class Cmovs : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovs"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovs(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Move if zero (ZF == 1).
/// </summary>
public class Cmovz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmovz"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmovz(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Compare Two Operands.
/// </summary>
public class Cmp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmp"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmp(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Compare and Exchange.
/// </summary>
public class Cmpxchg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cmpxchg"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmpxchg(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Compare and Exchange 8 Bytes.
/// </summary>
public class Cmpxchg8b : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Cmpxchg8b"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cmpxchg8b(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// CPU Identification.
/// </summary>
public class Cpuid : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cpuid"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cpuid(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Accumulate CRC32 Value.
/// </summary>
public class Crc32 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Crc32"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Crc32(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Double-Precision FP Value to Integer.
/// </summary>
public class Cvtsd2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cvtsd2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cvtsd2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Single-Precision FP Value to Dword Integer.
/// </summary>
public class Cvtss2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cvtss2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cvtss2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Double-Precision FP Value to Signed Integer.
/// </summary>
public class Cvttsd2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cvttsd2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cvttsd2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Single-Precision FP Value to Dword Integer.
/// </summary>
public class Cvttss2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Cvttss2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Cvttss2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Word to Doubleword.
/// </summary>
public class Cwd : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cwd"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cwd(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Convert Word to Doubleword.
/// </summary>
public class Cwde : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Cwde"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Cwde(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Decimal Adjust AL after Addition.
/// </summary>
public class Daa : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Daa"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Daa(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Decimal Adjust AL after Subtraction.
/// </summary>
public class Das : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Das"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Das(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Decrement by 1.
/// </summary>
public class Dec : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Dec"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Dec(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Unsigned Divide.
/// </summary>
public class Div : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Div"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Div(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Exit MMX State.
/// </summary>
public class Emms : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Emms"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Emms(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Make Stack Frame for Procedure Parameters.
/// </summary>
public class Enter : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Enter"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Enter(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Fast Exit Multimedia State.
/// </summary>
public class Femms : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Femms"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Femms(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Signed Divide.
/// </summary>
public class Idiv : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Idiv"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Idiv(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Signed Multiply.
/// </summary>
public class Imul : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Imul"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Imul(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
/// <summary>
/// Initializes a new instance of the <see cref="Imul"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Imul(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
/// <summary>
/// Initializes a new instance of the <see cref="Imul"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Imul(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Increment by 1.
/// </summary>
public class Inc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Inc"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Inc(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Call to Interrupt Procedure.
/// </summary>
public class Int : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Int"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Int(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Interrupt 4 If Overflow Flag is Set.
/// </summary>
public class Into : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Into"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Into(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Jump if above (CF == 0 and ZF == 0).
/// </summary>
public class Ja : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Ja"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Ja(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if above or equal (CF == 0).
/// </summary>
public class Jae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jae"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jae(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if below (CF == 1).
/// </summary>
public class Jb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jb"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jb(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if below or equal (CF == 1 or ZF == 1).
/// </summary>
public class Jbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jbe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jbe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if carry (CF == 1).
/// </summary>
public class Jc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jc"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jc(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if equal (ZF == 1).
/// </summary>
public class Je : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Je"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Je(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if ECX register is 0.
/// </summary>
public class Jecxz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jecxz"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jecxz(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if greater (ZF == 0 and SF == OF).
/// </summary>
public class Jg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jg"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jg(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if greater or equal (SF == OF).
/// </summary>
public class Jge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jge"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jge(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if less (SF != OF).
/// </summary>
public class Jl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jl"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jl(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if less or equal (ZF == 1 or SF != OF).
/// </summary>
public class Jle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jle"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jle(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump Unconditionally.
/// </summary>
public class Jmp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jmp"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jmp(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not above (CF == 1 or ZF == 1).
/// </summary>
public class Jna : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jna"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jna(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not above or equal (CF == 1).
/// </summary>
public class Jnae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnae"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnae(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not below (CF == 0).
/// </summary>
public class Jnb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnb"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnb(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not below or equal (CF == 0 and ZF == 0).
/// </summary>
public class Jnbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnbe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnbe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not carry (CF == 0).
/// </summary>
public class Jnc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnc"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnc(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not equal (ZF == 0).
/// </summary>
public class Jne : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jne"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jne(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not greater (ZF == 1 or SF != OF).
/// </summary>
public class Jng : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jng"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jng(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not greater or equal (SF != OF).
/// </summary>
public class Jnge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnge"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnge(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not less (SF == OF).
/// </summary>
public class Jnl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnl"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnl(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not less or equal (ZF == 0 and SF == OF).
/// </summary>
public class Jnle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnle"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnle(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not overflow (OF == 0).
/// </summary>
public class Jno : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jno"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jno(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not parity (PF == 0).
/// </summary>
public class Jnp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnp"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnp(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not sign (SF == 0).
/// </summary>
public class Jns : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jns"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jns(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if not zero (ZF == 0).
/// </summary>
public class Jnz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jnz"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jnz(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if overflow (OF == 1).
/// </summary>
public class Jo : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jo"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jo(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if parity (PF == 1).
/// </summary>
public class Jp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jp"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jp(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if parity even (PF == 1).
/// </summary>
public class Jpe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jpe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jpe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if parity odd (PF == 0).
/// </summary>
public class Jpo : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jpo"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jpo(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if sign (SF == 1).
/// </summary>
public class Js : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Js"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Js(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Jump if zero (ZF == 1).
/// </summary>
public class Jz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Jz"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Jz(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Load Status Flags into AH Register.
/// </summary>
public class Lahf : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Lahf"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Lahf(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Load MXCSR Register.
/// </summary>
public class Ldmxcsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Ldmxcsr"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Ldmxcsr(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Load Effective Address.
/// </summary>
public class Lea : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Lea"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Lea(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// High Level Procedure Exit.
/// </summary>
public class Leave : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Leave"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Leave(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Load Fence.
/// </summary>
public class Lfence : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Lfence"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Lfence(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Count the Number of Leading Zero Bits.
/// </summary>
public class Lzcnt : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Lzcnt"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Lzcnt(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Memory Fence.
/// </summary>
public class Mfence : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Mfence"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Mfence(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Monitor a Linear Address Range.
/// </summary>
public class Monitor : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Monitor"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Monitor(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Monitor a Linear Address Range with Timeout.
/// </summary>
public class Monitorx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Monitorx"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Monitorx(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Move.
/// </summary>
public class Mov : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Mov"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Mov(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Move Data After Swapping Bytes.
/// </summary>
public class Movbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Movbe"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Movbe(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Store Doubleword Using Non-Temporal Hint.
/// </summary>
public class Movnti : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Movnti"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Movnti(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Move with Sign-Extension.
/// </summary>
public class Movsx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Movsx"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Movsx(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Move with Zero-Extend.
/// </summary>
public class Movzx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Movzx"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Movzx(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Unsigned Multiply.
/// </summary>
public class Mul : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Mul"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Mul(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Unsigned Multiply Without Affecting Flags.
/// </summary>
public class Mulx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Mulx"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Mulx(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Monitor Wait.
/// </summary>
public class Mwait : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Mwait"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Mwait(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Monitor Wait with Timeout.
/// </summary>
public class Mwaitx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Mwaitx"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Mwaitx(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Two's Complement Negation.
/// </summary>
public class Neg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Neg"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Neg(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// No Operation.
/// </summary>
public class Nop : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Nop"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Nop(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// One's Complement Negation.
/// </summary>
public class Not : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Not"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Not(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Logical Inclusive OR.
/// </summary>
public class Or : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Or"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Or(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Spin Loop Hint.
/// </summary>
public class Pause : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Pause"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Pause(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Parallel Bits Deposit.
/// </summary>
public class Pdep : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Pdep"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Pdep(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Parallel Bits Extract.
/// </summary>
public class Pext : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Pext"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Pext(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Pop a Value from the Stack.
/// </summary>
public class Pop : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Pop"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Pop(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Count of Number of Bits Set to 1.
/// </summary>
public class Popcnt : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Popcnt"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Popcnt(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data into Caches.
/// </summary>
public class Prefetch : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetch"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetch(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data Into Caches using NTA Hint.
/// </summary>
public class Prefetchnta : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetchnta"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetchnta(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data Into Caches using T0 Hint.
/// </summary>
public class Prefetcht0 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetcht0"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetcht0(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data Into Caches using T1 Hint.
/// </summary>
public class Prefetcht1 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetcht1"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetcht1(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data Into Caches using T2 Hint.
/// </summary>
public class Prefetcht2 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetcht2"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetcht2(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Data into Caches in Anticipation of a Write.
/// </summary>
public class Prefetchw : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetchw"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetchw(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Prefetch Vector Data Into Caches with Intent to Write and T1 Hint.
/// </summary>
public class Prefetchwt1 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Prefetchwt1"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Prefetchwt1(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Push Value Onto the Stack.
/// </summary>
public class Push : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Push"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Push(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Rotate Left through Carry Flag.
/// </summary>
public class Rcl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Rcl"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rcl(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Rotate Right through Carry Flag.
/// </summary>
public class Rcr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Rcr"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rcr(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Read Random Number.
/// </summary>
public class Rdrand : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Rdrand"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rdrand(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Read Random SEED.
/// </summary>
public class Rdseed : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Rdseed"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rdseed(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Read Time-Stamp Counter.
/// </summary>
public class Rdtsc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Rdtsc"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Rdtsc(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Read Time-Stamp Counter and Processor ID.
/// </summary>
public class Rdtscp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Rdtscp"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Rdtscp(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Return from Procedure.
/// </summary>
public class Ret : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Ret"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Ret(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
/// <summary>
/// Initializes a new instance of the <see cref="Ret"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Ret(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Rotate Left.
/// </summary>
public class Rol : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Rol"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rol(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Rotate Right.
/// </summary>
public class Ror : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Ror"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Ror(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Rotate Right Logical Without Affecting Flags.
/// </summary>
public class Rorx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Rorx"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Rorx(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Store AH into Flags.
/// </summary>
public class Sahf : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Sahf"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Sahf(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Arithmetic Shift Left.
/// </summary>
public class Sal : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Sal"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sal(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Arithmetic Shift Right.
/// </summary>
public class Sar : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Sar"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sar(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Arithmetic Shift Right Without Affecting Flags.
/// </summary>
public class Sarx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Sarx"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sarx(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Subtract with Borrow.
/// </summary>
public class Sbb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Sbb"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sbb(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if above (CF == 0 and ZF == 0).
/// </summary>
public class Seta : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Seta"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Seta(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if above or equal (CF == 0).
/// </summary>
public class Setae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setae"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setae(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if below (CF == 1).
/// </summary>
public class Setb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setb"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setb(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if below or equal (CF == 1 or ZF == 1).
/// </summary>
public class Setbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setbe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setbe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if carry (CF == 1).
/// </summary>
public class Setc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setc"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setc(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if equal (ZF == 1).
/// </summary>
public class Sete : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Sete"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sete(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if greater (ZF == 0 and SF == OF).
/// </summary>
public class Setg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setg"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setg(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if greater or equal (SF == OF).
/// </summary>
public class Setge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setge"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setge(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if less (SF != OF).
/// </summary>
public class Setl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setl"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setl(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if less or equal (ZF == 1 or SF != OF).
/// </summary>
public class Setle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setle"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setle(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not above (CF == 1 or ZF == 1).
/// </summary>
public class Setna : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setna"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setna(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not above or equal (CF == 1).
/// </summary>
public class Setnae : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnae"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnae(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not below (CF == 0).
/// </summary>
public class Setnb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnb"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnb(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not below or equal (CF == 0 and ZF == 0).
/// </summary>
public class Setnbe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnbe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnbe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not carry (CF == 0).
/// </summary>
public class Setnc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnc"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnc(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not equal (ZF == 0).
/// </summary>
public class Setne : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setne"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setne(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not greater (ZF == 1 or SF != OF).
/// </summary>
public class Setng : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setng"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setng(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not greater or equal (SF != OF).
/// </summary>
public class Setnge : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnge"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnge(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not less (SF == OF).
/// </summary>
public class Setnl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnl"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnl(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not less or equal (ZF == 0 and SF == OF).
/// </summary>
public class Setnle : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnle"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnle(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not overflow (OF == 0).
/// </summary>
public class Setno : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setno"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setno(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not parity (PF == 0).
/// </summary>
public class Setnp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnp"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnp(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not sign (SF == 0).
/// </summary>
public class Setns : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setns"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setns(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if not zero (ZF == 0).
/// </summary>
public class Setnz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setnz"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setnz(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if overflow (OF == 1).
/// </summary>
public class Seto : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Seto"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Seto(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if parity (PF == 1).
/// </summary>
public class Setp : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setp"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setp(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if parity even (PF == 1).
/// </summary>
public class Setpe : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setpe"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setpe(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if parity odd (PF == 0).
/// </summary>
public class Setpo : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setpo"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setpo(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if sign (SF == 1).
/// </summary>
public class Sets : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Sets"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sets(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Set byte if zero (ZF == 1).
/// </summary>
public class Setz : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Setz"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Setz(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Store Fence.
/// </summary>
public class Sfence : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Sfence"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Sfence(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Logical Shift Left.
/// </summary>
public class Shl : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Shl"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shl(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Integer Double Precision Shift Left.
/// </summary>
public class Shld : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Shld"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shld(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Logical Shift Left Without Affecting Flags.
/// </summary>
public class Shlx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Shlx"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shlx(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Logical Shift Right.
/// </summary>
public class Shr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Shr"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shr(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Integer Double Precision Shift Right.
/// </summary>
public class Shrd : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Shrd"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shrd(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Logical Shift Right Without Affecting Flags.
/// </summary>
public class Shrx : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The 1st operand.
/// </summary>
public IOperand Operand1 => this.Operands[0];
/// <summary>
/// The 2nd operand.
/// </summary>
public IOperand Operand2 => this.Operands[1];
/// <summary>
/// The 3rd operand.
/// </summary>
public IOperand Operand3 => this.Operands[2];
/// <summary>
/// Initializes a new instance of the <see cref="Shrx"/> class.
/// </summary>
/// <param name="operand1">The 1st operand.</param>
/// <param name="operand2">The 2nd operand.</param>
/// <param name="operand3">The 3rd operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Shrx(IOperand operand1, IOperand operand2, IOperand operand3, string? comment = null)
{
this.Operands = new[] { operand1, operand2, operand3 };
this.Comment = comment;
}
}
/// <summary>
/// Set Carry Flag.
/// </summary>
public class Stc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Stc"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Stc(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Set Direction Flag.
/// </summary>
public class Std : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Std"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Std(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Store MXCSR Register State.
/// </summary>
public class Stmxcsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Stmxcsr"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Stmxcsr(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Subtract.
/// </summary>
public class Sub : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Sub"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Sub(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
/// <summary>
/// Inverse Mask From Trailing Ones.
/// </summary>
public class T1mskc : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="T1mskc"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public T1mskc(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Logical Compare.
/// </summary>
public class Test : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Test"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Test(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Count the Number of Trailing Zero Bits.
/// </summary>
public class Tzcnt : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Tzcnt"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Tzcnt(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Mask From Trailing Zeros.
/// </summary>
public class Tzmsk : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Tzmsk"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Tzmsk(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Undefined Instruction.
/// </summary>
public class Ud2 : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Ud2"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Ud2(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Double-Precision FP Value to Integer.
/// </summary>
public class Vcvtsd2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvtsd2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvtsd2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Double-Precision Floating-Point Value to Unsigned Doubleword Integer.
/// </summary>
public class Vcvtsd2usi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvtsd2usi"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvtsd2usi(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Single-Precision FP Value to Dword Integer.
/// </summary>
public class Vcvtss2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvtss2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvtss2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert Scalar Single-Precision Floating-Point Value to Unsigned Doubleword Integer.
/// </summary>
public class Vcvtss2usi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvtss2usi"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvtss2usi(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Double-Precision FP Value to Signed Integer.
/// </summary>
public class Vcvttsd2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvttsd2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvttsd2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Double-Precision Floating-Point Value to Unsigned Integer.
/// </summary>
public class Vcvttsd2usi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvttsd2usi"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvttsd2usi(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Single-Precision FP Value to Dword Integer.
/// </summary>
public class Vcvttss2si : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvttss2si"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvttss2si(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Convert with Truncation Scalar Single-Precision Floating-Point Value to Unsigned Integer.
/// </summary>
public class Vcvttss2usi : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The output operand.
/// </summary>
public IOperand Destination => this.Operands[0];
/// <summary>
/// The input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Vcvttss2usi"/> class.
/// </summary>
/// <param name="destination">The output operand.</param>
/// <param name="source">The input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vcvttss2usi(IOperand destination, IOperand source, string? comment = null)
{
this.Operands = new[] { destination, source };
this.Comment = comment;
}
}
/// <summary>
/// Load MXCSR Register.
/// </summary>
public class Vldmxcsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Vldmxcsr"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vldmxcsr(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Store MXCSR Register State.
/// </summary>
public class Vstmxcsr : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The operand.
/// </summary>
public IOperand Operand => this.Operands[0];
/// <summary>
/// Initializes a new instance of the <see cref="Vstmxcsr"/> class.
/// </summary>
/// <param name="operand">The operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Vstmxcsr(IOperand operand, string? comment = null)
{
this.Operands = new[] { operand };
this.Comment = comment;
}
}
/// <summary>
/// Zero All YMM Registers.
/// </summary>
public class Vzeroall : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Vzeroall"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Vzeroall(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Zero Upper Bits of YMM Registers.
/// </summary>
public class Vzeroupper : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Vzeroupper"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Vzeroupper(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Exchange and Add.
/// </summary>
public class Xadd : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Xadd"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Xadd(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Exchange Register/Memory with Register.
/// </summary>
public class Xchg : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first operand.
/// </summary>
public IOperand First => this.Operands[0];
/// <summary>
/// The second operand.
/// </summary>
public IOperand Second => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Xchg"/> class.
/// </summary>
/// <param name="first">The first operand.</param>
/// <param name="second">The second operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Xchg(IOperand first, IOperand second, string? comment = null)
{
this.Operands = new[] { first, second };
this.Comment = comment;
}
}
/// <summary>
/// Get Value of Extended Control Register.
/// </summary>
public class Xgetbv : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Xgetbv"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Xgetbv(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Table Look-up Translation.
/// </summary>
public class Xlatb : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="Xlatb"/> class.
/// </summary>
/// <param name="comment">The optional inline comment.</param>
public Xlatb(string? comment = null)
{
this.Operands = Array.Empty<IOperand>();
this.Comment = comment;
}
}
/// <summary>
/// Logical Exclusive OR.
/// </summary>
public class Xor : IInstruction
{
/// <inheritdoc/>
public IReadOnlyList<IOperand> Operands { get; }
/// <inheritdoc/>
public string? Comment { get; init; }
/// <summary>
/// The first input (and output) operand.
/// </summary>
public IOperand Target => this.Operands[0];
/// <summary>
/// The second input operand.
/// </summary>
public IOperand Source => this.Operands[1];
/// <summary>
/// Initializes a new instance of the <see cref="Xor"/> class.
/// </summary>
/// <param name="target">The first input (and output) operand.</param>
/// <param name="source">The second input operand.</param>
/// <param name="comment">The optional inline comment.</param>
public Xor(IOperand target, IOperand source, string? comment = null)
{
this.Operands = new[] { target, source };
this.Comment = comment;
}
}
#endregion Generated
}
}
| 33.873507 | 105 | 0.475854 | [
"Apache-2.0"
] | kant2002/Yoakke | Sources/Core/Yoakke.Platform.X86/Instruction.cs | 243,957 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LlockhamIndustries.Decals
{
public abstract class Modifier : MonoBehaviour
{
[SerializeField]
private Frequency frequency;
public Frequency Frequency
{
get { return frequency; }
set
{
if (value != frequency)
{
//Deregister from old frequency
Deregister();
//Set new frequency value
frequency = value;
//Register to new frequency
Register();
}
}
}
protected float UpdateRate
{
get
{
switch (frequency)
{
case Frequency.TenPerSec: return 0.1f;
case Frequency.OncePerSec: return 1;
}
return Time.deltaTime;
}
}
protected virtual void OnEnable()
{
Begin();
Register();
}
protected virtual void OnDisable()
{
Deregister();
}
private void Register()
{
if (Application.isPlaying && gameObject.activeInHierarchy)
{
ModifierManager.Register(this);
}
}
private void Deregister()
{
if (Application.isPlaying && gameObject.activeInHierarchy)
{
ModifierManager.Deregister(this);
}
}
protected abstract void Begin();
public abstract void Perform();
}
public enum Frequency { PerFrame, TenPerSec, OncePerSec };
} | 24.534247 | 70 | 0.465103 | [
"MIT"
] | DavSchwartz/HackNSlashTechDemo | Assets/Dynamic Decals/Scripts/Modifiers/Core/Modifier.cs | 1,793 | C# |
using ApiGateway.Commons;
using System.Collections.Generic;
namespace ApiGateway.Core.RestServices.Model
{
public class RestServiceResponse : ValueObjectBase
{
public int StatusCode { get; set; }
public IList<Header> Headers { get; set; }
public string Body { get; set; }
protected override void Validate()
{
throw new System.NotImplementedException();
}
}
} | 25.470588 | 55 | 0.644342 | [
"MIT"
] | harry0422/ApiGateway | ApiGateway.Core/RestServices/Model/RestServiceResponse.cs | 435 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
using TUF.Inputs;
namespace TUF.Core
{
[System.Serializable]
public class CameraShakeDefinition
{
public float amplitude;
public float frequency;
public float holdLength;
public float fadeLength;
public float amplitudeDecay;
public float frequencyDecay;
}
}
| 21.1 | 38 | 0.699052 | [
"MIT"
] | christides11/touhou-unlimited-fantasies | Assets/_Project/Scripts/Camera/CameraShakeDefinition.cs | 424 | C# |
using LM.Domain.Entities;
using LM.Domain.Repositories;
using LM.Responses;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LM.Infra.Repositories
{
public abstract class Repository<TEntity, TDbContext> : IRepository<TEntity>
where TEntity : Entity
where TDbContext : DbContext
{
protected TDbContext Context { get; }
public DbSet<TEntity> DbSet => Context.Set<TEntity>();
public Repository(TDbContext context) => Context = context;
public virtual async Task<Maybe<TEntity>> FindAsync(Guid code) => await DbSet.SingleOrDefaultAsync(x => x.Code == code);
public Task AddAsync(TEntity entity)
{
DbSet.Add(entity);
return Task.CompletedTask;
}
public virtual Task RemoveAsync(TEntity entity)
{
Context.Entry(entity).State = EntityState.Deleted;
return Task.CompletedTask;
}
public virtual Task UpdateAsync(TEntity entity)
{
DbSet.Update(entity);
return Task.CompletedTask;
}
public virtual Task UpdateRangeAsync(ICollection<TEntity> entityCollection)
{
foreach (var entity in entityCollection)
UpdateAsync(entity);
return Task.CompletedTask;
}
public async virtual Task AddRangeAsync(IEnumerable<TEntity> entityCollection)
=> await DbSet.AddRangeAsync(entityCollection);
public virtual Task RemoveRangeAsync(ICollection<TEntity> entityCollection)
{
foreach (var entity in entityCollection)
RemoveAsync(entity);
return Task.CompletedTask;
}
public virtual Task<List<TEntity>> GetAllAsync() => DbSet.ToListAsync();
public async virtual Task<List<TEntity>> FindAsync(List<Guid> codes)
=> await DbSet.Where(x => codes.Contains(x.Code)).ToListAsync();
}
}
| 31.323077 | 128 | 0.645874 | [
"MIT"
] | lauro-miranda/infra | LM.Infra/Repositories/Repository.cs | 2,038 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
namespace ODataValidator.Rule
{
#region Namespace.
using System;
using System.ComponentModel.Composition;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ODataValidator.Rule.Helper;
using ODataValidator.RuleEngine;
using ODataValidator.RuleEngine.Common;
#endregion
/// <summary>
/// Class of service implemenation feature to verify .
/// </summary>
[Export(typeof(ExtensionRule))]
public class ServiceImpl_SystemQueryOptionFilter_Contains : ServiceImplExtensionRule
{
/// <summary>
/// Gets the service implementation feature name
/// </summary>
public override string Name
{
get
{
return "ServiceImpl_SystemQueryOptionFilter_Contains";
}
}
/// <summary>
/// Gets the service implementation feature description
/// </summary>
public override string Description
{
get
{
return this.CategoryInfo.CategoryFullName + ",$filter(contains)";
}
}
/// <summary>
/// Gets the service implementation feature specification in OData document
/// </summary>
public override string V4SpecificationSection
{
get
{
return "";
}
}
/// <summary>
/// Gets the service implementation feature level.
/// </summary>
public override RequirementLevel RequirementLevel
{
get
{
return RequirementLevel.Must;
}
}
/// <summary>
/// Gets the service implementation category.
/// </summary>
public override ServiceImplCategory CategoryInfo
{
get
{
var parent = new ServiceImplCategory(ServiceImplCategoryName.RequestingData);
parent = new ServiceImplCategory(ServiceImplCategoryName.SystemQueryOption, parent);
return new ServiceImplCategory(ServiceImplCategoryName.ArithmeticOperators, parent);
}
}
/// <summary>
/// Verifies the service implementation feature.
/// </summary>
/// <param name="context">The Interop service context</param>
/// <param name="info">out parameter to return violation information when rule does not pass</param>
/// <returns>true if the service implementation feature passes; false otherwise</returns>
public override bool? Verify(ServiceContext context, out ExtensionRuleViolationInfo info)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
bool? passed = null;
info = null;
var svcStatus = ServiceStatus.GetInstance();
string entityTypeShortName;
var propNames = MetadataHelper.GetPropertyNames("Edm.String", out entityTypeShortName);
if (null == propNames || !propNames.Any())
{
return passed;
}
string propName = propNames[0];
var entitySetUrl = entityTypeShortName.MapEntityTypeShortNameToEntitySetURL();
string url = svcStatus.RootURL.TrimEnd('/') + "/" + entitySetUrl;
var resp = WebHelper.Get(new Uri(url), string.Empty, RuleEngineSetting.Instance().DefaultMaximumPayloadSize, svcStatus.DefaultHeaders);
if (null != resp && HttpStatusCode.OK == resp.StatusCode)
{
JObject jObj = JObject.Parse(resp.ResponsePayload);
JArray jArr = jObj.GetValue(Constants.Value) as JArray;
var entity = jArr.First as JObject;
var propVal = entity[propName].ToString();
string subStr = propVal.Substring(propVal.Length / 2);
url = string.Format("{0}?$filter=contains({1}, '{2}')", url, propName, subStr);
resp = WebHelper.Get(new Uri(url), string.Empty, RuleEngineSetting.Instance().DefaultMaximumPayloadSize, svcStatus.DefaultHeaders);
var detail = new ExtensionRuleResultDetail(this.Name, url, HttpMethod.Get, string.Empty);
info = new ExtensionRuleViolationInfo(new Uri(url), string.Empty, detail);
if (null != resp && HttpStatusCode.OK == resp.StatusCode)
{
jObj = JObject.Parse(resp.ResponsePayload);
jArr = jObj.GetValue(Constants.Value) as JArray;
foreach (JObject et in jArr)
{
passed = et[propName].ToString().Contains(subStr);
}
}
else
{
passed = false;
}
}
return passed;
}
}
}
| 37 | 147 | 0.569722 | [
"MIT"
] | OData/ValidationTool | src/CodeRules/ServiceImplementation/ServiceImpl_SystemQueryOptionFilter_Contains.cs | 5,108 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// 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("C4RT4")]
[assembly: AssemblyDescription("Jeux de cartes")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Soluce-Focus")]
[assembly: AssemblyProduct("C4RT4")]
[assembly: AssemblyCopyright("Copyright © Build 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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fa4a3118-d7df-4378-80e9-0f6a9f4e2219")]
// 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.5.100.0")]
[assembly: AssemblyFileVersion("2.5.100.0")]
[assembly: NeutralResourcesLanguageAttribute("fr-FR")]
| 38.384615 | 84 | 0.750835 | [
"MIT"
] | melharfi/C4RT4 | C4RT4/Properties/AssemblyInfo.cs | 1,500 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
namespace SessionDownloader.Utils
{
/// <summary>
/// Class to manage file downloading
/// </summary>
public class FileDownloader
{
public void DownloadFile(string remoteUrl, string destinationFilename, bool checkExistingFile = true)
{
using (WebClient wc = new WebClient())
{
try
{
Console.WriteLine($"\t Downloading {remoteUrl}");
wc.DownloadFile(remoteUrl, destinationFilename);
Console.WriteLine($"\t Download completed at {DateTime.Now}");
long length = new FileInfo(destinationFilename).Length;
if (length == 22)
{
Console.WriteLine($"\t File invalid. Deleting.");
File.Delete(destinationFilename);
}
}
catch (Exception)
{
//WriteWarning($"Unable to download file at {remoteUri} to {destinationFilename}");
}
}
}
}
}
| 26.212766 | 109 | 0.505682 | [
"MIT"
] | FrankLaVigne/SessionDownloader | SessionDownloader2019/Utils/FileDownloader.cs | 1,234 | 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 Plugin.Bright.Serialization;
using System.Collections.Generic;
using System;
namespace cfg.test
{
public sealed class TbDemoGroupDefineFromExcel
{
private readonly Dictionary<int, test.DemoGroup> _dataMap;
private readonly List<test.DemoGroup> _dataList;
public TbDemoGroupDefineFromExcel(ByteBuf _buf)
{
_dataMap = new Dictionary<int, test.DemoGroup>();
_dataList = new List<test.DemoGroup>();
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
test.DemoGroup _v;
_v = test.DemoGroup.DeserializeDemoGroup(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.Id, _v);
}
}
public Dictionary<int, test.DemoGroup> DataMap => _dataMap;
public List<test.DemoGroup> DataList => _dataList;
public test.DemoGroup GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public test.DemoGroup Get(int key) => _dataMap[key];
public test.DemoGroup this[int key] => _dataMap[key];
public void Resolve(Dictionary<string, object> _tables)
{
foreach(var v in _dataList)
{
v.Resolve(_tables);
}
}
public void TranslateText(System.Func<string, string, string> translator)
{
foreach(var v in _dataList)
{
v.TranslateText(translator);
}
}
public void ForeachCfg(Func<test.DemoGroup, bool> callback)
{
foreach(var v in _dataList)
{
if(!callback(v))
{
break;
}
}
}
}
} | 27.408451 | 99 | 0.554471 | [
"Apache-2.0"
] | StanRuaW/AshFramework | client/Editor/AshFramework/Assets/Config/output_code/test/TbDemoGroupDefineFromExcel.cs | 1,946 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace master._7zip
{
internal static class Log
{
private static Stack<string> _indent = new Stack<string>();
private static bool _needsIndent = true;
static Log()
{
_indent.Push("");
}
public static void PushIndent(string indent = " ")
{
_indent.Push(_indent.Peek() + indent);
}
public static void PopIndent()
{
if(_indent.Count == 1)
throw new InvalidOperationException();
_indent.Pop();
}
private static void EnsureIndent()
{
if(_needsIndent)
{
_needsIndent = false;
System.Diagnostics.Debug.Write(_indent.Peek());
}
}
public static void Write(object value)
{
EnsureIndent();
System.Diagnostics.Debug.Write(value);
}
public static void Write(string text)
{
EnsureIndent();
System.Diagnostics.Debug.Write(text);
}
public static void Write(string format, params object[] args)
{
EnsureIndent();
System.Diagnostics.Debug.Write(string.Format(format, args));
}
public static void WriteLine()
{
System.Diagnostics.Debug.WriteLine("");
_needsIndent = true;
}
public static void WriteLine(object value)
{
EnsureIndent();
System.Diagnostics.Debug.WriteLine(value);
_needsIndent = true;
}
public static void WriteLine(string text)
{
EnsureIndent();
System.Diagnostics.Debug.WriteLine(text);
_needsIndent = true;
}
public static void WriteLine(string format, params object[] args)
{
EnsureIndent();
System.Diagnostics.Debug.WriteLine(string.Format(format, args));
_needsIndent = true;
}
}
}
| 25.643678 | 77 | 0.513671 | [
"MIT"
] | mostlyuseful/managed-lzma | master/7zip/Log.cs | 2,233 | C# |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Good.BusinessLayer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Good.BusinessLayer")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("941ff41f-25e3-410d-9d21-eb80986eed23")]
// 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.916667 | 84 | 0.745055 | [
"MIT"
] | saip106/exploring-structuremap | Good.BusinessLayer/Properties/AssemblyInfo.cs | 1,368 | 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("VRCMoreRefresh")]
[assembly: AssemblyDescription("Adds more refresh buttons to VRChat.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AtiLion")]
[assembly: AssemblyProduct("VRCMoreRefresh")]
[assembly: AssemblyCopyright("Copyright © AtiLion 2019")]
[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("d313cf6c-7df8-4391-a917-1a6a18e69cc3")]
// 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("0.0.1.0")]
[assembly: AssemblyFileVersion("0.0.1.0")]
| 39.081081 | 84 | 0.753112 | [
"MIT"
] | AtiLion/VRCMoreRefresh | Properties/AssemblyInfo.cs | 1,449 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma warning disable SA1402 // File may only contain a single type
using System.Collections.Generic;
namespace Azure.Storage.Files.Shares.Models
{
/// <summary>
/// Contains file share range information returned from the ShareFileClient.GetRangeList operations.
/// </summary>
public class ShareFileRangeInfo
{
/// <summary>
/// Model type expected by the protocol layer.
/// </summary>
private readonly ShareFileRangeInfoInternal _shareFileRangeInfoInternal;
/// <summary>
/// The date/time that the file was last modified. Any operation that modifies the file, including an update of the file's metadata or properties, changes the file's last modified time.
/// </summary>
public System.DateTimeOffset LastModified => _shareFileRangeInfoInternal.LastModified;
/// <summary>
/// The ETag contains a value which represents the version of the file, in quotes.
/// </summary>
public ETag ETag => _shareFileRangeInfoInternal.ETag;
/// <summary>
/// The size of the file in bytes.
/// </summary>
public long FileContentLength => _shareFileRangeInfoInternal.FileContentLength;
/// <summary>
/// A list of non-overlapping valid ranges, sorted by increasing address range.
/// </summary>
public IEnumerable<HttpRange> Ranges { get; internal set; }
/// <summary>
/// Creates a new PageRangesInfo instance
/// </summary>
internal ShareFileRangeInfo(ShareFileRangeInfoInternal rangesInfoInternal)
{
_shareFileRangeInfoInternal = rangesInfoInternal;
// convert from internal Range type to HttpRange
var ranges = new List<HttpRange>();
foreach (Range range in rangesInfoInternal.Ranges)
{
ranges.Add(new HttpRange(range.Start, range.End - range.Start + 1));
}
Ranges = ranges;
}
}
/// <summary>
/// ShareModelFactory provides utilities for mocking.
/// </summary>
public static partial class ShareModelFactory
{
/// <summary>
/// Creates a new ShareFileRangeInfo instance for mocking.
/// </summary>
public static ShareFileRangeInfo ShareFileRangeInfo(
System.DateTimeOffset lastModified,
Azure.ETag eTag,
long fileContentLength,
IEnumerable<HttpRange> ranges)
{
var shareFileRangeInfo =
new ShareFileRangeInfo(
new ShareFileRangeInfoInternal()
{
LastModified = lastModified,
ETag = eTag,
FileContentLength = fileContentLength
}
)
{
Ranges = ranges
};
return shareFileRangeInfo;
}
}
}
| 35.356322 | 193 | 0.595904 | [
"MIT"
] | AbelHu/azure-sdk-for-net | sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileRangeInfo.cs | 3,078 | C# |
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace LogisticsManager {
public partial class UpdateDriver {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtName;
/// <summary>
/// rdlSex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButtonList rdlSex;
/// <summary>
/// txtBeginTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputText txtBeginTime;
/// <summary>
/// txtPhone 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPhone;
/// <summary>
/// txtIDCard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtIDCard;
/// <summary>
/// ddlTruck 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlTruck;
/// <summary>
/// rdlState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButtonList rdlState;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtRemark;
/// <summary>
/// btnUpdate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnUpdate;
/// <summary>
/// btnReset 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnReset;
}
}
| 27.73913 | 81 | 0.466144 | [
"MIT"
] | hc-hub/LogisticsManager | LogisticsManager/LogisticsManager/UpdateDriver.aspx.designer.cs | 4,156 | C# |
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace rox.mt4.rest
{
using rox.mt4.api;
public partial class MT4Controller
{
[HttpGet]
public async Task<List<ConPluginParam>> CfgRequestPlugin(int codePage)
{
return await Task.Run(() => manager.CfgRequestPlugin(codePage));
}
public class ModelForUpdatePlugin
{
public ConPlugin cfg;
public PluginCfg parurd;
}
[HttpPost]
public async Task CfgUpdatePlugin([FromBody] ModelForUpdatePlugin cfg, int total)
{
await Task.Run(() => manager.CfgUpdatePlugin(cfg.cfg, cfg.parurd, total));
}
[HttpPost]
public async Task CfgShiftPlugin(int pos, int shift)
{
await Task.Run(() => manager.CfgShiftPlugin(pos, shift));
}
[HttpPost]
public async Task PluginUpdate([FromBody] ConPluginParam plugin)
{
await Task.Run(() => manager.PluginUpdate(plugin));
}
[HttpGet]
public async Task<List<ConPlugin>> PluginsGet(int codePage)
{
return await Task.Run(() => manager.PluginsGet(codePage));
}
[HttpGet]
public async Task<ConPluginParam> PluginParamGet(int pos, int codePage)
{
return await Task.Run(() => manager.PluginParamGet(pos, codePage));
}
}
}
| 27.716981 | 89 | 0.59224 | [
"MIT"
] | SolomatovS/Rox.MT | samples/mtmanapi.rest/Controllers/Configuration/Plugin.cs | 1,471 | C# |
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Text.RegularExpressions;
namespace Roslynator.CSharp.Refactorings.Tests
{
internal class ReplaceHasFlagWithBitwiseOperationRefactoring
{
public void Do()
{
RegexOptions options = RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase;
if (options.HasFlag(RegexOptions.IgnoreCase))
{
}
if (!options.HasFlag(RegexOptions.IgnoreCase))
{
}
}
}
}
| 27.826087 | 160 | 0.646875 | [
"Apache-2.0"
] | ADIX7/Roslynator | src/Tests/Refactorings.Tests.Old/ReplaceHasFlagWithBitwiseOperationRefactoring.cs | 642 | C# |
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SqlJobQueueItem.cs" company="Health Catalyst">
//
// </copyright>
// <summary>
// Defines the SqlJobQueueItem type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Fabric.Databus.QueueItems
{
using Fabric.Databus.Config;
using Fabric.Databus.Interfaces.Queues;
/// <inheritdoc />
/// <summary>
/// The sql job queue item.
/// </summary>
public class SqlJobQueueItem : IQueueItem
{
/// <inheritdoc />
public string QueryId { get; set; }
/// <inheritdoc />
public string PropertyName { get; set; }
public int BatchNumber { get; set; }
public int TotalBatches { get; set; }
/// <summary>
/// Gets or sets the job.
/// </summary>
public IJob Job { get; set; }
}
}
| 27.675676 | 120 | 0.4375 | [
"Apache-2.0"
] | HealthCatalyst/Fabric.Databus | Fabric.Databus.QueueItems/SqlJobQueueItem.cs | 1,026 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModelLib.ViewModelProperties;
namespace ViewModelLib.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public class BoolPropertyAttribute:PropertyAttribute
{
public override IViewModelProperty CreateViewModelProperty(IEnumerable<IViewModel> ViewModels, PropertyDescriptor pd, bool AutoApply)
{
return new BoolViewModelProperty(ViewModels, pd, Header ?? pd.Name, Category, IsMandatory, IsReadOnly,AutoApply);
}
}
}
| 26.954545 | 135 | 0.817875 | [
"MIT"
] | dfgs/MVVMLib | ViewModelLib/Attributes/BoolPropertyAttribute.cs | 595 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using ERY.EMath;
namespace TightBindingSuite
{
public class BandTetrahedron
{
public BandTetrahedron (TightBinding tb, Vector3 anchor, KptList kpts, List<int> indices)
{
for (int i = 0; i < indices.Count; i++)
{
KPoint kpt = kpts.Kpts[indices[i]].Clone();
Vector3 delta = kpt.Value - anchor;
ShiftDelta(ref delta, tb.Lattice.G1);
ShiftDelta(ref delta, tb.Lattice.G2);
ShiftDelta(ref delta, tb.Lattice.G3);
kpt.Value = delta + anchor;
this.kpts.Add(kpt);
}
CalculateVelocityMatrix();
}
void CalculateVelocityMatrix()
{
Matrix m = new Matrix(3,3);
for (int i = 1; i <= 3; i++)
{
for (int j = 0; j < 3; j++)
{
m[i-1, j] = kpts[i].Value[j] - kpts[0].Value[j];
}
}
velocity = m.Invert();
}
public double Interpolate(KPoint kpt)
{
return 0;
}
void ShiftDelta(ref Vector3 delta, Vector3 G)
{
if ((delta - G).Magnitude < delta.Magnitude)
{
delta -= G;
}
if ((delta + G).Magnitude < delta.Magnitude)
{
delta += G;
}
}
List<KPoint> kpts = new List<KPoint>();
Matrix velocity;
public bool Contains(KPoint kpt)
{
return false;
}
}
}
| 17.777778 | 91 | 0.586719 | [
"MIT"
] | eylvisaker/tbsuite | src/BandPath/BandTetrahedron.cs | 1,280 | C# |
using System.Collections.Generic;
using System.Linq;
namespace KtaneVideoPoker
{
namespace Variants
{
public class JacksOrBetter: IVariant
{
public int JokerCount { get { return 0; }}
private int FullHousePayout;
private int FlushPayout;
private bool BettingFiveCredits;
public JacksOrBetter(int fullHousePayout, int flushPayout, bool bettingFiveCredits = true)
{
FullHousePayout = fullHousePayout;
FlushPayout = flushPayout;
BettingFiveCredits = bettingFiveCredits;
}
public Core.HandResult Evaluate(Core.Hand hand)
{
int straightCard = hand.GetHighestStraightCard();
bool isFlushLike = hand.IsFlushLike();
int matches = hand.GetPairwiseMatchCount();
if (isFlushLike && straightCard != 0)
{
if (straightCard == 1)
{
return Core.HandResult.RoyalFlush;
}
else
{
return Core.HandResult.StraightFlush;
}
}
else if (matches == 6)
{
return Core.HandResult.FourOfAKind;
}
else if (matches == 4)
{
return Core.HandResult.FullHouse;
}
else if (isFlushLike)
{
return Core.HandResult.Flush;
}
else if (straightCard != 0)
{
return Core.HandResult.Straight;
}
else if (matches == 3)
{
return Core.HandResult.ThreeOfAKind;
}
else if (matches == 2)
{
return Core.HandResult.TwoPair;
}
else
{
var highCardCounts = new Dictionary<int, int>() {
{11, 0}, {12, 0}, {13, 0}, {1, 0}
};
foreach (var card in hand.Cards)
{
if (highCardCounts.ContainsKey(card.Rank))
{
highCardCounts[card.Rank]++;
if (highCardCounts[card.Rank] == 2)
{
return Core.HandResult.JacksOrBetter;
}
}
}
return Core.HandResult.Nothing;
}
}
public Core.HandResult[] HandTypes()
{
return new[]
{
Core.HandResult.RoyalFlush,
Core.HandResult.StraightFlush,
Core.HandResult.FourOfAKind,
Core.HandResult.FullHouse,
Core.HandResult.Flush,
Core.HandResult.Straight,
Core.HandResult.ThreeOfAKind,
Core.HandResult.TwoPair,
Core.HandResult.JacksOrBetter
};
}
public int PayoutForResult(Core.HandResult result)
{
switch (result)
{
case Core.HandResult.RoyalFlush:
return BettingFiveCredits ? 800 : 250;
case Core.HandResult.StraightFlush:
return 50;
case Core.HandResult.FourOfAKind:
return 25;
case Core.HandResult.FullHouse:
return FullHousePayout;
case Core.HandResult.Flush:
return FlushPayout;
case Core.HandResult.Straight:
return 4;
case Core.HandResult.ThreeOfAKind:
return 3;
case Core.HandResult.TwoPair:
return 2;
case Core.HandResult.JacksOrBetter:
return 1;
default:
return 0;
}
}
// STRATEGIES
private static IEnumerable<int> AllRanks = Enumerable.Range(1, 13);
private static IEnumerable<int> CardIndices = Enumerable.Range(0, 5);
private static int[] RoyalRanks = new[] {1, 10, 11, 12, 13};
public static Core.Strategy Strategy96 = new Core.Strategy(
(handInfo) => // 1. Royal flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
if (Enumerable.SequenceEqual(flushes.First().Value, RoyalRanks))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 2. Straight flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
var ranks = flushes.First().Value;
if (ranks[4] - ranks[0] == 4)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 3. Four of a kind (rule A: You may either keep or discard the kicker.)
{
var quads = handInfo.RankCounts.IndexOf(4);
if (quads > 0)
{
var cardIndicesToKeep = handInfo.CardPositionMatrix.Values.Select(array => array[quads]);
return Core.RuleResult.Pass("A", cardIndicesToKeep.Select(i => 1 << i).Sum(), 31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 4. 4 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 5. Full house
{
var trips = handInfo.RankCounts.IndexOf(3);
var pair = handInfo.RankCounts.IndexOf(2);
if (trips > 0 && pair > 0)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 6. Flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (flushes.Any())
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 7. Straight
{
var ranks = AllRanks.Where(r => handInfo.RankCounts[r] == 1).ToArray();
if (ranks.Length == 5 && (Enumerable.SequenceEqual(ranks, RoyalRanks) || ranks[4] - ranks[0] == 4))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 8. Three of a kind
{
var trips = handInfo.RankCounts.IndexOf(3);
if (trips > 0)
{
var cardIndicesToKeep = CardIndices.Where(i => handInfo.Cards[i].Rank == trips);
return Core.RuleResult.Pass(cardIndicesToKeep.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 9. 4 to a straight flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var suit = suitAndRanks.Key;
var ranks = suitAndRanks.Value;
if (ranks[3] - ranks[0] <= 4)
{
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[suit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 10. Two pair
{
if (handInfo.RankCounts.Count(n => n == 2) == 2)
{
var indexToDiscard = CardIndices.Where(i => handInfo.RankCounts[handInfo.Cards[i].Rank] == 1).First();
return Core.RuleResult.Pass(31 - (1 << indexToDiscard));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 11. High pair
{
var pairs = new[] {1, 11, 12, 13}.Where(r => handInfo.RankCounts[r] == 2);
if (pairs.Any())
{
var rank = pairs.First();
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == rank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 12. 3 to a royal flush (rule B: 4 to a flush beats 3 to a royal if the latter contains a 10 and an Ace, and the unsuited card is either a 10 or a straight penalty card.)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
if (handInfo.RanksPerSuit[validSuit].Length == 4 && handInfo.RanksPerSuit[validSuit].Except(new[] {1, 10}).Count() == 2)
{
// We have four cards with this suit, two of which are an Ace and a 10
var unsuitedCard = handInfo.Cards.Where(card => card.Suit != validSuit).First();
if (unsuitedCard.Rank >= 10 || unsuitedCard.Rank == 1)
{
return Core.RuleResult.Fail("B");
}
}
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 13. 4 to a flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 4);
if (validSuits.Any())
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[validSuits.First().Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 14. Unsuited TJQK (rule C: If you also have a pair of 10s, it doesn't matter which 10 you discard.)
{
var tjqkCounts = handInfo.RankCounts.GetRange(10, 4);
if (Enumerable.SequenceEqual(tjqkCounts, new[] {1, 1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(10, 13)).Select(i => 1 << i).Sum());
}
else if (Enumerable.SequenceEqual(tjqkCounts, new[] {2, 1, 1, 1}))
{
var indicesOfTens = CardIndices.Where(i => handInfo.Cards[i].Rank == 10).ToArray();
return Core.RuleResult.Pass("C", 31 - (1 << indicesOfTens[0]), 31 - (1 << indicesOfTens[1]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 15. Low pair
{
var pairRank = handInfo.RankCounts.IndexOf(2);
if (pairRank > 0)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == pairRank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
// Below here, we can assume that all ranks are different.
(handInfo) => // 16. 4 to an open-ended straight
{
int rankCount = handInfo.RankCounts.GetRange(1, 4).Sum();
for (int minRank = 2; minRank <= 9; minRank++)
{
rankCount += handInfo.RankCounts[minRank + 3] - handInfo.RankCounts[minRank - 1];
if (rankCount == 4)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(minRank, minRank + 3)).Select(i => 1 << i).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 17. 3 to a straight flush, type 1 (the number of high cards equals or exceeds the number of gaps, except Ace low or 2-3-4)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
int gapCount = suitAndRanks.Value[2] - suitAndRanks.Value[0] - 2;
int highCount = suitAndRanks.Value.Count(rank => rank >= 11);
if (highCount >= gapCount && suitAndRanks.Value[0] >= 3)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 18. Suited JQ (rule D: Unsuited JQKA beats suited JQ if the latter has a 9 or a flush penalty card.)
{
var hasJQ = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.Keys.Where(r => r == 11 || r == 12).Count() == 2);
if (!hasJQ.Any())
{
return Core.RuleResult.Fail();
}
var jqSuit = hasJQ.First();
if (handInfo.RankCounts[13] == 1 && handInfo.RankCounts[1] == 1)
{
// We also have an unsuited JQKA. Does the exception apply?
// We know that the King and Ace aren't of the same suit as the suited JQ. Otherwise we'd have 3 to a royal.
var lastCard = handInfo.Cards.Where(card => card.Rank.InRange(2, 10)).First();
if (lastCard.Rank == 9 || lastCard.Suit == jqSuit.Key)
{
return Core.RuleResult.Fail("D");
}
}
return Core.RuleResult.Pass((1 << handInfo.CardPositionMatrix[jqSuit.Key][11]) + (1 << handInfo.CardPositionMatrix[jqSuit.Key][12]));
},
(handInfo) => // 19. Unsuited JQKA
{
var ranks = new[] {1, 11, 12, 13};
if (ranks.All(rank => handInfo.RankCounts[rank] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 20. Suited JK, QK, JA, QA, or KA
{
var ranks = new[] {1, 11, 12, 13};
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.Keys.Intersect(ranks).Count() == 2);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
return Core.RuleResult.Pass(validSuits.First().Value.Where(kvp => kvp.Key >= 11 || kvp.Key == 1).Select(kvp => 1 << kvp.Value).Sum());
},
(handInfo) => // 21. 9JQK, TJQA, TJKA, or TQKA (rule E: 3 to a straight flush beats 4 to a straight if the former doesn’t have a straight penalty card.)
{
var partialStraights = new[]
{
new[] {9, 11, 12, 13},
new[] {10, 11, 12, 1},
new[] {10, 11, 13, 1},
new[] {10, 12, 13, 1}
};
var matches = partialStraights.Where(partialStraight => partialStraight.Count(rank => handInfo.RankCounts[rank] == 1) == 4);
if (!matches.Any())
{
return Core.RuleResult.Fail();
}
var match = matches.First();
// Look for straight flush exception
var validPartialStraightFlushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3).Select(kvp => kvp.Value);
if (validPartialStraightFlushes.Any())
{
if (Enumerable.SequenceEqual(validPartialStraightFlushes.First(), new[] {match[1] - 4, match[0], match[1]}))
{
return Core.RuleResult.Fail("E");
}
}
// We're good
int rankToDiscard = handInfo.Cards.Select(card => card.Rank).Sum() - match.Sum();
return Core.RuleResult.Pass(31 - (1 << CardIndices.Where(i => handInfo.Cards[i].Rank == rankToDiscard).First()));
},
(handInfo) => // 22. 3 to a straight flush, type 2 (one gap with no high cards, two gaps with one high card, Ace low, or 2-3-4)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
int gapCount = suitAndRanks.Value[2] - suitAndRanks.Value[0] - 2;
int highCount = suitAndRanks.Value.Count(rank => rank >= 11);
if (gapCount <= 2 && (gapCount - highCount <= 1 || suitAndRanks.Value[0] == 1))
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 23. Unsuited JQK
{
var jqkCounts = handInfo.RankCounts.GetRange(11, 3);
if (Enumerable.SequenceEqual(jqkCounts, new[] {1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 24. Unsuited JQ or QK
{
if (handInfo.RankCounts[12] == 1 && (handInfo.RankCounts[11] == 1 || handInfo.RankCounts[13] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 25. Suited TJ (rule F: Unsuited JK beats suited TJ if the latter has a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Fail("F");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 26. Unsuited JK
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == 11 || handInfo.Cards[i].Rank == 13).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 27. Suited TQ (rule G: Unsuited QA beats suited TQ if the latter has a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(12));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[1] == 1)
{
return Core.RuleResult.Fail("G");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[12]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 28. Unsuited JA, QA, or KA
{
if (handInfo.RankCounts[1] == 1 && handInfo.RankCounts.GetRange(11, 3).Contains(1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 29. Suited TQ (rule H: King only beats suited TK if the latter has both a 9 and a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(13));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[9] == 1)
{
return Core.RuleResult.Fail("H");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[13]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 30. Single high card
{
var highCardIndices = CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1);
if (highCardIndices.Any())
{
return Core.RuleResult.Pass(1 << highCardIndices.First());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 31. 3 to a straight flush, type 3
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
if (suitAndRanks.Value[2] - suitAndRanks.Value[0] == 4)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
}
);
public static Core.Strategy Strategy95 = new Core.Strategy(
(handInfo) => // 1. Royal flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
if (Enumerable.SequenceEqual(flushes.First().Value, RoyalRanks))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 2. Straight flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
var ranks = flushes.First().Value;
if (ranks[4] - ranks[0] == 4)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 3. Four of a kind (rule A: You may either keep or discard the kicker.)
{
var quads = handInfo.RankCounts.IndexOf(4);
if (quads > 0)
{
var cardIndicesToKeep = handInfo.CardPositionMatrix.Values.Select(array => array[quads]);
return Core.RuleResult.Pass("A", cardIndicesToKeep.Select(i => 1 << i).Sum(), 31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 4. 4 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 5. Full house
{
var trips = handInfo.RankCounts.IndexOf(3);
var pair = handInfo.RankCounts.IndexOf(2);
if (trips > 0 && pair > 0)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 6. Flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (flushes.Any())
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 7. Straight
{
var ranks = AllRanks.Where(r => handInfo.RankCounts[r] == 1).ToArray();
if (ranks.Length == 5 && (Enumerable.SequenceEqual(ranks, RoyalRanks) || ranks[4] - ranks[0] == 4))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 8. Three of a kind
{
var trips = handInfo.RankCounts.IndexOf(3);
if (trips > 0)
{
var cardIndicesToKeep = CardIndices.Where(i => handInfo.Cards[i].Rank == trips);
return Core.RuleResult.Pass(cardIndicesToKeep.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 9. Two pair
{
if (handInfo.RankCounts.Count(n => n == 2) == 2)
{
var indexToDiscard = CardIndices.Where(i => handInfo.RankCounts[handInfo.Cards[i].Rank] == 1).First();
return Core.RuleResult.Pass(31 - (1 << indexToDiscard));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 10. 4 to a straight flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var suit = suitAndRanks.Key;
var ranks = suitAndRanks.Value;
if (ranks[3] - ranks[0] <= 4)
{
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[suit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 11. High pair
{
var pairs = new[] {1, 11, 12, 13}.Where(r => handInfo.RankCounts[r] == 2);
if (pairs.Any())
{
var rank = pairs.First();
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == rank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 12. 3 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 3);
if (validSuits.Any())
{
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 13. 4 to a flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 4);
if (validSuits.Any())
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[validSuits.First().Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 14. Unsuited TJQK (rule B: If you also have a pair of 10s, it doesn't matter which 10 you discard.)
{
var tjqkCounts = handInfo.RankCounts.GetRange(10, 4);
if (Enumerable.SequenceEqual(tjqkCounts, new[] {1, 1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(10, 13)).Select(i => 1 << i).Sum());
}
else if (Enumerable.SequenceEqual(tjqkCounts, new[] {2, 1, 1, 1}))
{
var indicesOfTens = CardIndices.Where(i => handInfo.Cards[i].Rank == 10).ToArray();
return Core.RuleResult.Pass("B", 31 - (1 << indicesOfTens[0]), 31 - (1 << indicesOfTens[1]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 15. Low pair
{
var pairRank = handInfo.RankCounts.IndexOf(2);
if (pairRank > 0)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == pairRank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
// Below here, we can assume that all ranks are different.
(handInfo) => // 16. 4 to an open-ended straight
{
int rankCount = handInfo.RankCounts.GetRange(1, 4).Sum();
for (int minRank = 2; minRank <= 9; minRank++)
{
rankCount += handInfo.RankCounts[minRank + 3] - handInfo.RankCounts[minRank - 1];
if (rankCount == 4)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(minRank, minRank + 3)).Select(i => 1 << i).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 17. Suited 89J, 8TJ, 8JQ, 9TJ, 9TQ, or 9JQ
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in new[] {new[] {8, 9, 11}, new[] {8, 10, 11}, new[] {8, 11, 12}, new[] {9, 10, 11}, new[] {9, 10, 12}, new[] {9, 11, 12}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 18. Unsuited JQKA
{
var ranks = new[] {1, 11, 12, 13};
if (ranks.All(rank => handInfo.RankCounts[rank] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 19. Suited 9JK or 9QK
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(9) && kvp.Value.ContainsKey(13) && (kvp.Value.ContainsKey(11) || kvp.Value.ContainsKey(12)));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(new[] {9, 11, 12, 13}.Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 20. Suited JQ, JK, or QK
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => Enumerable.Range(11, 3).Where(rank => kvp.Value.ContainsKey(rank)).Count() == 2);
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(Enumerable.Range(11, 3).Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 21. Suited 456, 567, or 678
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in Enumerable.Range(4, 3).Select(lowRank => Enumerable.Range(lowRank, 3)))
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 22. Suited JA
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(1) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass((1 << validRanksLookup[1]) + (1 << validRanksLookup[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 23. Suited 789 or 89T
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in new[] {7, 8}.Select(lowRank => Enumerable.Range(lowRank, 3)))
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 24. Suited QA or KA
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(1) && (kvp.Value.ContainsKey(12) || kvp.Value.ContainsKey(13)));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(new[] {12, 13, 1}.Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 25. Suited 345
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var ranksToFind = Enumerable.Range(3, 3);
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 26. Unsuited 9JQK, TJQA, TJKA, or TQKA
{
var partialStraights = new[]
{
new[] {9, 11, 12, 13},
new[] {10, 11, 12, 1},
new[] {10, 11, 13, 1},
new[] {10, 12, 13, 1}
};
var matches = partialStraights.Where(partialStraight => partialStraight.Count(rank => handInfo.RankCounts[rank] == 1) == 4);
if (!matches.Any())
{
return Core.RuleResult.Fail();
}
var match = matches.First();
int rankToDiscard = handInfo.Cards.Select(card => card.Rank).Sum() - match.Sum();
return Core.RuleResult.Pass(31 - (1 << CardIndices.Where(i => handInfo.Cards[i].Rank == rankToDiscard).First()));
},
(handInfo) => // 27. Unsuited JQK
{
var jqkCounts = handInfo.RankCounts.GetRange(11, 3);
if (Enumerable.SequenceEqual(jqkCounts, new[] {1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 28. Unsuited JQ (rules C and D)
{
if (handInfo.RankCounts[11] != 1 || handInfo.RankCounts[12] != 1)
{
return Core.RuleResult.Fail();
}
var potentialStraightFlushDraws = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (potentialStraightFlushDraws.Any())
{
var suitAndRanks = potentialStraightFlushDraws.First();
// Rule C: Suited 7TJ beats unsuited JQ if the fifth card is a 6 or lower.
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {7, 10, 11}) && Enumerable.Range(2, 5).Select(rank => handInfo.RankCounts[rank]).Any(n => n == 1))
{
return Core.RuleResult.Fail("C");
}
// Rule D: Suited 78J or 79J beats unsuited JQ if the fifth card is an Ace.
if (suitAndRanks.Value[0] == 7 && suitAndRanks.Value[1].InRange(8, 9) && suitAndRanks.Value[2] == 11 && handInfo.RankCounts[1] == 1)
{
return Core.RuleResult.Fail("D");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 12)).Sum(i => 1 << i));
},
(handInfo) => // 29. Suited A23, A24, A25, A34, A35, A45, 689, 78J[E], 79J[F], 7TJ[F], 89Q, 8TQ, or 9TK
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
// First, the cases without any exceptions
foreach (var ranksToFind in new[] {new[] {1, 2, 3}, new[] {1, 2, 4}, new[] {1, 2, 5}, new[] {1, 3, 4}, new[] {1, 3, 5}, new[] {1, 4, 5}, new[] {6, 8, 9}, new[] {8, 9, 12}, new[] {8, 10, 12}, new[] {9, 10, 13}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {7, 8, 11}))
{
// Rule E: Unsuited JK beats suited 78J if the fifth card is a 9 or a 10.
if (handInfo.RankCounts[13] == 1 && (handInfo.RankCounts[9] == 1 || handInfo.RankCounts[10] == 1))
{
return Core.RuleResult.Fail("E");
}
return Core.RuleResult.Pass(new[] {7, 8, 11}.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
foreach (var ranksToFind in new[] {new[] {7, 9, 11}, new[] {7, 10, 11}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
// Rule F: Unsuited JK beats suited 79J and 7TJ if the fifth card is an 8.
if (handInfo.RankCounts[13] == 1 && handInfo.RankCounts[8] == 1)
{
return Core.RuleResult.Fail("F");
}
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 30. Unsuited JK (rules G and H)
{
if (handInfo.RankCounts[11] != 1 || handInfo.RankCounts[13] != 1)
{
return Core.RuleResult.Fail();
}
// Rule G: Suited TJ beats unsuited JK if the former has no flush penalty cards and there are no 8s or 9s.
var jackSuit = handInfo.Cards.Where(card => card.Rank == 11).First().Suit;
if (Enumerable.SequenceEqual(handInfo.RanksPerSuit[jackSuit], new[] {10, 11}) && handInfo.RankCounts[8] == 0 && handInfo.RankCounts[9] == 0)
{
return Core.RuleResult.Fail("G");
}
var potentialStraightFlushDraws = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (potentialStraightFlushDraws.Any())
{
var suitAndRanks = potentialStraightFlushDraws.First();
// Rule H: Suited 679 suited always beats unsuited JK and unsuited QK.
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {6, 7, 9}))
{
return Core.RuleResult.Fail("H");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {11, 13}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
},
(handInfo) => // 31. Suited 78T or 79T (rule I: Jack only beats suited 78T and 79T if the fifth card is a 6.)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
if (suitAndRanks.Value[0] == 7 && suitAndRanks.Value[2] == 10 && suitAndRanks.Value[1].InRange(8, 9))
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[6] == 1)
{
return Core.RuleResult.Fail("I");
}
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 32. Suited TJ (rules J and K):
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var suitAndRanksLookup = validSuits.First();
// Rule J: Unsuited JA beats suited TJ if the latter has a flush penalty card of 6 or lower, and an 8 or a 9.
if (handInfo.RankCounts[1] == 1 && Enumerable.Range(2, 5).Any(rank => suitAndRanksLookup.Value.ContainsKey(rank)) && (handInfo.RankCounts[8] == 1 || handInfo.RankCounts[9] == 1))
{
return Core.RuleResult.Fail("J");
}
// Rule K: Suited 578 always bets suited TJ.
if (handInfo.RanksPerSuit.Any(kvp => Enumerable.SequenceEqual(kvp.Value, new[] {5, 7, 8})))
{
return Core.RuleResult.Fail("K");
}
return Core.RuleResult.Pass((1 << suitAndRanksLookup.Value[10]) + (1 << suitAndRanksLookup.Value[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 33. Unsuited QK (rule H: Suited 679 suited always beats unsuited JK and unsuited QK.)
{
if (handInfo.RankCounts[12] != 1 || handInfo.RankCounts[13] != 1)
{
return Core.RuleResult.Fail();
}
var potentialStraightFlushDraws = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (potentialStraightFlushDraws.Any())
{
if (Enumerable.SequenceEqual(potentialStraightFlushDraws.First().Value, new[] {6, 7, 9}))
{
return Core.RuleResult.Fail("H");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {12, 13}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
},
(handInfo) => // 34. Suited 234[L][M], 235[L][M], 245[L][M], 346[L], 356[L], 457[L], 467[L], 568[L], 578[L], or 679
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var rankArrays = new[]
{
new[] {2, 3, 4},
new[] {2, 3, 5},
new[] {2, 4, 5},
new[] {3, 4, 6},
new[] {3, 5, 6},
new[] {4, 5, 7},
new[] {4, 6, 7},
new[] {5, 6, 8},
new[] {5, 7, 8},
new[] {6, 7, 9}
};
for (int index = 0; index < rankArrays.Length; index++)
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, rankArrays[index]))
{
// Rule M: Ace only beats this straight flush draw if the fifth card is a 6.
// It's easier to check for this first because we want to see if there's an Ace.
if (index < 3 && handInfo.RankCounts[1] == 1 && handInfo.RankCounts[6] == 1)
{
return Core.RuleResult.Fail("M");
}
// Rule L: Jack only beats this straight flush draw if there is a straight penalty card, unless that penalty card is a 9 or an Ace. However, if the hand doesn't contain a 2 and the penalty card has the same suit as the Jack, play the 3 to a straight flush instead.
int lowRank = rankArrays[index][0];
if (index != rankArrays.Length - 1 && handInfo.RankCounts[11] == 1 && handInfo.RankCounts[1] == 0 && (handInfo.RankCounts[lowRank - 1] == 1 || (handInfo.RankCounts[lowRank + 4] == 1 && lowRank != 5)))
{
if (handInfo.RankCounts[2] == 1 || !handInfo.RanksPerSuit.Values.Any(array => array.Length == 2))
{
return Core.RuleResult.Fail("L");
}
}
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 35. Unsuited JA, QA, or KA (rule N: Suited TQ beats unsuited QA if the former has no flush penalty cards.)
{
if (handInfo.RankCounts[1] == 1 && handInfo.RankCounts.GetRange(11, 3).Contains(1))
{
if (handInfo.RankCounts[12] == 1)
{
var queenSuit = handInfo.Cards.Where(card => card.Rank == 12).First().Suit;
if (Enumerable.SequenceEqual(handInfo.RanksPerSuit[queenSuit], new[] {10, 12}) && handInfo.RankCounts[8] == 0 && handInfo.RankCounts[9] == 0)
{
return Core.RuleResult.Fail("N");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == 1 || handInfo.Cards[i].Rank >= 11).Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 36. Suited TQ or TK (rule O: King only beats suited TK if the latter has a flush penalty card.):
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(12));
if (validSuits.Any())
{
var ranksLookup = validSuits.First().Value;
return Core.RuleResult.Pass((1 << ranksLookup[10]) + (1 << ranksLookup[12]));
}
validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(13));
if (validSuits.Any())
{
var ranksLookup = validSuits.First().Value;
if (ranksLookup.Count() > 2)
{
return Core.RuleResult.Fail("O");
}
return Core.RuleResult.Pass((1 << ranksLookup[10]) + (1 << ranksLookup[13]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 37. Single high card
{
var highCardPositions = CardIndices.Where(i => handInfo.Cards[i].Rank == 1 || handInfo.Cards[i].Rank >= 11);
if (highCardPositions.Any())
{
int cardIndex = highCardPositions.First();
return Core.RuleResult.Pass(1 << cardIndex);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 38. Any other 3 to a straight flush not listed
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var ranks = suitAndRanks.Value;
if (ranks[0].InRange(2, 6) && ranks[2] - ranks[0] == 4)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
}
);
public static Core.Strategy Strategy86 = new Core.Strategy(
(handInfo) => // 1. Royal flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
if (Enumerable.SequenceEqual(flushes.First().Value, RoyalRanks))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 2. Straight flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
var ranks = flushes.First().Value;
if (ranks[4] - ranks[0] == 4)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 3. Four of a kind (rule A: You may either keep or discard the kicker.)
{
var quads = handInfo.RankCounts.IndexOf(4);
if (quads > 0)
{
var cardIndicesToKeep = handInfo.CardPositionMatrix.Values.Select(array => array[quads]);
return Core.RuleResult.Pass("A", cardIndicesToKeep.Select(i => 1 << i).Sum(), 31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 4. 4 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 5. Full house
{
var trips = handInfo.RankCounts.IndexOf(3);
var pair = handInfo.RankCounts.IndexOf(2);
if (trips > 0 && pair > 0)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 6. Flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (flushes.Any())
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 7. Straight
{
var ranks = AllRanks.Where(r => handInfo.RankCounts[r] == 1).ToArray();
if (ranks.Length == 5 && (Enumerable.SequenceEqual(ranks, RoyalRanks) || ranks[4] - ranks[0] == 4))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 8. Three of a kind
{
var trips = handInfo.RankCounts.IndexOf(3);
if (trips > 0)
{
var cardIndicesToKeep = CardIndices.Where(i => handInfo.Cards[i].Rank == trips);
return Core.RuleResult.Pass(cardIndicesToKeep.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 9. 4 to a straight flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var suit = suitAndRanks.Key;
var ranks = suitAndRanks.Value;
if (ranks[3] - ranks[0] <= 4)
{
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[suit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 10. Two pair
{
if (handInfo.RankCounts.Count(n => n == 2) == 2)
{
var indexToDiscard = CardIndices.Where(i => handInfo.RankCounts[handInfo.Cards[i].Rank] == 1).First();
return Core.RuleResult.Pass(31 - (1 << indexToDiscard));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 11. High pair
{
var pairs = new[] {1, 11, 12, 13}.Where(r => handInfo.RankCounts[r] == 2);
if (pairs.Any())
{
var rank = pairs.First();
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == rank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 12. 3 to a royal flush (rule B: 4 to a flush beats 3 to a royal if the latter contains a 10 and an Ace, and the unsuited card is either a 10 or a straight penalty card.)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
if (handInfo.RanksPerSuit[validSuit].Length == 4 && handInfo.RanksPerSuit[validSuit].Except(new[] {1, 10}).Count() == 2)
{
// We have four cards with this suit, two of which are an Ace and a 10
var unsuitedCard = handInfo.Cards.Where(card => card.Suit != validSuit).First();
if (unsuitedCard.Rank >= 10 || unsuitedCard.Rank == 1)
{
return Core.RuleResult.Fail("B");
}
}
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 13. 4 to a flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 4);
if (validSuits.Any())
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[validSuits.First().Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 14. Unsuited TJQK (rule C: If you also have a pair of 10s, it doesn't matter which 10 you discard.)
{
var tjqkCounts = handInfo.RankCounts.GetRange(10, 4);
if (Enumerable.SequenceEqual(tjqkCounts, new[] {1, 1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(10, 13)).Select(i => 1 << i).Sum());
}
else if (Enumerable.SequenceEqual(tjqkCounts, new[] {2, 1, 1, 1}))
{
var indicesOfTens = CardIndices.Where(i => handInfo.Cards[i].Rank == 10).ToArray();
return Core.RuleResult.Pass("C", 31 - (1 << indicesOfTens[0]), 31 - (1 << indicesOfTens[1]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 15. Low pair
{
var pairRank = handInfo.RankCounts.IndexOf(2);
if (pairRank > 0)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == pairRank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
// Below here, we can assume that all ranks are different.
(handInfo) => // 16. 4 to an open-ended straight
{
int rankCount = handInfo.RankCounts.GetRange(1, 4).Sum();
for (int minRank = 2; minRank <= 9; minRank++)
{
rankCount += handInfo.RankCounts[minRank + 3] - handInfo.RankCounts[minRank - 1];
if (rankCount == 4)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(minRank, minRank + 3)).Select(i => 1 << i).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 17. 3 to a straight flush, type 1 (the number of high cards equals or exceeds the number of gaps, except Ace low or 2-3-4)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
int gapCount = suitAndRanks.Value[2] - suitAndRanks.Value[0] - 2;
int highCount = suitAndRanks.Value.Count(rank => rank >= 11);
if (highCount >= gapCount && suitAndRanks.Value[0] >= 3)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 18. Suited JQ (rule D: Unsuited JQKA beats suited JQ if the latter has an 8, a 9, or a flush penalty card.)
{
var hasJQ = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.Keys.Where(r => r == 11 || r == 12).Count() == 2);
if (!hasJQ.Any())
{
return Core.RuleResult.Fail();
}
var jqSuit = hasJQ.First();
if (handInfo.RankCounts[13] == 1 && handInfo.RankCounts[1] == 1)
{
// We also have an unsuited JQKA. Does the exception apply?
// We know that the King and Ace aren't of the same suit as the suited JQ. Otherwise we'd have 3 to a royal.
var lastCard = handInfo.Cards.Where(card => card.Rank.InRange(2, 10)).First();
if (lastCard.Rank == 8 || lastCard.Rank == 9 || lastCard.Suit == jqSuit.Key)
{
return Core.RuleResult.Fail("D");
}
}
return Core.RuleResult.Pass((1 << handInfo.CardPositionMatrix[jqSuit.Key][11]) + (1 << handInfo.CardPositionMatrix[jqSuit.Key][12]));
},
(handInfo) => // 19. Unsuited JQKA
{
var ranks = new[] {1, 11, 12, 13};
if (ranks.All(rank => handInfo.RankCounts[rank] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 20. Suited JK, QK, JA, QA, or KA
{
var ranks = new[] {1, 11, 12, 13};
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.Keys.Intersect(ranks).Count() == 2);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
return Core.RuleResult.Pass(validSuits.First().Value.Where(kvp => kvp.Key >= 11 || kvp.Key == 1).Select(kvp => 1 << kvp.Value).Sum());
},
(handInfo) => // 21. 9JQK, TJQA, TJKA, or TQKA (rule E: 3 to a straight flush beats 4 to a straight if the former doesn’t have a straight penalty card.)
{
var partialStraights = new[]
{
new[] {9, 11, 12, 13},
new[] {10, 11, 12, 1},
new[] {10, 11, 13, 1},
new[] {10, 12, 13, 1}
};
var matches = partialStraights.Where(partialStraight => partialStraight.Count(rank => handInfo.RankCounts[rank] == 1) == 4);
if (!matches.Any())
{
return Core.RuleResult.Fail();
}
var match = matches.First();
// Look for straight flush exception
var validPartialStraightFlushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3).Select(kvp => kvp.Value);
if (validPartialStraightFlushes.Any())
{
if (Enumerable.SequenceEqual(validPartialStraightFlushes.First(), new[] {match[1] - 4, match[0], match[1]}))
{
return Core.RuleResult.Fail("E");
}
}
// We're good
int rankToDiscard = handInfo.Cards.Select(card => card.Rank).Sum() - match.Sum();
return Core.RuleResult.Pass(31 - (1 << CardIndices.Where(i => handInfo.Cards[i].Rank == rankToDiscard).First()));
},
(handInfo) => // 22. 3 to a straight flush, type 2 (one gap with no high cards, two gaps with one high card, Ace low, or 2-3-4)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
int gapCount = suitAndRanks.Value[2] - suitAndRanks.Value[0] - 2;
int highCount = suitAndRanks.Value.Count(rank => rank >= 11);
if (gapCount <= 2 && (gapCount - highCount <= 1 || suitAndRanks.Value[0] == 1))
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 23. Unsuited JQK
{
var jqkCounts = handInfo.RankCounts.GetRange(11, 3);
if (Enumerable.SequenceEqual(jqkCounts, new[] {1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 24. Unsuited JQ or QK
{
if (handInfo.RankCounts[12] == 1 && (handInfo.RankCounts[11] == 1 || handInfo.RankCounts[13] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 25. Suited TJ (rule F: Unsuited JK beats suited TJ if the latter has a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Fail("F");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 26. Unsuited JK
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == 11 || handInfo.Cards[i].Rank == 13).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 27. Suited TQ (rule G: Unsuited QA beats suited TQ if the latter has a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(12));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[1] == 1)
{
return Core.RuleResult.Fail("G");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[12]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 28. Unsuited JA, QA, or KA
{
if (handInfo.RankCounts[1] == 1 && handInfo.RankCounts.GetRange(11, 3).Contains(1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 29. Suited TQ (rule H: King only beats suited TK if the latter has both a 9 and a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(13));
if (validSuits.Any())
{
var suitAndPositions = validSuits.First();
if (suitAndPositions.Value.Count() >= 3 && handInfo.RankCounts[9] == 1)
{
return Core.RuleResult.Fail("H");
}
return Core.RuleResult.Pass((1 << suitAndPositions.Value[10]) + (1 << suitAndPositions.Value[13]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 30. Single high card
{
var highCardIndices = CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1);
if (highCardIndices.Any())
{
return Core.RuleResult.Pass(1 << highCardIndices.First());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 31. 3 to a straight flush, type 3
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
if (suitAndRanks.Value[2] - suitAndRanks.Value[0] == 4)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
}
);
public static Core.Strategy Strategy85 = new Core.Strategy(
(handInfo) => // 1. Royal flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
if (Enumerable.SequenceEqual(flushes.First().Value, RoyalRanks))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 2. Straight flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (!flushes.Any())
{
return Core.RuleResult.Fail();
}
var ranks = flushes.First().Value;
if (ranks[4] - ranks[0] == 4)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 3. Four of a kind (rule A: You may either keep or discard the kicker.)
{
var quads = handInfo.RankCounts.IndexOf(4);
if (quads > 0)
{
var cardIndicesToKeep = handInfo.CardPositionMatrix.Values.Select(array => array[quads]);
return Core.RuleResult.Pass("A", cardIndicesToKeep.Select(i => 1 << i).Sum(), 31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 4. 4 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
},
(handInfo) => // 5. Full house
{
var trips = handInfo.RankCounts.IndexOf(3);
var pair = handInfo.RankCounts.IndexOf(2);
if (trips > 0 && pair > 0)
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 6. Flush
{
var flushes = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 5);
if (flushes.Any())
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 7. Straight
{
var ranks = AllRanks.Where(r => handInfo.RankCounts[r] == 1).ToArray();
if (ranks.Length == 5 && (Enumerable.SequenceEqual(ranks, RoyalRanks) || ranks[4] - ranks[0] == 4))
{
return Core.RuleResult.Pass(31);
}
return Core.RuleResult.Fail();
},
(handInfo) => // 8. Three of a kind
{
var trips = handInfo.RankCounts.IndexOf(3);
if (trips > 0)
{
var cardIndicesToKeep = CardIndices.Where(i => handInfo.Cards[i].Rank == trips);
return Core.RuleResult.Pass(cardIndicesToKeep.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 9. Two pair
{
if (handInfo.RankCounts.Count(n => n == 2) == 2)
{
var indexToDiscard = CardIndices.Where(i => handInfo.RankCounts[handInfo.Cards[i].Rank] == 1).First();
return Core.RuleResult.Pass(31 - (1 << indexToDiscard));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 10. 4 to a straight flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Count() == 4);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var suit = suitAndRanks.Key;
var ranks = suitAndRanks.Value;
if (ranks[3] - ranks[0] <= 4)
{
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[suit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 11. High pair
{
var pairs = new[] {1, 11, 12, 13}.Where(r => handInfo.RankCounts[r] == 2);
if (pairs.Any())
{
var rank = pairs.First();
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == rank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 12. 3 to a royal flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Intersect(RoyalRanks).Count() == 3);
if (validSuits.Any())
{
var validSuit = validSuits.First().Key;
var ranks = handInfo.CardPositionMatrix[validSuit].Keys.Intersect(RoyalRanks);
return Core.RuleResult.Pass(ranks.Select(r => 1 << handInfo.CardPositionMatrix[validSuit][r]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 13. 4 to a flush
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 4);
if (validSuits.Any())
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[validSuits.First().Key].Values.Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 14. Unsuited TJQK (rule B: If you also have a pair of 10s, it doesn't matter which 10 you discard.)
{
var tjqkCounts = handInfo.RankCounts.GetRange(10, 4);
if (Enumerable.SequenceEqual(tjqkCounts, new[] {1, 1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(10, 13)).Select(i => 1 << i).Sum());
}
else if (Enumerable.SequenceEqual(tjqkCounts, new[] {2, 1, 1, 1}))
{
var indicesOfTens = CardIndices.Where(i => handInfo.Cards[i].Rank == 10).ToArray();
return Core.RuleResult.Pass("B", 31 - (1 << indicesOfTens[0]), 31 - (1 << indicesOfTens[1]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 15. Low pair
{
var pairRank = handInfo.RankCounts.IndexOf(2);
if (pairRank > 0)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank == pairRank).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
// Below here, we can assume that all ranks are different.
(handInfo) => // 16. 4 to an open-ended straight
{
int rankCount = handInfo.RankCounts.GetRange(1, 4).Sum();
for (int minRank = 2; minRank <= 9; minRank++)
{
rankCount += handInfo.RankCounts[minRank + 3] - handInfo.RankCounts[minRank - 1];
if (rankCount == 4)
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(minRank, minRank + 3)).Select(i => 1 << i).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 17. Suited 89J, 8TJ, 8JQ, 9TJ, 9TQ, or 9JQ
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in new[] {new[] {8, 9, 11}, new[] {8, 10, 11}, new[] {8, 11, 12}, new[] {9, 10, 11}, new[] {9, 10, 12}, new[] {9, 11, 12}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 18. Unsuited JQKA
{
var ranks = new[] {1, 11, 12, 13};
if (ranks.All(rank => handInfo.RankCounts[rank] == 1))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank >= 11 || handInfo.Cards[i].Rank == 1).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 19. Suited 9JK or 9QK
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(9) && kvp.Value.ContainsKey(13) && (kvp.Value.ContainsKey(11) || kvp.Value.ContainsKey(12)));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(new[] {9, 11, 12, 13}.Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 20. Suited JQ, JK, or QK
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => Enumerable.Range(11, 3).Where(rank => kvp.Value.ContainsKey(rank)).Count() == 2);
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(Enumerable.Range(11, 3).Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 21. Suited 456, 567, or 678
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in Enumerable.Range(4, 3).Select(lowRank => Enumerable.Range(lowRank, 3)))
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 22. Suited JA
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(1) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass((1 << validRanksLookup[1]) + (1 << validRanksLookup[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 23. Suited 789 or 89T
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
foreach (var ranksToFind in new[] {7, 8}.Select(lowRank => Enumerable.Range(lowRank, 3)))
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 24. Suited QA or KA
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(1) && (kvp.Value.ContainsKey(12) || kvp.Value.ContainsKey(13)));
if (validSuits.Any())
{
var validRanksLookup = validSuits.First().Value;
return Core.RuleResult.Pass(new[] {12, 13, 1}.Where(rank => validRanksLookup.ContainsKey(rank)).Select(rank => 1 << validRanksLookup[rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 25. Suited 345
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var ranksToFind = Enumerable.Range(3, 3);
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 26. Unsuited 9JQK, TJQA, TJKA, or TQKA
{
var partialStraights = new[]
{
new[] {9, 11, 12, 13},
new[] {10, 11, 12, 1},
new[] {10, 11, 13, 1},
new[] {10, 12, 13, 1}
};
var matches = partialStraights.Where(partialStraight => partialStraight.Count(rank => handInfo.RankCounts[rank] == 1) == 4);
if (!matches.Any())
{
return Core.RuleResult.Fail();
}
var match = matches.First();
int rankToDiscard = handInfo.Cards.Select(card => card.Rank).Sum() - match.Sum();
return Core.RuleResult.Pass(31 - (1 << CardIndices.Where(i => handInfo.Cards[i].Rank == rankToDiscard).First()));
},
(handInfo) => // 27. Unsuited JQK
{
var jqkCounts = handInfo.RankCounts.GetRange(11, 3);
if (Enumerable.SequenceEqual(jqkCounts, new[] {1, 1, 1}))
{
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 13)).Select(i => 1 << i).Sum());
}
return Core.RuleResult.Fail();
},
(handInfo) => // 28. Unsuited JQ (rules C and D)
{
if (handInfo.RankCounts[11] != 1 || handInfo.RankCounts[12] != 1)
{
return Core.RuleResult.Fail();
}
var potentialStraightFlushDraws = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (potentialStraightFlushDraws.Any())
{
var suitAndRanks = potentialStraightFlushDraws.First();
// Rule C: Suited 7TJ beats unsuited JQ if the fifth card is a 6 or lower.
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {7, 10, 11}) && Enumerable.Range(2, 5).Select(rank => handInfo.RankCounts[rank]).Any(n => n == 1))
{
return Core.RuleResult.Fail("C");
}
// Rule D: Suited 78J or 79J beats unsuited JQ if the fifth card is an Ace.
if (suitAndRanks.Value[0] == 7 && suitAndRanks.Value[1].InRange(8, 9) && suitAndRanks.Value[2] == 11 && handInfo.RankCounts[1] == 1)
{
return Core.RuleResult.Fail("D");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Rank.InRange(11, 12)).Sum(i => 1 << i));
},
(handInfo) => // 29. Suited A23, A24, A25, A34, A35, A45, 568[G], 578[G], 689, 78J[E], 79J[F], 7TJ[F], 89Q, 8TQ, or 9TK
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
// First, the cases without any exceptions
foreach (var ranksToFind in new[] {new[] {1, 2, 3}, new[] {1, 2, 4}, new[] {1, 2, 5}, new[] {1, 3, 4}, new[] {1, 3, 5}, new[] {1, 4, 5}, new[] {5, 7, 8}, new[] {6, 8, 9}, new[] {8, 9, 12}, new[] {8, 10, 12}, new[] {9, 10, 13}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {5, 6, 8}))
{
// Rule G: Jack only beats this straight flush draw if there is a straight penalty card of 7 or lower that doesn't match the suit of the Jack.
if (handInfo.RankCounts[4] == 1 && handInfo.RankCounts[11] == 1)
{
var jackFourSuits = handInfo.Cards.Where(card => card.Rank == 11 || card.Rank == 4).Select(card => card.Suit);
if (jackFourSuits.Distinct().Count() == 2)
{
return Core.RuleResult.Fail("G");
}
}
return Core.RuleResult.Pass(new[] {5, 6, 8}.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
if (Enumerable.SequenceEqual(suitAndRanks.Value, new[] {7, 8, 11}))
{
// Rule E: Unsuited JK beats suited 78J if the fifth card is a 9 or a 10.
if (handInfo.RankCounts[13] == 1 && (handInfo.RankCounts[9] == 1 || handInfo.RankCounts[10] == 1))
{
return Core.RuleResult.Fail("E");
}
return Core.RuleResult.Pass(new[] {7, 8, 11}.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
foreach (var ranksToFind in new[] {new[] {7, 9, 11}, new[] {7, 10, 11}})
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, ranksToFind))
{
// Rule F: Unsuited JK beats suited 79J and 7TJ if the fifth card is an 8.
if (handInfo.RankCounts[13] == 1 && handInfo.RankCounts[8] == 1)
{
return Core.RuleResult.Fail("F");
}
return Core.RuleResult.Pass(ranksToFind.Select(rank => 1 << handInfo.CardPositionMatrix[suitAndRanks.Key][rank]).Sum());
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 30. Suited TJ (rules H and I)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && kvp.Value.ContainsKey(11));
if (validSuits.Any())
{
var suitAndRanksLookup = validSuits.First();
// Rule H: Unsuited JK beats suited TJ if the latter has an 8, 9, or flush penalty card.
if (handInfo.RankCounts[13] == 1 && (handInfo.RankCounts[8] == 1 || handInfo.RankCounts[9] == 1 || handInfo.RanksPerSuit[suitAndRanksLookup.Key].Length >= 3))
{
return Core.RuleResult.Fail("H");
}
// Rule I: Unsuited JA beats suited TJ if the latter has a flush penalty card of 6 or lower, and an 8 or a 9.
if (handInfo.RankCounts[1] == 1 && suitAndRanksLookup.Value.Keys.Min() <= 6 && (handInfo.RankCounts[8] == 1 || handInfo.RankCounts[9] == 1))
{
return Core.RuleResult.Fail("I");
}
return Core.RuleResult.Pass((1 << suitAndRanksLookup.Value[10]) + (1 << suitAndRanksLookup.Value[11]));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 31. Suited 234, 235, 245, 346, 356, 457, 467, 679, or 689 (rules G and J)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var rankArrays = new[]
{
new[] {2, 3, 4},
new[] {2, 3, 5},
new[] {2, 4, 5},
new[] {3, 4, 6},
new[] {3, 5, 6},
new[] {4, 5, 7},
new[] {4, 6, 7},
new[] {6, 7, 9},
new[] {6, 8, 9}
};
for (int index = 0; index < rankArrays.Length; index++)
{
if (Enumerable.SequenceEqual(suitAndRanks.Value, rankArrays[index]))
{
// Rule J: Ace only beats this straight flush draw if the fifth card is a 6 that doesn't match the suit of the Ace.
// It's easier to check for this first because we want to see if there's an Ace.
if (index < 3 && handInfo.RankCounts[1] == 1 && handInfo.RankCounts[6] == 1)
{
var aceAndSix = handInfo.Cards.Where(card => card.Rank == 1 || card.Rank == 6);
if (aceAndSix.Select(card => card.Suit).Distinct().Count() == 2)
{
return Core.RuleResult.Fail("J");
}
}
// Rule G: Jack only beats this straight flush draw if there is a straight penalty card of 7 or lower that doesn't match the suit of the Jack.
int lowRank = rankArrays[index][0];
if (handInfo.RankCounts[11] == 1 && ((lowRank != 2 && handInfo.RankCounts[lowRank - 1] == 1) || (lowRank <= 3 && handInfo.RankCounts[lowRank + 4] == 1)) && rankArrays[index][1] != 7)
{
var jackSuit = handInfo.Cards.Where(card => card.Rank == 11).First().Suit;
if (handInfo.RanksPerSuit[jackSuit].Length == 1)
{
return Core.RuleResult.Fail("G");
}
}
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 32. Unsuited JK
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {11, 13}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 33. Suited 78T or 79T (rule K: Jack only beats suited 78T and 79T if the fifth card is a 6.)
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var ranks = suitAndRanks.Value;
if (ranks[0] == 7 && ranks[2] == 10)
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[6] == 1)
{
return Core.RuleResult.Fail("K");
}
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 34. Unsuited JA or QK
{
if (handInfo.RankCounts[11] == 1 && handInfo.RankCounts[1] == 1)
{
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {11, 1}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
}
if (handInfo.RankCounts[12] == 1 && handInfo.RankCounts[13] == 1)
{
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {12, 13}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 35. Unsuited QA or KA (rule L: Suited TQ beats unsuited QA if the former doesn't have a flush penalty card and there isn't an 8 or 9.)
{
if (handInfo.RankCounts[1] == 1 && (handInfo.RankCounts[12] == 1 || handInfo.RankCounts[13] == 1))
{
if (handInfo.RankCounts[12] == 1)
{
var queenSuit = handInfo.Cards.Where(card => card.Rank == 12).First().Suit;
if (Enumerable.SequenceEqual(handInfo.RanksPerSuit[queenSuit], new[] {10, 12}) && handInfo.RankCounts[8] != 1 && handInfo.RankCounts[9] != 1)
{
return Core.RuleResult.Fail("L");
}
}
return Core.RuleResult.Pass(CardIndices.Where(i => new[] {12, 13, 1}.Contains(handInfo.Cards[i].Rank)).Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 36. Suited TQ or TK (rule M: King only beats suited TK if the latter has a flush penalty card.)
{
var validSuits = handInfo.CardPositionMatrix.Where(kvp => kvp.Value.ContainsKey(10) && (kvp.Value.ContainsKey(12) || kvp.Value.ContainsKey(13)));
if (validSuits.Any())
{
var suitAndRanksLookup = validSuits.First();
if (suitAndRanksLookup.Value.ContainsKey(13) && suitAndRanksLookup.Value.Count() == 3)
{
return Core.RuleResult.Fail("M");
}
return Core.RuleResult.Pass(CardIndices.Where(i => handInfo.Cards[i].Suit == suitAndRanksLookup.Key && handInfo.Cards[i].Rank >= 10).Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
},
(handInfo) => // 37. Single high card
{
var highCardPositions = CardIndices.Where(i => handInfo.Cards[i].Rank == 1 || handInfo.Cards[i].Rank >= 11);
if (highCardPositions.Any())
{
int cardIndex = highCardPositions.First();
var highCard = handInfo.Cards[cardIndex];
if (highCard.Rank == 13 && Enumerable.SequenceEqual(handInfo.RanksPerSuit[highCard.Suit], new[] {10, 13}))
{
return Core.RuleResult.Pass("O", handInfo.CardPositionMatrix[highCard.Suit].Values.Sum(i => 1 << i));
}
else
{
return Core.RuleResult.Pass(1 << cardIndex);
}
}
return Core.RuleResult.Fail();
},
(handInfo) => // 38. Any other 3 to a straight flush not listed
{
var validSuits = handInfo.RanksPerSuit.Where(kvp => kvp.Value.Length == 3);
if (!validSuits.Any())
{
return Core.RuleResult.Fail();
}
var suitAndRanks = validSuits.First();
var ranks = suitAndRanks.Value;
if (ranks[0].InRange(2, 6) && ranks[2] - ranks[0] == 4)
{
return Core.RuleResult.Pass(handInfo.CardPositionMatrix[suitAndRanks.Key].Values.Sum(i => 1 << i));
}
return Core.RuleResult.Fail();
}
);
}
}
} | 52.234603 | 292 | 0.435056 | [
"MIT"
] | lingomaniac88/ktaneVideoPoker | Assets/Scripts/Module/Variants/JacksOrBetter.cs | 111,107 | C# |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace org.neuroph.imgrec.filter.impl
{
///
/// <summary>
/// @author Mihailo Stupar
/// </summary>
// http://opencv-code.com/quick-tips/implementation-of-thinning-algorithm-in-opencv/
public class ZhangSuenThinFilter : ImageFilter
{
private BufferedImage originalImage;
private BufferedImage filteredImage;
private bool blackLetters = true;
internal int[][] imageM;
internal int width;
internal int height;
///
/// <param name="image"> The input image should be binary
/// @return </param>
public virtual BufferedImage processImage(BufferedImage image)
{
originalImage = image;
width = originalImage.Width;
height = originalImage.Height;
filteredImage = new BufferedImage(width, height, originalImage.Type);
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: imageM = new int[width][height];
imageM = RectangularArrays.ReturnRectangularIntArray(width, height);
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
int col = (new Color(originalImage.getRGB(i, j))).Red;
if (blackLetters)
{
imageM[i][j] = 1 - (col / 255);
}
else
{
imageM[i][j] = col / 255;
}
}
}
while (true)
{
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: int[][] start = new int[width][height];
int[][] start = RectangularArrays.ReturnRectangularIntArray(width, height);
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
start[i][j] = imageM[i][j];
}
}
thiningIteration(0);
thiningIteration(1);
bool same = true;
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
if (start[i][j] != imageM[i][j])
{
same = false;
goto MainforLoopBreak;
}
}
MainforLoopContinue:;
}
MainforLoopBreak:
if (same)
{
break;
}
}
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
int alpha = (new Color(originalImage.getRGB(i, j))).Alpha;
int col;
if (blackLetters)
{
col = 255 - imageM[i][j] * 255;
}
else
{
col = imageM[i][j] * 255;
}
int rgb = ImageUtilities.colorToRGB(alpha, col, col, col);
filteredImage.setRGB(i, j, rgb);
}
}
return filteredImage;
}
public virtual void thiningIteration(int iter)
{
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: int[][] marker = new int[width][height];
int[][] marker = RectangularArrays.ReturnRectangularIntArray(width, height);
for (int i = 1; i < width - 1; i++)
{
for (int j = 1; j < height - 1; j++)
{
int p2 = imageM[i - 1][j];
int p3 = imageM[i - 1][j + 1];
int p4 = imageM[i][j + 1];
int p5 = imageM[i + 1][j + 1];
int p6 = imageM[i + 1][j];
int p7 = imageM[i + 1][j - 1];
int p8 = imageM[i][j - 1];
int p9 = imageM[i - 1][j - 1];
// int A = (p2 == 0 && p3 == 1) + (p3 == 0 && p4 == 1) +
// (p4 == 0 && p5 == 1) + (p5 == 0 && p6 == 1) +
// (p6 == 0 && p7 == 1) + (p7 == 0 && p8 == 1) +
// (p8 == 0 && p9 == 1) + (p9 == 0 && p2 == 1);
int c1 = 0; //p2 == 0 && p3 == 1
int c2 = 0; //p3 == 0 && p4 == 1
int c3 = 0; //p4 == 0 && p5 == 1
int c4 = 0; //p5 == 0 && p6 == 1
int c5 = 0; //p6 == 0 && p7 == 1
int c6 = 0; //p7 == 0 && p8 == 1
int c7 = 0; //p8 == 0 && p9 == 1
int c8 = 0; //p9 == 0 && p2 == 1
if (p2 == 0 && p3 == 1)
{
c1 = 1;
}
if (p3 == 0 && p4 == 1)
{
c2 = 1;
}
if (p4 == 0 && p5 == 1)
{
c3 = 1;
}
if (p5 == 0 && p6 == 1)
{
c4 = 1;
}
if (p6 == 0 && p7 == 1)
{
c5 = 1;
}
if (p7 == 0 && p8 == 1)
{
c6 = 1;
}
if (p8 == 0 && p9 == 1)
{
c7 = 1;
}
if (p9 == 0 && p2 == 1)
{
c8 = 1;
}
int A = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8;
int B = p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
int m1 = iter == 0 ? (p2 * p4 * p6) : (p2 * p4 * p8);
int m2 = iter == 0 ? (p4 * p6 * p8) : (p2 * p6 * p8);
if (A == 1 && (B >= 2 && B <= 6) && m1 == 0 && m2 == 0)
{
marker[i][j] = 1;
}
}
}
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
int tmp = 1 - marker[i][j];
if (imageM[i][j] == tmp && imageM[i][j] == 1)
{
imageM[i][j] = 1;
}
else
{
imageM[i][j] = 0;
}
}
}
}
public override string ToString()
{
return "Zhang-Suen Thin Method";
}
public virtual bool BlackLetters
{
set
{
this.blackLetters = value;
}
}
}
} | 21.764228 | 162 | 0.497012 | [
"Apache-2.0"
] | starhash/Neuroph.NET | Neuroph/imgrec/filter/impl/ZhangSuenThinFilter.cs | 5,356 | C# |
using System;
using System.Drawing;
using System.Management;
using System.Runtime.InteropServices;
using Hwnd = System.IntPtr;
#pragma warning disable 1591
namespace TuaRua.FreSharp.Utils {
/// <summary>
///
/// </summary>
public static class WinApi {
private const string User32 = "user32";
//private const string Kernel32 = "kernel32";
private const string Gdi32 = "gdi32";
/// <summary>
///
/// </summary>
/// <returns></returns>
public static Tuple<int, int> GetOsVersion() {
var result = new Tuple<int, int>(0, 0);
var searcher = new ManagementObjectSearcher("SELECT Version FROM Win32_OperatingSystem");
const char delimiter = '.';
foreach (var o in searcher.Get()) {
var os = (ManagementObject) o;
var version = os["Version"].ToString();
var substrings = version.Split(delimiter);
return new Tuple<int, int>(Convert.ToInt32(substrings[0]), Convert.ToInt32(substrings[1]));
}
return result;
}
public static double GetScaleFactor() {
var g = Graphics.FromHwnd(Hwnd.Zero);
var desktop = g.GetHdc();
var logicalScreenHeight = GetDeviceCaps(desktop, (int) DeviceCap.VERTRES);
var physicalScreenHeight = GetDeviceCaps(desktop, (int) DeviceCap.DESKTOPVERTRES);
var ydpi = GetDeviceCaps(desktop, (int) DeviceCap.LOGPIXELSY);
var dpiScale = ydpi / 96.0;
g.ReleaseHdc();
if (dpiScale > 1.0) {
return dpiScale;
}
if (physicalScreenHeight / (double) logicalScreenHeight > 1.0) {
return physicalScreenHeight / (double) logicalScreenHeight;
}
return 1.0;
}
/// <summary>
///
/// </summary>
/// <param name="hwnd"></param>
/// <param name="nCmdShow"></param>
/// <returns></returns>
[DllImport(User32, ExactSpelling = true)]
public static extern bool ShowWindow(Hwnd hwnd, ShowWindowCommands nCmdShow);
/// <summary>
///
/// </summary>
/// <param name="hwnd"></param>
/// <returns></returns>
[DllImport(User32, ExactSpelling = true)]
public static extern bool UpdateWindow(Hwnd hwnd);
/// <summary>
///
/// </summary>
/// <param name="hwnd"></param>
/// <param name="hWndInsertAfter"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="cx"></param>
/// <param name="cy"></param>
/// <param name="flags"></param>
/// <returns></returns>
[DllImport(User32, ExactSpelling = true)]
public static extern bool SetWindowPos(Hwnd hwnd, Hwnd hWndInsertAfter, int x, int y, int cx, int cy,
WindowPositionFlags flags);
/// <summary>
///
/// </summary>
/// <param name="hwnd"></param>
/// <param name="flags"></param>
/// <returns></returns>
[DllImport(User32, ExactSpelling = true)]
public static extern bool RegisterTouchWindow(Hwnd hwnd, TouchWindowFlags flags);
/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Rect {
public int left;
public int top;
public int right;
public int bottom;
}
[DllImport(User32, ExactSpelling = true)]
public static extern Hwnd GetWindowRect(Hwnd hWnd, ref Rect rect);
[DllImport(User32, ExactSpelling = true)]
public static extern bool SetLayeredWindowAttributes(Hwnd hwnd, uint crKey, byte bAlpha,
LayeredWindowAttributeFlag dwFlags);
[DllImport(User32)]
public static extern int GetWindowLong(Hwnd hwnd, int nIndex);
[DllImport(Gdi32, ExactSpelling = true)]
public static extern int GetDeviceCaps(Hwnd hdc, int nIndex);
}
[Flags]
public enum WindowLongFlags {
GWL_EXSTYLE = -20,
}
[Flags]
public enum ShowWindowCommands {
SW_FORCEMINIMIZE = 11,
SW_HIDE = 0,
SW_MAXIMIZE = 3,
SW_MINIMIZE = 6,
SW_RESTORE = 9,
SW_SHOW = 5,
SW_SHOWDEFAULT = 10,
SW_SHOWMAXIMIZED = 3,
SW_SHOWMINIMIZED = 2,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_SHOWNOACTIVATE = 4,
SW_SHOWNORMAL = 1
}
[Flags]
public enum WindowStyles {
WS_CHILD = 0x40000000,
WS_VISIBLE = 0x10000000,
}
[Flags]
public enum WindowExStyles {
WS_EX_LAYERED = 0x00080000,
}
[Flags]
public enum LayeredWindowAttributeFlag {
LWA_ALPHA = 0x00000002,
LWA_COLORKEY = 0x00000001
}
[Flags]
public enum WindowPositionFlags {
SWP_ASYNCWINDOWPOS = 0x4000,
SWP_DEFERERASE = 0x2000,
SWP_DRAWFRAME = 0x0020,
SWP_FRAMECHANGED = 0x0020,
SWP_HIDEWINDOW = 0x0080,
SWP_NOACTIVATE = 0x0010,
SWP_NOCOPYBITS = 0x0100,
SWP_NOMOVE = 0x0002,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOREDRAW = 0x0008,
SWP_NOREPOSITION = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_NOSIZE = 0x0001,
SWP_NOZORDER = 0x0004,
SWP_SHOWWINDOW = 0x0040
}
[Flags]
public enum TouchWindowFlags {
TWF_FINETOUCH = 0x00000001,
TWF_WANTPALM = 0x00000002
}
[Flags]
public enum DeviceCap {
VERTRES = 10,
DESKTOPVERTRES = 117,
LOGPIXELSY = 90
}
} | 30.359788 | 109 | 0.564134 | [
"Apache-2.0"
] | dedosmedia/AWS-S3-ANE | framework_src/FreSharp/Utils/WinAPI.cs | 5,740 | C# |
using System.IO;
using CP77.CR2W.Reflection;
using FastMember;
using static CP77.CR2W.Types.Enums;
namespace CP77.CR2W.Types
{
[REDMeta]
public class SetSkillcheckEvent : redEvent
{
[Ordinal(0)] [RED("skillcheckContainer")] public CHandle<BaseSkillCheckContainer> SkillcheckContainer { get; set; }
public SetSkillcheckEvent(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { }
}
}
| 26.9375 | 119 | 0.733179 | [
"MIT"
] | Eingin/CP77Tools | CP77.CR2W/Types/cp77/SetSkillcheckEvent.cs | 416 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace CosmosDbExplorer.Views
{
/// <summary>
/// Interaction logic for DatabaseScaleView.xaml
/// </summary>
public partial class DatabaseScaleView : UserControl
{
public DatabaseScaleView()
{
InitializeComponent();
}
}
}
| 23.103448 | 56 | 0.728358 | [
"MIT"
] | sachabruttin/DocumentDbExplorer | src/CosmosDbExplorer/Views/DatabaseScaleView.xaml.cs | 672 | C# |
namespace ConsoleApplication11
{
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main(string[] args)
{
var emailbook = new Dictionary<string, string>();
var input = Console.ReadLine();
while (input != "stop")
{
var name = input;
var email = Console.ReadLine().Split('.').ToList();
if (email[1] != "us" || email[1] != "uk")
{
emailbook[name] += email;
}
input = Console.ReadLine();
}
foreach(var name in emailbook)
{
var Name = name.Key;
var Number = name.Value;
Console.WriteLine($"{Name} -> {Number} ");
}
}
}
} | 27.727273 | 68 | 0.414208 | [
"Unlicense"
] | Borislav2110/email_book | Program.cs | 917 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
namespace Microsoft.EntityFrameworkCore.Query
{
public abstract class NorthwindIncludeQueryRelationalTestBase<TFixture> : NorthwindIncludeQueryTestBase<TFixture>
where TFixture : NorthwindQueryFixtureBase<NoopModelCustomizer>, new()
{
protected NorthwindIncludeQueryRelationalTestBase(TFixture fixture)
: base(fixture)
{
}
public override async Task Include_collection_with_last_no_orderby(bool async)
{
Assert.Equal(
RelationalStrings.LastUsedWithoutOrderBy(nameof(Enumerable.Last)),
(await Assert.ThrowsAsync<InvalidOperationException>(
() => base.Include_collection_with_last_no_orderby(async))).Message);
}
protected virtual bool CanExecuteQueryString => false;
protected override QueryAsserter CreateQueryAsserter(TFixture fixture)
=> new RelationalQueryAsserter(fixture, RewriteExpectedQueryExpression, RewriteServerQueryExpression, canExecuteQueryString: CanExecuteQueryString);
}
}
| 40.314286 | 160 | 0.739901 | [
"Apache-2.0"
] | TheFanatr/EFCore | test/EFCore.Relational.Specification.Tests/Query/NorthwindIncludeQueryRelationalTestBase.cs | 1,413 | 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.Bda.V20200324.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class Orientation : AbstractModel
{
/// <summary>
/// 人体朝向信息,返回值为以下集合中的一个 {正向, 背向, 左, 右}。
/// </summary>
[JsonProperty("Type")]
public string Type{ get; set; }
/// <summary>
/// Type识别概率值,[0.0,1.0],代表判断正确的概率。如0.8则代表有Type值有80%概率正确。
/// </summary>
[JsonProperty("Probability")]
public float? Probability{ 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 + "Type", this.Type);
this.SetParamSimple(map, prefix + "Probability", this.Probability);
}
}
}
| 30.745098 | 81 | 0.63648 | [
"Apache-2.0"
] | TencentCloud/tencentcloud-sdk-dotnet | TencentCloud/Bda/V20200324/Models/Orientation.cs | 1,676 | C# |
using System;
using System.Collections.Generic;
using NSubstitute;
namespace Workflows.Tests
{
public class WorkflowTestsBase
{
protected readonly ITestContext Context;
protected readonly ITestOutput Output;
protected readonly TestWorkflow Workflow;
protected readonly Dictionary<string, bool> TestFlags;
protected WorkflowTestsBase()
{
Context = Substitute.For<ITestContext>();
Output = Substitute.For<ITestOutput>();
TestFlags = new Dictionary<string, bool>();
Context.TestFlags.Returns(TestFlags);
Context.Out.Returns(Output);
Workflow = new TestWorkflow();
}
}
public interface ITestOutput
{
void Executed(object step);
void Failed(Exception exception);
void Success();
void Rollback(object step);
}
public interface ITestContext
{
IDictionary<string, bool> TestFlags { get; }
ITestOutput Out { get; }
}
} | 25.292683 | 62 | 0.621022 | [
"MIT"
] | delpher/Workflows.NET | Workflows.Tests.Src/WorkflowTestsBase.cs | 1,039 | C# |
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Geomethod;
using Geomethod.Data;
using Geomethod.Web;
public partial class PollPage : System.Web.UI.Page
{
Log log;
PageHelper pageHelper;
[SessionObject]
public Poll poll;
protected void Page_Load(object sender, EventArgs e)
{
try
{
log = AdminMasterPage.InitPage(this, "Poll");
pageHelper = new PageHelper(this);
if (!IsPostBack)
{
LoadData();
}
ucPoll.InitControl(poll);
ucPollAnswers.InitControl(poll.Id);
}
catch (Exception ex)
{
log.Exception(ex);
}
}
void LoadData()
{
int id = RequestUtils.GetPollId(this);
if (id!=0)
{
using (GmConnection conn = Global.CreateConnection())
{
poll = Poll.GetPoll(conn, id);
}
}
if (poll == null)
{
poll = new Poll();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
int id = poll.Id;
if (id == 0) poll.status = RecordStatus.Admin;
using (GmConnection conn = Global.CreateConnection())
{
poll.Save(conn);
}
lblResult.Text = string.Format("Data saved.");
if (id == 0 && poll.Id > 0)
{
ucPollAnswers.InitControl(poll.Id);
}
// WebUtils.Redirect(this, "Private/Users.aspx");
}
catch (Exception ex)
{
log.Exception(ex);
}
}
}
| 18.6125 | 57 | 0.664204 | [
"MIT"
] | AlexAbramov/target-labs-portal | src/portal/Admin/Poll.aspx.cs | 1,489 | C# |
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Drawing;
using System.Diagnostics;
using ZoneFiveSoftware.Common.Data;
using ZoneFiveSoftware.Common.Data.Fitness;
using ZoneFiveSoftware.Common.Data.GPS;
using ZoneFiveSoftware.Common.Visuals;
namespace RecordBook.Edit
{
class RecordBookAction : IAction
{
#region Fields
private IList<IActivity> activities;
#endregion
#region Constructor
public RecordBookAction(IList<IActivity> activities)
{
this.activities = activities;
}
#endregion
#region IAction Members
public bool Enabled
{
get { return true; }
}
public bool HasMenuArrow
{
get { return false; }
}
public Image Image
{
get
{
//return Resources.Resources.Image_16_Reverse;
return null;
}
}
public void Refresh()
{
}
public void Run(Rectangle rectButton)
{
Debug.WriteLine("No. of activities selected: " + activities.Count);
//TODO: Is there some way to store the activities somewhere else?!?
}
public string Title
{
get { return "Record Book"; }
}
#endregion
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
}
| 19.858974 | 79 | 0.573919 | [
"Apache-2.0"
] | mechgt/record-book | Record Book/Edit/RecordBookAction.cs | 1,551 | C# |
using System;
using System.Runtime.InteropServices;
namespace Septerra.Core.Hooks
{
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public unsafe struct ResourceName
{
public fixed sbyte name[20];
public byte field_14;
public byte field_15;
public byte field_16;
public byte field_17;
public Int32 Index;
public Int32 Count;
};
} | 23.705882 | 51 | 0.652605 | [
"MIT"
] | Albeoris/Septerra | Septerra.Core/Hooks/BattleDispatcher/ResourceName.cs | 405 | 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("System.Core.Quality_NServiceBus_Community")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("System.Core.Quality_NServiceBus_Community")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[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("361f845e-3859-485d-9096-8609f3811c12")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 40.783784 | 85 | 0.737575 | [
"Apache-2.0",
"MIT"
] | Grimace1975/bclcontrib | Core/Quality/System.Core.Quality_NServiceBus_Community/Properties/AssemblyInfo.cs | 1,512 | C# |
#region Copyright
//
// Copyright (c) Phoenix Contact GmbH & Co. KG. All rights reserved.
// Licensed under the MIT. See LICENSE file in the project root for full license information.
//
#endregion
using System.Reflection;
using Iec61131.Engineering.Library;
// 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("PLCnext_CSharpExamples")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("PHOENIX CONTACT ELECTRONICS GmbH")]
[assembly: AssemblyCopyright("Copyright © PHOENIX CONTACT ELECTRONICS GmbH 2018")]
// 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")]
[assembly: Library]
| 35.181818 | 95 | 0.740741 | [
"MIT"
] | PLCnext/CSharpExamples | PLCnext_CSharpExamples/Properties/AssemblyInfo.cs | 1,162 | C# |
// Copyright (c) 2012, Event Store LLP
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// Neither the name of the Event Store LLP nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
using System;
using System.Net;
using EventStore.Common.Options;
using NUnit.Framework;
namespace EventStore.Core.Tests.Common.Options
{
[TestFixture]
public class opts_helper_for_custom_type_should: OptsHelperTestBase
{
public IPAddress Value { get { throw new InvalidOperationException(); } }
[Test]
public void parse_explicitly_present_value_from_cmd_line()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
Helper.Parse("-v", "192.168.1.1");
Assert.AreEqual(IPAddress.Parse("192.168.1.1"), Helper.Get(() => Value));
}
[Test]
public void throw_option_exception_for_missing_value_with_no_default()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
Assert.Throws<OptionException>(() => Helper.Parse());
}
[Test]
public void return_default_value_for_missing_value_if_default_is_set()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value", IPAddress.Loopback);
Helper.Parse();
Assert.AreEqual(IPAddress.Loopback, Helper.Get(() => Value));
}
[Test]
public void prefer_cmd_line_before_env()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
SetEnv("VALUE", "192.168.2.2");
Helper.Parse("--value=192.168.1.1");
Assert.AreEqual(IPAddress.Parse("192.168.1.1"), Helper.Get(() => Value));
}
[Test]
public void prefer_cmd_line_before_json()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
var cfg = WriteJsonConfig(new { settings = new { value = "192.168.3.3" } });
Helper.Parse("-v", "192.168.1.1", "--cfg", cfg);
Assert.AreEqual(IPAddress.Parse("192.168.1.1"), Helper.Get(() => Value));
}
[Test]
public void prefer_cmd_line_before_json_and_env()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
SetEnv("VALUE", "192.168.2.2");
var cfg = WriteJsonConfig(new { settings = new { value = "192.168.3.3" } });
Helper.Parse("-v:192.168.1.1", "--cfg", cfg);
Assert.AreEqual(IPAddress.Parse("192.168.1.1"), Helper.Get(() => Value));
}
[Test]
public void prefer_env_if_no_cmd_line()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
SetEnv("VALUE", "192.168.2.2");
var cfg = WriteJsonConfig(new { settings = new { value = "192.168.3.3" } });
Helper.Parse("--cfg", cfg);
Assert.AreEqual(IPAddress.Parse("192.168.2.2"), Helper.Get(() => Value));
}
[Test]
public void prefer_json_if_no_cmd_line_or_env()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
var cfg = WriteJsonConfig(new { settings = new { value = "192.168.3.3" } });
Helper.Parse("--cfg", cfg);
Assert.AreEqual(IPAddress.Parse("192.168.3.3"), Helper.Get(() => Value));
}
[Test]
public void preserve_order_of_jsons()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
var cfg1 = WriteJsonConfig(new { settings = new { value = "192.168.3.3" } });
var cfg2 = WriteJsonConfig(new { settings = new { value = "192.168.4.4" } });
Helper.Parse("--cfg", cfg1, "--cfg", cfg2);
Assert.AreEqual(IPAddress.Parse("192.168.3.3"), Helper.Get(() => Value));
}
[Test]
public void search_all_jsons_before_giving_up()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value");
var cfg1 = WriteJsonConfig(new { settings = new { value_other = "192.168.3.3" } });
var cfg2 = WriteJsonConfig(new { settings = new { value = "192.168.4.4" } });
Helper.Parse("--cfg", cfg1, "--cfg", cfg2);
Assert.AreEqual(IPAddress.Parse("192.168.4.4"), Helper.Get(() => Value));
}
[Test]
public void use_default_if_all_failed()
{
Helper.RegisterRef(() => Value, "v|value=", "VALUE", "settings.value", IPAddress.Loopback);
var cfg1 = WriteJsonConfig(new { settings = new { value_other = "192.168.3.3" } });
Helper.Parse("--cfg", cfg1);
Assert.AreEqual(IPAddress.Loopback, Helper.Get(() => Value));
}
}
} | 41.9 | 103 | 0.600159 | [
"BSD-3-Clause"
] | ianbattersby/EventStore | src/EventStore/EventStore.Core.Tests/Common/Options/opts_helper_for_custom_type_should.cs | 6,287 | C# |
using System.Collections.Generic;
namespace ET
{
public class GateSessionKeyComponent : Entity, IAwake
{
public readonly Dictionary<long, string> sessionKey = new Dictionary<long, string>();
}
}
| 20.2 | 87 | 0.757426 | [
"MIT"
] | Carbiy001/ET | Server/Model/Demo/GateSessionKeyComponent.cs | 204 | C# |
#region Copyright
/*Copyright (C) 2015 Wosad 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wosad.Common.CalculationLogger;
using Wosad.Common.CalculationLogger.Interfaces;
using Wosad.Common.CalculationLogger;
using Wosad.Common.CalculationLogger.Interfaces;
namespace Wosad.Loads.ASCE.ASCE7_10.SnowLoads
{
public partial class SnowStructure
{
public double GetSlopedRoofLoad(double Cs, double pf)
{
double ps = Cs * pf;
#region ps
ICalcLogEntry psEntry = new CalcLogEntry();
psEntry.ValueName = "ps";
psEntry.AddDependencyValue("Cs", Math.Round(Cs, 3));
psEntry.AddDependencyValue("pf", Math.Round(pf, 3));
psEntry.Reference = "";
psEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/SlopedRoofSnowLoad.docx";
psEntry.FormulaID = null; //reference to formula from code
psEntry.VariableValue = Math.Round(ps, 3).ToString();
#endregion
this.AddToLog(psEntry);
double p_snow = ps;
return p_snow;
}
}
}
| 31.357143 | 100 | 0.673121 | [
"Apache-2.0"
] | Wosad/Wosad.Design | Wosad.Loads/ASCE7/ASCE7v10/C07_SnowLoads/SlopedRoofLoad.cs | 1,756 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Marten.Testing.Harness;
using Weasel.Core;
using Weasel.Core.Migrations;
using Weasel.Postgresql;
using Xunit;
namespace Marten.Testing.Examples
{
public class ScenarioUsingSequenceForUniqueId : OneOffConfigurationsContext
{
#region sample_scenario-usingsequenceforuniqueid-setup
// We introduce a new feature schema, making use of Marten's schema management facilities.
public class MatterId: FeatureSchemaBase
{
private readonly int _startFrom;
private readonly string _schema;
public MatterId(StoreOptions options, int startFrom) : base(nameof(MatterId), options.Advanced.Migrator)
{
_startFrom = startFrom;
_schema = options.DatabaseSchemaName;
}
protected override IEnumerable<ISchemaObject> schemaObjects()
{
// We return a sequence that starts from the value provided in the ctor
yield return new Sequence(new DbObjectName(_schema, $"mt_{nameof(MatterId).ToLowerInvariant()}"), _startFrom);
}
}
#endregion
[Fact]
public async Task ScenarioUsingSequenceForUniqueIdScenario()
{
StoreOptions(storeOptions =>
{
#region sample_scenario-usingsequenceforuniqueid-storesetup-1
storeOptions.Storage.Add(new MatterId(storeOptions, 10000));
#endregion
});
#region sample_scenario-usingsequenceforuniqueid-storesetup-2
await theStore.Schema.ApplyAllConfiguredChangesToDatabaseAsync();
#endregion
#region sample_scenario-usingsequenceforuniqueid-querymatter
var matter = theStore.Storage.FindFeature(typeof(MatterId)).Objects.OfType<Sequence>().Single();
using var session = theStore.OpenSession();
// Generate a new, unique identifier
var nextMatter = session.NextInSequence(matter);
var contract = new Contract
{
Id = Guid.NewGuid(),
Matter = nextMatter
};
var inquiry = new Inquiry
{
Id = Guid.NewGuid(),
Matter = nextMatter
};
session.Store(contract);
session.Store(inquiry);
await session.SaveChangesAsync();
#endregion
}
#region sample_scenario-usingsequenceforuniqueid-setup-types
public class Contract
{
public Guid Id { get; set; }
public int Matter { get; set; }
// Other fields...
}
public class Inquiry
{
public Guid Id { get; set; }
public int Matter { get; set; }
// Other fields...
}
#endregion
}
#region sample_scenario-usingsequenceforuniqueid-setup-extensions
public static class SessionExtensions
{
// A shorthand for generating the required SQL statement for a sequence value query
public static int NextInSequence(this IQuerySession session, Sequence sequence)
{
return session.Query<int>("select nextval(?)", sequence.Identifier.QualifiedName).First();
}
}
#endregion
}
| 32.273585 | 126 | 0.60684 | [
"MIT"
] | aTiKhan/marten | src/Marten.Testing/Examples/ScenarioUsingSequenceForUniqueId.cs | 3,421 | 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.Azure.Network.Outputs
{
[OutputType]
public sealed class ApplicationGatewayGatewayIpConfiguration
{
/// <summary>
/// The ID of the Rewrite Rule Set
/// </summary>
public readonly string? Id;
/// <summary>
/// The Name of this Gateway IP Configuration.
/// </summary>
public readonly string Name;
/// <summary>
/// The ID of a Subnet.
/// </summary>
public readonly string SubnetId;
[OutputConstructor]
private ApplicationGatewayGatewayIpConfiguration(
string? id,
string name,
string subnetId)
{
Id = id;
Name = name;
SubnetId = subnetId;
}
}
}
| 25.534884 | 88 | 0.592896 | [
"ECL-2.0",
"Apache-2.0"
] | AdminTurnedDevOps/pulumi-azure | sdk/dotnet/Network/Outputs/ApplicationGatewayGatewayIpConfiguration.cs | 1,098 | C# |
#region License
// Copyright (c) Jeremy Skinner (http://www.jeremyskinner.co.uk)
//
// 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.
//
// The latest version of this file can be found at http://www.codeplex.com/FluentValidation
#endregion
namespace FluentValidation.Tests {
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
[TestFixture]
public class ChainedValidationTester {
PersonValidator validator;
Person person;
[SetUp]
public void Setup() {
validator = new PersonValidator();
person = new Person {
Address = new Address {
Country = new Country()
},
Orders = new List<Order> {
new Order() { Amount = 5 },
new Order() { ProductName = "Foo" }
}
};
}
[Test]
public void Validates_chained_property() {
var results = validator.Validate(person);
results.Errors.Count.ShouldEqual(3);
results.Errors[0].PropertyName.ShouldEqual("Forename");
results.Errors[1].PropertyName.ShouldEqual("Address.Postcode");
results.Errors[2].PropertyName.ShouldEqual("Address.Country.Name");
}
[Test]
public void Chained_validator_should_not_be_invoked_on_null_property() {
var results = validator.Validate(new Person());
results.Errors.Count.ShouldEqual(1);
}
[Test]
public void Should_allow_normal_rules_and_chained_property_on_same_property() {
validator.RuleFor(x => x.Address.Line1).NotNull();
var result = validator.Validate(person);
result.Errors.Count.ShouldEqual(4);
}
[Test]
public void Explicitly_included_properties_should_be_propogated_to_nested_validators() {
var results = validator.Validate(person, x => x.Address);
results.Errors.Count.ShouldEqual(2);
results.Errors.First().PropertyName.ShouldEqual("Address.Postcode");
results.Errors.Last().PropertyName.ShouldEqual("Address.Country.Name");
}
[Test]
public void Explicitly_included_properties_should_be_propogated_to_nested_validators_using_strings() {
var results = validator.Validate(person, "Address");
results.Errors.Count.ShouldEqual(2);
results.Errors.First().PropertyName.ShouldEqual("Address.Postcode");
results.Errors.Last().PropertyName.ShouldEqual("Address.Country.Name");
}
[Test]
public void Chained_property_should_be_excluded() {
var results = validator.Validate(person, x => x.Surname);
results.Errors.Count.ShouldEqual(0);
}
[Test]
public void Condition_should_work_with_chained_property() {
var person = new Person {
Address = new Address {
Line2 = "foo"
}
};
var result = validator.Validate(person);
result.Errors.Count.ShouldEqual(3);
result.Errors.Last().PropertyName.ShouldEqual("Address.Line1");
}
[Test]
public void Can_validate_using_validator_for_base_type() {
var addressValidator = new InlineValidator<IAddress>() {
v => v.RuleFor(x => x.Line1).NotNull()
};
var validator = new TestValidator {
v => v.RuleFor(x => x.Address).SetValidator(addressValidator)
};
var result = validator.Validate(new Person { Address = new Address() });
result.IsValid.ShouldBeFalse();
}
[Test]
public void Separate_validation_on_chained_property() {
var validator = new DepartmentValidator();
var result = validator.Validate(new Department
{
Manager = new Person(),
Assistant = new Person()
});
result.IsValid.ShouldBeTrue();
}
[Test]
public void Separate_validation_on_chained_property_valid() {
var validator = new DepartmentValidator();
var result = validator.Validate(new Department {
Manager = new Person {
Surname = "foo"
}
});
result.Errors.IsValid().ShouldBeTrue();
}
[Test]
public void Separate_validation_on_chained_property_conditional() {
var validator = new DepartmentValidator();
var result = validator.Validate(new Department {
Manager = new Person {
Surname = "foo"
},
Assistant = new Person {
Surname = "foo"
}
});
result.Errors.Count.ShouldEqual(1);
result.Errors.First().PropertyName.ShouldEqual("Assistant.Surname");
}
[Test]
public void Chained_validator_descriptor() {
var descriptor = validator.CreateDescriptor();
var members = descriptor.GetMembersWithValidators().ToList();
members.Count.ShouldEqual(4);
members[0].Key.ShouldEqual("Forename");
members[1].Key.ShouldEqual("Address.Postcode");
members[2].Key.ShouldEqual("Address.Country.Name");
members[3].Key.ShouldEqual("Address.Line1");
}
public class DepartmentValidator : AbstractValidator<Department> {
public DepartmentValidator() {
CascadeMode = CascadeMode.StopOnFirstFailure; ;
RuleFor(x => x.Manager).NotNull();
RuleFor(x => x.Assistant.Surname).NotEqual(x => x.Manager.Surname).When(x => x.Assistant != null && x.Manager.Surname != null);
}
}
public class PersonValidator : AbstractValidator<Person> {
public PersonValidator() {
RuleFor(x => x.Forename).NotNull();
When(x => x.Address != null, () => {
RuleFor(x => x.Address.Postcode).NotNull();
RuleFor(x => x.Address.Country.Name).NotNull().When(x => x.Address.Country != null);
RuleFor(x => x.Address.Line1).NotNull().When(x => x.Address.Line2 != null);
});
}
}
public class Department {
public Person Manager { get; set; }
public Person Assistant { get; set; }
public IList<Person> Employees { get; set; }
}
}
} | 31.984293 | 132 | 0.680471 | [
"Apache-2.0"
] | Rocketmakers/FluentValidation | src/FluentValidation.Tests/ChainedValidationTester.cs | 6,111 | C# |
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System.Security.Claims;
using ITfoxtec.Identity.Saml2;
using Microsoft.Extensions.Options;
using ITfoxtec.Identity;
using System.Threading.Tasks;
namespace AspNetCoreSamlSample.Controllers
{
public class HomeController : Controller
{
private readonly Saml2Configuration saml2Config;
public HomeController(IOptionsMonitor<Saml2Configuration> configAccessor)
{
saml2Config = configAccessor.CurrentValue;
}
public async Task<IActionResult> Index()
{
ViewBag.PublicCertificate = (await saml2Config.SigningCertificate.ToMSJsonWebKeyAsync()).ToJsonIndented();
return View();
}
[Authorize]
public IActionResult Secure()
{
// The NameIdentifier
var nameIdentifier = User.Claims.Where(c => c.Type == ClaimTypes.NameIdentifier).Select(c => c.Value).Single();
return View();
}
public IActionResult Error()
{
return View();
}
}
}
| 26.348837 | 123 | 0.653133 | [
"Apache-2.0"
] | ITfoxtec/FoxIDs.Samples | src/AspNetCoreSamlSample/Controllers/HomeController.cs | 1,135 | C# |
using System;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
#if OPENGL_ES
using OpenTK.Graphics.ES20;
using PixelFormat = OpenTK.Graphics.ES20.PixelFormat;
#else
using OpenTK.Graphics.OpenGL4;
#endif
namespace QuickFont
{
/// <summary>
/// Represents a texture page
/// </summary>
class TexturePage : IDisposable
{
private int _textureID;
/// <summary>
/// The texture ID of this texture page
/// </summary>
public int TextureID
{
get { return _textureID; }
}
/// <summary>
/// The width of this texture page
/// </summary>
public int Width { get; private set; }
/// <summary>
/// The height of this textur page
/// </summary>
public int Height { get; private set; }
/// <summary>
/// Creates a new instance of <see cref="TexturePage"/>
/// </summary>
/// <param name="filePath">The filepath to load as a bitmap</param>
public TexturePage(string filePath)
{
var bitmap = new QBitmap(filePath);
CreateTexture(bitmap.BitmapData);
bitmap.Free();
}
/// <summary>
/// Creates a new instance of <see cref="TexturePage"/>
/// </summary>
/// <param name="dataSource">The bitmap to use as a data source</param>
public TexturePage(BitmapData dataSource)
{
CreateTexture(dataSource);
}
/// <summary>
/// Creates an OpenGL texture
/// </summary>
/// <param name="dataSource">The data source to use for the texture</param>
private void CreateTexture(BitmapData dataSource)
{
Width = dataSource.Width;
Height = dataSource.Height;
Helper.SafeGLEnable(EnableCap.Texture2D, () =>
{
GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
GL.GenTextures(1, out _textureID);
GL.BindTexture(TextureTarget.Texture2D, TextureID);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.ClampToBorder);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.ClampToBorder);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
#if OPENGL_ES
var rawData = ConvertBgraToRgba(dataSource);
GL.TexImage2D(TextureTarget2d.Texture2D, 0, TextureComponentCount.Rgba, Width, Height, 0,
PixelFormat.Rgba, PixelType.UnsignedByte, rawData);
GL.GenerateMipmap(TextureTarget.Texture2D);
#else
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, Width, Height, 0,
OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, dataSource.Scan0);
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
#endif
});
}
/// <summary>
/// Converts a BGRA bitmap to RGBA
/// </summary>
/// <param name="dataSource">The bitmap to convert</param>
/// <returns>The converted bitmap bytes</returns>
private static byte[] ConvertBgraToRgba(BitmapData dataSource)
{
var length = dataSource.Stride*dataSource.Height;
var rawData = new byte[length];
// Copy bitmap to byte[]
Marshal.Copy(dataSource.Scan0, rawData, 0, length);
for (var i = 0; i < rawData.Length; i = i + 4)
{
var temp1 = rawData[i];
rawData[i] = rawData[i + 2];
rawData[i + 2] = temp1;
}
return rawData;
}
/// <summary>
/// Dispose resources owned by this instance
/// </summary>
public void Dispose()
{
GL.DeleteTexture(TextureID);
}
}
}
| 32.820313 | 128 | 0.584623 | [
"MIT"
] | HughPH/QuickFont | src/QuickFont.Shared/TexturePage.cs | 4,203 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Web.Razor.Parser;
using System.Web.Razor.Parser.SyntaxTree;
using System.Web.Razor.Resources;
using System.Web.Razor.Test.Framework;
using System.Web.Razor.Text;
using Xunit;
namespace System.Web.Razor.Test.Parser.CSharp
{
public class CSharpImplicitExpressionTest : CsHtmlCodeParserTestBase
{
private const string TestExtraKeyword = "model";
public override ParserBase CreateCodeParser()
{
return new CSharpCodeParser();
}
[Fact]
public void NestedImplicitExpression()
{
ParseBlockTest("if (true) { @foo }",
new StatementBlock(
Factory.Code("if (true) { ").AsStatement(),
new ExpressionBlock(
Factory.CodeTransition(),
Factory.Code("foo")
.AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: true)
.Accepts(AcceptedCharacters.NonWhiteSpace)),
Factory.Code(" }").AsStatement()));
}
[Fact]
public void ParseBlockAcceptsNonEnglishCharactersThatAreValidIdentifiers()
{
ImplicitExpressionTest("हळूँजद॔.", "हळूँजद॔");
}
[Fact]
public void ParseBlockOutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition()
{
ParseBlockTest("@/",
new ExpressionBlock(
Factory.CodeTransition(),
Factory.EmptyCSharp()
.AsImplicitExpression(KeywordSet)
.Accepts(AcceptedCharacters.NonWhiteSpace)),
new RazorError(
String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "/"),
new SourceLocation(1, 0, 1)));
}
[Fact]
public void ParseBlockOutputsZeroLengthCodeSpanIfEOFOccursAfterTransition()
{
ParseBlockTest("@",
new ExpressionBlock(
Factory.CodeTransition(),
Factory.EmptyCSharp()
.AsImplicitExpression(KeywordSet)
.Accepts(AcceptedCharacters.NonWhiteSpace)),
new RazorError(
RazorResources.ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock,
new SourceLocation(1, 0, 1)));
}
[Fact]
public void ParseBlockSupportsSlashesWithinComplexImplicitExpressions()
{
ImplicitExpressionTest("DataGridColumn.Template(\"Years of Service\", e => (int)Math.Round((DateTime.Now - dt).TotalDays / 365))");
}
[Fact]
public void ParseBlockMethodParsesSingleIdentifierAsImplicitExpression()
{
ImplicitExpressionTest("foo");
}
[Fact]
public void ParseBlockMethodDoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace()
{
ImplicitExpressionTest("foo ;", "foo");
}
[Fact]
public void ParseBlockMethodIgnoresSemicolonAtEndOfSimpleImplicitExpression()
{
RunTrailingSemicolonTest("foo");
}
[Fact]
public void ParseBlockMethodParsesDottedIdentifiersAsImplicitExpression()
{
ImplicitExpressionTest("foo.bar.baz");
}
[Fact]
public void ParseBlockMethodIgnoresSemicolonAtEndOfDottedIdentifiers()
{
RunTrailingSemicolonTest("foo.bar.baz");
}
[Fact]
public void ParseBlockMethodDoesNotIncludeDotAtEOFInImplicitExpression()
{
ImplicitExpressionTest("foo.bar.", "foo.bar");
}
[Fact]
public void ParseBlockMethodDoesNotIncludeDotFollowedByInvalidIdentifierCharacterInImplicitExpression()
{
ImplicitExpressionTest("foo.bar.0", "foo.bar");
ImplicitExpressionTest("foo.bar.</p>", "foo.bar");
}
[Fact]
public void ParseBlockMethodDoesNotIncludeSemicolonAfterDot()
{
ImplicitExpressionTest("foo.bar.;", "foo.bar");
}
[Fact]
public void ParseBlockMethodTerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpression()
{
ImplicitExpressionTest("foo.bar</p>", "foo.bar");
}
[Fact]
public void ParseBlockProperlyParsesParenthesesAndBalancesThemInImplicitExpression()
{
ImplicitExpressionTest(@"foo().bar(""bi\""z"", 4)(""chained method; call"").baz(@""bo""""z"", '\'', () => { return 4; }, (4+5+new { foo = bar[4] }))");
}
[Fact]
public void ParseBlockProperlyParsesBracketsAndBalancesThemInImplicitExpression()
{
ImplicitExpressionTest(@"foo.bar[4 * (8 + 7)][""fo\""o""].baz");
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionAtHtmlEndTag()
{
ImplicitExpressionTest("foo().bar.baz</p>zoop", "foo().bar.baz");
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionAtHtmlStartTag()
{
ImplicitExpressionTest("foo().bar.baz<p>zoop", "foo().bar.baz");
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionBeforeDotIfDotNotFollowedByIdentifierStartCharacter()
{
ImplicitExpressionTest("foo().bar.baz.42", "foo().bar.baz");
}
[Fact]
public void ParseBlockStopsBalancingParenthesesAtEOF()
{
ImplicitExpressionTest("foo(()", "foo(()",
acceptedCharacters: AcceptedCharacters.Any,
errors: new RazorError(String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, "(", ")"), new SourceLocation(4, 0, 4)));
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace()
{
ImplicitExpressionTest("foo.bar() (baz)", "foo.bar()");
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace()
{
ImplicitExpressionTest("foo .bar() (baz)", "foo");
}
[Fact]
public void ParseBlockTerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace()
{
ImplicitExpressionTest("foo. bar() (baz)", "foo");
}
[Fact]
public void ParseBlockOutputExpressionIfModuleTokenNotFollowedByBrace()
{
ImplicitExpressionTest("module.foo()");
}
private void RunTrailingSemicolonTest(string expr)
{
ParseBlockTest(SyntaxConstants.TransitionString + expr + ";",
new ExpressionBlock(
Factory.CodeTransition(),
Factory.Code(expr)
.AsImplicitExpression(KeywordSet)
.Accepts(AcceptedCharacters.NonWhiteSpace)
));
}
}
}
| 36.955882 | 173 | 0.565327 | [
"Apache-2.0"
] | Distrotech/mono | external/aspnetwebstack/test/System.Web.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs | 7,569 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the servicecatalog-2015-12-10.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Runtime;
using Amazon.ServiceCatalog.Model;
namespace Amazon.ServiceCatalog
{
/// <summary>
/// Interface for accessing ServiceCatalog
///
/// AWS Service Catalog
/// <para>
/// <a href="https://aws.amazon.com/servicecatalog/">AWS Service Catalog</a> enables
/// organizations to create and manage catalogs of IT services that are approved for use
/// on AWS. To get the most out of this documentation, you should be familiar with the
/// terminology discussed in <a href="http://docs.aws.amazon.com/servicecatalog/latest/adminguide/what-is_concepts.html">AWS
/// Service Catalog Concepts</a>.
/// </para>
/// </summary>
public partial interface IAmazonServiceCatalog : IAmazonService, IDisposable
{
#region AcceptPortfolioShare
/// <summary>
/// Accepts an offer to share the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AcceptPortfolioShare service method.</param>
///
/// <returns>The response from the AcceptPortfolioShare service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AcceptPortfolioShare">REST API Reference for AcceptPortfolioShare Operation</seealso>
AcceptPortfolioShareResponse AcceptPortfolioShare(AcceptPortfolioShareRequest request);
/// <summary>
/// Initiates the asynchronous execution of the AcceptPortfolioShare operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AcceptPortfolioShare operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAcceptPortfolioShare
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AcceptPortfolioShare">REST API Reference for AcceptPortfolioShare Operation</seealso>
IAsyncResult BeginAcceptPortfolioShare(AcceptPortfolioShareRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the AcceptPortfolioShare operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAcceptPortfolioShare.</param>
///
/// <returns>Returns a AcceptPortfolioShareResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AcceptPortfolioShare">REST API Reference for AcceptPortfolioShare Operation</seealso>
AcceptPortfolioShareResponse EndAcceptPortfolioShare(IAsyncResult asyncResult);
#endregion
#region AssociatePrincipalWithPortfolio
/// <summary>
/// Associates the specified principal ARN with the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AssociatePrincipalWithPortfolio service method.</param>
///
/// <returns>The response from the AssociatePrincipalWithPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociatePrincipalWithPortfolio">REST API Reference for AssociatePrincipalWithPortfolio Operation</seealso>
AssociatePrincipalWithPortfolioResponse AssociatePrincipalWithPortfolio(AssociatePrincipalWithPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the AssociatePrincipalWithPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AssociatePrincipalWithPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociatePrincipalWithPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociatePrincipalWithPortfolio">REST API Reference for AssociatePrincipalWithPortfolio Operation</seealso>
IAsyncResult BeginAssociatePrincipalWithPortfolio(AssociatePrincipalWithPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the AssociatePrincipalWithPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociatePrincipalWithPortfolio.</param>
///
/// <returns>Returns a AssociatePrincipalWithPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociatePrincipalWithPortfolio">REST API Reference for AssociatePrincipalWithPortfolio Operation</seealso>
AssociatePrincipalWithPortfolioResponse EndAssociatePrincipalWithPortfolio(IAsyncResult asyncResult);
#endregion
#region AssociateProductWithPortfolio
/// <summary>
/// Associates the specified product with the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AssociateProductWithPortfolio service method.</param>
///
/// <returns>The response from the AssociateProductWithPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateProductWithPortfolio">REST API Reference for AssociateProductWithPortfolio Operation</seealso>
AssociateProductWithPortfolioResponse AssociateProductWithPortfolio(AssociateProductWithPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the AssociateProductWithPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AssociateProductWithPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateProductWithPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateProductWithPortfolio">REST API Reference for AssociateProductWithPortfolio Operation</seealso>
IAsyncResult BeginAssociateProductWithPortfolio(AssociateProductWithPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the AssociateProductWithPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateProductWithPortfolio.</param>
///
/// <returns>Returns a AssociateProductWithPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateProductWithPortfolio">REST API Reference for AssociateProductWithPortfolio Operation</seealso>
AssociateProductWithPortfolioResponse EndAssociateProductWithPortfolio(IAsyncResult asyncResult);
#endregion
#region AssociateServiceActionWithProvisioningArtifact
/// <summary>
/// Associates a self-service action with a provisioning artifact.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AssociateServiceActionWithProvisioningArtifact service method.</param>
///
/// <returns>The response from the AssociateServiceActionWithProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateServiceActionWithProvisioningArtifact">REST API Reference for AssociateServiceActionWithProvisioningArtifact Operation</seealso>
AssociateServiceActionWithProvisioningArtifactResponse AssociateServiceActionWithProvisioningArtifact(AssociateServiceActionWithProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the AssociateServiceActionWithProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AssociateServiceActionWithProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateServiceActionWithProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateServiceActionWithProvisioningArtifact">REST API Reference for AssociateServiceActionWithProvisioningArtifact Operation</seealso>
IAsyncResult BeginAssociateServiceActionWithProvisioningArtifact(AssociateServiceActionWithProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the AssociateServiceActionWithProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateServiceActionWithProvisioningArtifact.</param>
///
/// <returns>Returns a AssociateServiceActionWithProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateServiceActionWithProvisioningArtifact">REST API Reference for AssociateServiceActionWithProvisioningArtifact Operation</seealso>
AssociateServiceActionWithProvisioningArtifactResponse EndAssociateServiceActionWithProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region AssociateTagOptionWithResource
/// <summary>
/// Associate the specified TagOption with the specified portfolio or product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AssociateTagOptionWithResource service method.</param>
///
/// <returns>The response from the AssociateTagOptionWithResource service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidStateException">
/// An attempt was made to modify a resource that is in a state that is not valid. Check
/// your resources to ensure that they are in valid states before retrying the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateTagOptionWithResource">REST API Reference for AssociateTagOptionWithResource Operation</seealso>
AssociateTagOptionWithResourceResponse AssociateTagOptionWithResource(AssociateTagOptionWithResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the AssociateTagOptionWithResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AssociateTagOptionWithResource operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateTagOptionWithResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateTagOptionWithResource">REST API Reference for AssociateTagOptionWithResource Operation</seealso>
IAsyncResult BeginAssociateTagOptionWithResource(AssociateTagOptionWithResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the AssociateTagOptionWithResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateTagOptionWithResource.</param>
///
/// <returns>Returns a AssociateTagOptionWithResourceResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateTagOptionWithResource">REST API Reference for AssociateTagOptionWithResource Operation</seealso>
AssociateTagOptionWithResourceResponse EndAssociateTagOptionWithResource(IAsyncResult asyncResult);
#endregion
#region BatchAssociateServiceActionWithProvisioningArtifact
/// <summary>
/// Associates multiple self-service actions with provisioning artifacts.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchAssociateServiceActionWithProvisioningArtifact service method.</param>
///
/// <returns>The response from the BatchAssociateServiceActionWithProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchAssociateServiceActionWithProvisioningArtifact">REST API Reference for BatchAssociateServiceActionWithProvisioningArtifact Operation</seealso>
BatchAssociateServiceActionWithProvisioningArtifactResponse BatchAssociateServiceActionWithProvisioningArtifact(BatchAssociateServiceActionWithProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchAssociateServiceActionWithProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchAssociateServiceActionWithProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchAssociateServiceActionWithProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchAssociateServiceActionWithProvisioningArtifact">REST API Reference for BatchAssociateServiceActionWithProvisioningArtifact Operation</seealso>
IAsyncResult BeginBatchAssociateServiceActionWithProvisioningArtifact(BatchAssociateServiceActionWithProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchAssociateServiceActionWithProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchAssociateServiceActionWithProvisioningArtifact.</param>
///
/// <returns>Returns a BatchAssociateServiceActionWithProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchAssociateServiceActionWithProvisioningArtifact">REST API Reference for BatchAssociateServiceActionWithProvisioningArtifact Operation</seealso>
BatchAssociateServiceActionWithProvisioningArtifactResponse EndBatchAssociateServiceActionWithProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region BatchDisassociateServiceActionFromProvisioningArtifact
/// <summary>
/// Disassociates a batch of self-service actions from the specified provisioning artifact.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchDisassociateServiceActionFromProvisioningArtifact service method.</param>
///
/// <returns>The response from the BatchDisassociateServiceActionFromProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchDisassociateServiceActionFromProvisioningArtifact">REST API Reference for BatchDisassociateServiceActionFromProvisioningArtifact Operation</seealso>
BatchDisassociateServiceActionFromProvisioningArtifactResponse BatchDisassociateServiceActionFromProvisioningArtifact(BatchDisassociateServiceActionFromProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchDisassociateServiceActionFromProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchDisassociateServiceActionFromProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchDisassociateServiceActionFromProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchDisassociateServiceActionFromProvisioningArtifact">REST API Reference for BatchDisassociateServiceActionFromProvisioningArtifact Operation</seealso>
IAsyncResult BeginBatchDisassociateServiceActionFromProvisioningArtifact(BatchDisassociateServiceActionFromProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchDisassociateServiceActionFromProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchDisassociateServiceActionFromProvisioningArtifact.</param>
///
/// <returns>Returns a BatchDisassociateServiceActionFromProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchDisassociateServiceActionFromProvisioningArtifact">REST API Reference for BatchDisassociateServiceActionFromProvisioningArtifact Operation</seealso>
BatchDisassociateServiceActionFromProvisioningArtifactResponse EndBatchDisassociateServiceActionFromProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region CopyProduct
/// <summary>
/// Copies the specified source product to the specified target product or a new product.
///
///
/// <para>
/// You can copy a product to the same account or another account. You can copy a product
/// to the same region or another region.
/// </para>
///
/// <para>
/// This operation is performed asynchronously. To track the progress of the operation,
/// use <a>DescribeCopyProductStatus</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CopyProduct service method.</param>
///
/// <returns>The response from the CopyProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CopyProduct">REST API Reference for CopyProduct Operation</seealso>
CopyProductResponse CopyProduct(CopyProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CopyProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CopyProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCopyProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CopyProduct">REST API Reference for CopyProduct Operation</seealso>
IAsyncResult BeginCopyProduct(CopyProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CopyProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCopyProduct.</param>
///
/// <returns>Returns a CopyProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CopyProduct">REST API Reference for CopyProduct Operation</seealso>
CopyProductResponse EndCopyProduct(IAsyncResult asyncResult);
#endregion
#region CreateConstraint
/// <summary>
/// Creates a constraint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateConstraint service method.</param>
///
/// <returns>The response from the CreateConstraint service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateConstraint">REST API Reference for CreateConstraint Operation</seealso>
CreateConstraintResponse CreateConstraint(CreateConstraintRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateConstraint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateConstraint operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateConstraint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateConstraint">REST API Reference for CreateConstraint Operation</seealso>
IAsyncResult BeginCreateConstraint(CreateConstraintRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateConstraint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateConstraint.</param>
///
/// <returns>Returns a CreateConstraintResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateConstraint">REST API Reference for CreateConstraint Operation</seealso>
CreateConstraintResponse EndCreateConstraint(IAsyncResult asyncResult);
#endregion
#region CreatePortfolio
/// <summary>
/// Creates a portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreatePortfolio service method.</param>
///
/// <returns>The response from the CreatePortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolio">REST API Reference for CreatePortfolio Operation</seealso>
CreatePortfolioResponse CreatePortfolio(CreatePortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreatePortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreatePortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreatePortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolio">REST API Reference for CreatePortfolio Operation</seealso>
IAsyncResult BeginCreatePortfolio(CreatePortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreatePortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreatePortfolio.</param>
///
/// <returns>Returns a CreatePortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolio">REST API Reference for CreatePortfolio Operation</seealso>
CreatePortfolioResponse EndCreatePortfolio(IAsyncResult asyncResult);
#endregion
#region CreatePortfolioShare
/// <summary>
/// Shares the specified portfolio with the specified account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreatePortfolioShare service method.</param>
///
/// <returns>The response from the CreatePortfolioShare service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolioShare">REST API Reference for CreatePortfolioShare Operation</seealso>
CreatePortfolioShareResponse CreatePortfolioShare(CreatePortfolioShareRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreatePortfolioShare operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreatePortfolioShare operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreatePortfolioShare
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolioShare">REST API Reference for CreatePortfolioShare Operation</seealso>
IAsyncResult BeginCreatePortfolioShare(CreatePortfolioShareRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreatePortfolioShare operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreatePortfolioShare.</param>
///
/// <returns>Returns a CreatePortfolioShareResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreatePortfolioShare">REST API Reference for CreatePortfolioShare Operation</seealso>
CreatePortfolioShareResponse EndCreatePortfolioShare(IAsyncResult asyncResult);
#endregion
#region CreateProduct
/// <summary>
/// Creates a product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateProduct service method.</param>
///
/// <returns>The response from the CreateProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProduct">REST API Reference for CreateProduct Operation</seealso>
CreateProductResponse CreateProduct(CreateProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProduct">REST API Reference for CreateProduct Operation</seealso>
IAsyncResult BeginCreateProduct(CreateProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateProduct.</param>
///
/// <returns>Returns a CreateProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProduct">REST API Reference for CreateProduct Operation</seealso>
CreateProductResponse EndCreateProduct(IAsyncResult asyncResult);
#endregion
#region CreateProvisionedProductPlan
/// <summary>
/// Creates a plan. A plan includes the list of resources to be created (when provisioning
/// a new product) or modified (when updating a provisioned product) when the plan is
/// executed.
///
///
/// <para>
/// You can create one plan per provisioned product. To create a plan for an existing
/// provisioned product, the product status must be AVAILBLE or TAINTED.
/// </para>
///
/// <para>
/// To view the resource changes in the change set, use <a>DescribeProvisionedProductPlan</a>.
/// To create or modify the provisioned product, use <a>ExecuteProvisionedProductPlan</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateProvisionedProductPlan service method.</param>
///
/// <returns>The response from the CreateProvisionedProductPlan service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidStateException">
/// An attempt was made to modify a resource that is in a state that is not valid. Check
/// your resources to ensure that they are in valid states before retrying the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisionedProductPlan">REST API Reference for CreateProvisionedProductPlan Operation</seealso>
CreateProvisionedProductPlanResponse CreateProvisionedProductPlan(CreateProvisionedProductPlanRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateProvisionedProductPlan operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateProvisionedProductPlan operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateProvisionedProductPlan
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisionedProductPlan">REST API Reference for CreateProvisionedProductPlan Operation</seealso>
IAsyncResult BeginCreateProvisionedProductPlan(CreateProvisionedProductPlanRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateProvisionedProductPlan operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateProvisionedProductPlan.</param>
///
/// <returns>Returns a CreateProvisionedProductPlanResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisionedProductPlan">REST API Reference for CreateProvisionedProductPlan Operation</seealso>
CreateProvisionedProductPlanResponse EndCreateProvisionedProductPlan(IAsyncResult asyncResult);
#endregion
#region CreateProvisioningArtifact
/// <summary>
/// Creates a provisioning artifact (also known as a version) for the specified product.
///
///
/// <para>
/// You cannot create a provisioning artifact for a product that was shared with you.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateProvisioningArtifact service method.</param>
///
/// <returns>The response from the CreateProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisioningArtifact">REST API Reference for CreateProvisioningArtifact Operation</seealso>
CreateProvisioningArtifactResponse CreateProvisioningArtifact(CreateProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisioningArtifact">REST API Reference for CreateProvisioningArtifact Operation</seealso>
IAsyncResult BeginCreateProvisioningArtifact(CreateProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateProvisioningArtifact.</param>
///
/// <returns>Returns a CreateProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateProvisioningArtifact">REST API Reference for CreateProvisioningArtifact Operation</seealso>
CreateProvisioningArtifactResponse EndCreateProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region CreateServiceAction
/// <summary>
/// Creates a self-service action.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateServiceAction service method.</param>
///
/// <returns>The response from the CreateServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateServiceAction">REST API Reference for CreateServiceAction Operation</seealso>
CreateServiceActionResponse CreateServiceAction(CreateServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateServiceAction">REST API Reference for CreateServiceAction Operation</seealso>
IAsyncResult BeginCreateServiceAction(CreateServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateServiceAction.</param>
///
/// <returns>Returns a CreateServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateServiceAction">REST API Reference for CreateServiceAction Operation</seealso>
CreateServiceActionResponse EndCreateServiceAction(IAsyncResult asyncResult);
#endregion
#region CreateTagOption
/// <summary>
/// Creates a TagOption.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateTagOption service method.</param>
///
/// <returns>The response from the CreateTagOption service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateTagOption">REST API Reference for CreateTagOption Operation</seealso>
CreateTagOptionResponse CreateTagOption(CreateTagOptionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateTagOption operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateTagOption operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateTagOption
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateTagOption">REST API Reference for CreateTagOption Operation</seealso>
IAsyncResult BeginCreateTagOption(CreateTagOptionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateTagOption operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateTagOption.</param>
///
/// <returns>Returns a CreateTagOptionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateTagOption">REST API Reference for CreateTagOption Operation</seealso>
CreateTagOptionResponse EndCreateTagOption(IAsyncResult asyncResult);
#endregion
#region DeleteConstraint
/// <summary>
/// Deletes the specified constraint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteConstraint service method.</param>
///
/// <returns>The response from the DeleteConstraint service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteConstraint">REST API Reference for DeleteConstraint Operation</seealso>
DeleteConstraintResponse DeleteConstraint(DeleteConstraintRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteConstraint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteConstraint operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteConstraint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteConstraint">REST API Reference for DeleteConstraint Operation</seealso>
IAsyncResult BeginDeleteConstraint(DeleteConstraintRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteConstraint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteConstraint.</param>
///
/// <returns>Returns a DeleteConstraintResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteConstraint">REST API Reference for DeleteConstraint Operation</seealso>
DeleteConstraintResponse EndDeleteConstraint(IAsyncResult asyncResult);
#endregion
#region DeletePortfolio
/// <summary>
/// Deletes the specified portfolio.
///
///
/// <para>
/// You cannot delete a portfolio if it was shared with you or if it has associated products,
/// users, constraints, or shared accounts.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeletePortfolio service method.</param>
///
/// <returns>The response from the DeletePortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolio">REST API Reference for DeletePortfolio Operation</seealso>
DeletePortfolioResponse DeletePortfolio(DeletePortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeletePortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeletePortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeletePortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolio">REST API Reference for DeletePortfolio Operation</seealso>
IAsyncResult BeginDeletePortfolio(DeletePortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeletePortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeletePortfolio.</param>
///
/// <returns>Returns a DeletePortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolio">REST API Reference for DeletePortfolio Operation</seealso>
DeletePortfolioResponse EndDeletePortfolio(IAsyncResult asyncResult);
#endregion
#region DeletePortfolioShare
/// <summary>
/// Stops sharing the specified portfolio with the specified account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeletePortfolioShare service method.</param>
///
/// <returns>The response from the DeletePortfolioShare service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolioShare">REST API Reference for DeletePortfolioShare Operation</seealso>
DeletePortfolioShareResponse DeletePortfolioShare(DeletePortfolioShareRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeletePortfolioShare operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeletePortfolioShare operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeletePortfolioShare
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolioShare">REST API Reference for DeletePortfolioShare Operation</seealso>
IAsyncResult BeginDeletePortfolioShare(DeletePortfolioShareRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeletePortfolioShare operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeletePortfolioShare.</param>
///
/// <returns>Returns a DeletePortfolioShareResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeletePortfolioShare">REST API Reference for DeletePortfolioShare Operation</seealso>
DeletePortfolioShareResponse EndDeletePortfolioShare(IAsyncResult asyncResult);
#endregion
#region DeleteProduct
/// <summary>
/// Deletes the specified product.
///
///
/// <para>
/// You cannot delete a product if it was shared with you or is associated with a portfolio.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteProduct service method.</param>
///
/// <returns>The response from the DeleteProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProduct">REST API Reference for DeleteProduct Operation</seealso>
DeleteProductResponse DeleteProduct(DeleteProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProduct">REST API Reference for DeleteProduct Operation</seealso>
IAsyncResult BeginDeleteProduct(DeleteProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteProduct.</param>
///
/// <returns>Returns a DeleteProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProduct">REST API Reference for DeleteProduct Operation</seealso>
DeleteProductResponse EndDeleteProduct(IAsyncResult asyncResult);
#endregion
#region DeleteProvisionedProductPlan
/// <summary>
/// Deletes the specified plan.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteProvisionedProductPlan service method.</param>
///
/// <returns>The response from the DeleteProvisionedProductPlan service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisionedProductPlan">REST API Reference for DeleteProvisionedProductPlan Operation</seealso>
DeleteProvisionedProductPlanResponse DeleteProvisionedProductPlan(DeleteProvisionedProductPlanRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteProvisionedProductPlan operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteProvisionedProductPlan operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteProvisionedProductPlan
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisionedProductPlan">REST API Reference for DeleteProvisionedProductPlan Operation</seealso>
IAsyncResult BeginDeleteProvisionedProductPlan(DeleteProvisionedProductPlanRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteProvisionedProductPlan operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteProvisionedProductPlan.</param>
///
/// <returns>Returns a DeleteProvisionedProductPlanResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisionedProductPlan">REST API Reference for DeleteProvisionedProductPlan Operation</seealso>
DeleteProvisionedProductPlanResponse EndDeleteProvisionedProductPlan(IAsyncResult asyncResult);
#endregion
#region DeleteProvisioningArtifact
/// <summary>
/// Deletes the specified provisioning artifact (also known as a version) for the specified
/// product.
///
///
/// <para>
/// You cannot delete a provisioning artifact associated with a product that was shared
/// with you. You cannot delete the last provisioning artifact for a product, because
/// a product must have at least one provisioning artifact.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningArtifact service method.</param>
///
/// <returns>The response from the DeleteProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisioningArtifact">REST API Reference for DeleteProvisioningArtifact Operation</seealso>
DeleteProvisioningArtifactResponse DeleteProvisioningArtifact(DeleteProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisioningArtifact">REST API Reference for DeleteProvisioningArtifact Operation</seealso>
IAsyncResult BeginDeleteProvisioningArtifact(DeleteProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteProvisioningArtifact.</param>
///
/// <returns>Returns a DeleteProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisioningArtifact">REST API Reference for DeleteProvisioningArtifact Operation</seealso>
DeleteProvisioningArtifactResponse EndDeleteProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region DeleteServiceAction
/// <summary>
/// Deletes a self-service action.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteServiceAction service method.</param>
///
/// <returns>The response from the DeleteServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteServiceAction">REST API Reference for DeleteServiceAction Operation</seealso>
DeleteServiceActionResponse DeleteServiceAction(DeleteServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteServiceAction">REST API Reference for DeleteServiceAction Operation</seealso>
IAsyncResult BeginDeleteServiceAction(DeleteServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteServiceAction.</param>
///
/// <returns>Returns a DeleteServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteServiceAction">REST API Reference for DeleteServiceAction Operation</seealso>
DeleteServiceActionResponse EndDeleteServiceAction(IAsyncResult asyncResult);
#endregion
#region DeleteTagOption
/// <summary>
/// Deletes the specified TagOption.
///
///
/// <para>
/// You cannot delete a TagOption if it is associated with a product or portfolio.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteTagOption service method.</param>
///
/// <returns>The response from the DeleteTagOption service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteTagOption">REST API Reference for DeleteTagOption Operation</seealso>
DeleteTagOptionResponse DeleteTagOption(DeleteTagOptionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteTagOption operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteTagOption operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteTagOption
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteTagOption">REST API Reference for DeleteTagOption Operation</seealso>
IAsyncResult BeginDeleteTagOption(DeleteTagOptionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteTagOption operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteTagOption.</param>
///
/// <returns>Returns a DeleteTagOptionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteTagOption">REST API Reference for DeleteTagOption Operation</seealso>
DeleteTagOptionResponse EndDeleteTagOption(IAsyncResult asyncResult);
#endregion
#region DescribeConstraint
/// <summary>
/// Gets information about the specified constraint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeConstraint service method.</param>
///
/// <returns>The response from the DescribeConstraint service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeConstraint">REST API Reference for DescribeConstraint Operation</seealso>
DescribeConstraintResponse DescribeConstraint(DescribeConstraintRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeConstraint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeConstraint operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeConstraint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeConstraint">REST API Reference for DescribeConstraint Operation</seealso>
IAsyncResult BeginDescribeConstraint(DescribeConstraintRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeConstraint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeConstraint.</param>
///
/// <returns>Returns a DescribeConstraintResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeConstraint">REST API Reference for DescribeConstraint Operation</seealso>
DescribeConstraintResponse EndDescribeConstraint(IAsyncResult asyncResult);
#endregion
#region DescribeCopyProductStatus
/// <summary>
/// Gets the status of the specified copy product operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeCopyProductStatus service method.</param>
///
/// <returns>The response from the DescribeCopyProductStatus service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeCopyProductStatus">REST API Reference for DescribeCopyProductStatus Operation</seealso>
DescribeCopyProductStatusResponse DescribeCopyProductStatus(DescribeCopyProductStatusRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeCopyProductStatus operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeCopyProductStatus operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeCopyProductStatus
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeCopyProductStatus">REST API Reference for DescribeCopyProductStatus Operation</seealso>
IAsyncResult BeginDescribeCopyProductStatus(DescribeCopyProductStatusRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeCopyProductStatus operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeCopyProductStatus.</param>
///
/// <returns>Returns a DescribeCopyProductStatusResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeCopyProductStatus">REST API Reference for DescribeCopyProductStatus Operation</seealso>
DescribeCopyProductStatusResponse EndDescribeCopyProductStatus(IAsyncResult asyncResult);
#endregion
#region DescribePortfolio
/// <summary>
/// Gets information about the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribePortfolio service method.</param>
///
/// <returns>The response from the DescribePortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribePortfolio">REST API Reference for DescribePortfolio Operation</seealso>
DescribePortfolioResponse DescribePortfolio(DescribePortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribePortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribePortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribePortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribePortfolio">REST API Reference for DescribePortfolio Operation</seealso>
IAsyncResult BeginDescribePortfolio(DescribePortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribePortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribePortfolio.</param>
///
/// <returns>Returns a DescribePortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribePortfolio">REST API Reference for DescribePortfolio Operation</seealso>
DescribePortfolioResponse EndDescribePortfolio(IAsyncResult asyncResult);
#endregion
#region DescribeProduct
/// <summary>
/// Gets information about the specified product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProduct service method.</param>
///
/// <returns>The response from the DescribeProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProduct">REST API Reference for DescribeProduct Operation</seealso>
DescribeProductResponse DescribeProduct(DescribeProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProduct">REST API Reference for DescribeProduct Operation</seealso>
IAsyncResult BeginDescribeProduct(DescribeProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProduct.</param>
///
/// <returns>Returns a DescribeProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProduct">REST API Reference for DescribeProduct Operation</seealso>
DescribeProductResponse EndDescribeProduct(IAsyncResult asyncResult);
#endregion
#region DescribeProductAsAdmin
/// <summary>
/// Gets information about the specified product. This operation is run with administrator
/// access.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProductAsAdmin service method.</param>
///
/// <returns>The response from the DescribeProductAsAdmin service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductAsAdmin">REST API Reference for DescribeProductAsAdmin Operation</seealso>
DescribeProductAsAdminResponse DescribeProductAsAdmin(DescribeProductAsAdminRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProductAsAdmin operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProductAsAdmin operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProductAsAdmin
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductAsAdmin">REST API Reference for DescribeProductAsAdmin Operation</seealso>
IAsyncResult BeginDescribeProductAsAdmin(DescribeProductAsAdminRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProductAsAdmin operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProductAsAdmin.</param>
///
/// <returns>Returns a DescribeProductAsAdminResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductAsAdmin">REST API Reference for DescribeProductAsAdmin Operation</seealso>
DescribeProductAsAdminResponse EndDescribeProductAsAdmin(IAsyncResult asyncResult);
#endregion
#region DescribeProductView
/// <summary>
/// Gets information about the specified product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProductView service method.</param>
///
/// <returns>The response from the DescribeProductView service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductView">REST API Reference for DescribeProductView Operation</seealso>
DescribeProductViewResponse DescribeProductView(DescribeProductViewRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProductView operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProductView operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProductView
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductView">REST API Reference for DescribeProductView Operation</seealso>
IAsyncResult BeginDescribeProductView(DescribeProductViewRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProductView operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProductView.</param>
///
/// <returns>Returns a DescribeProductViewResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductView">REST API Reference for DescribeProductView Operation</seealso>
DescribeProductViewResponse EndDescribeProductView(IAsyncResult asyncResult);
#endregion
#region DescribeProvisionedProduct
/// <summary>
/// Gets information about the specified provisioned product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisionedProduct service method.</param>
///
/// <returns>The response from the DescribeProvisionedProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProduct">REST API Reference for DescribeProvisionedProduct Operation</seealso>
DescribeProvisionedProductResponse DescribeProvisionedProduct(DescribeProvisionedProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProvisionedProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisionedProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProvisionedProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProduct">REST API Reference for DescribeProvisionedProduct Operation</seealso>
IAsyncResult BeginDescribeProvisionedProduct(DescribeProvisionedProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProvisionedProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProvisionedProduct.</param>
///
/// <returns>Returns a DescribeProvisionedProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProduct">REST API Reference for DescribeProvisionedProduct Operation</seealso>
DescribeProvisionedProductResponse EndDescribeProvisionedProduct(IAsyncResult asyncResult);
#endregion
#region DescribeProvisionedProductPlan
/// <summary>
/// Gets information about the resource changes for the specified plan.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisionedProductPlan service method.</param>
///
/// <returns>The response from the DescribeProvisionedProductPlan service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProductPlan">REST API Reference for DescribeProvisionedProductPlan Operation</seealso>
DescribeProvisionedProductPlanResponse DescribeProvisionedProductPlan(DescribeProvisionedProductPlanRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProvisionedProductPlan operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisionedProductPlan operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProvisionedProductPlan
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProductPlan">REST API Reference for DescribeProvisionedProductPlan Operation</seealso>
IAsyncResult BeginDescribeProvisionedProductPlan(DescribeProvisionedProductPlanRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProvisionedProductPlan operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProvisionedProductPlan.</param>
///
/// <returns>Returns a DescribeProvisionedProductPlanResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProductPlan">REST API Reference for DescribeProvisionedProductPlan Operation</seealso>
DescribeProvisionedProductPlanResponse EndDescribeProvisionedProductPlan(IAsyncResult asyncResult);
#endregion
#region DescribeProvisioningArtifact
/// <summary>
/// Gets information about the specified provisioning artifact (also known as a version)
/// for the specified product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningArtifact service method.</param>
///
/// <returns>The response from the DescribeProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningArtifact">REST API Reference for DescribeProvisioningArtifact Operation</seealso>
DescribeProvisioningArtifactResponse DescribeProvisioningArtifact(DescribeProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningArtifact">REST API Reference for DescribeProvisioningArtifact Operation</seealso>
IAsyncResult BeginDescribeProvisioningArtifact(DescribeProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProvisioningArtifact.</param>
///
/// <returns>Returns a DescribeProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningArtifact">REST API Reference for DescribeProvisioningArtifact Operation</seealso>
DescribeProvisioningArtifactResponse EndDescribeProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region DescribeProvisioningParameters
/// <summary>
/// Gets information about the configuration required to provision the specified product
/// using the specified provisioning artifact.
///
///
/// <para>
/// If the output contains a TagOption key with an empty list of values, there is a TagOption
/// conflict for that key. The end user cannot take action to fix the conflict, and launch
/// is not blocked. In subsequent calls to <a>ProvisionProduct</a>, do not include conflicted
/// TagOption keys as tags, or this causes the error "Parameter validation failed: Missing
/// required parameter in Tags[<i>N</i>]:<i>Value</i>". Tag the provisioned product with
/// the value <code>sc-tagoption-conflict-portfolioId-productId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningParameters service method.</param>
///
/// <returns>The response from the DescribeProvisioningParameters service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningParameters">REST API Reference for DescribeProvisioningParameters Operation</seealso>
DescribeProvisioningParametersResponse DescribeProvisioningParameters(DescribeProvisioningParametersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeProvisioningParameters operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningParameters operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeProvisioningParameters
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningParameters">REST API Reference for DescribeProvisioningParameters Operation</seealso>
IAsyncResult BeginDescribeProvisioningParameters(DescribeProvisioningParametersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeProvisioningParameters operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeProvisioningParameters.</param>
///
/// <returns>Returns a DescribeProvisioningParametersResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningParameters">REST API Reference for DescribeProvisioningParameters Operation</seealso>
DescribeProvisioningParametersResponse EndDescribeProvisioningParameters(IAsyncResult asyncResult);
#endregion
#region DescribeRecord
/// <summary>
/// Gets information about the specified request operation.
///
///
/// <para>
/// Use this operation after calling a request operation (for example, <a>ProvisionProduct</a>,
/// <a>TerminateProvisionedProduct</a>, or <a>UpdateProvisionedProduct</a>).
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeRecord service method.</param>
///
/// <returns>The response from the DescribeRecord service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeRecord">REST API Reference for DescribeRecord Operation</seealso>
DescribeRecordResponse DescribeRecord(DescribeRecordRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeRecord operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeRecord operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeRecord
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeRecord">REST API Reference for DescribeRecord Operation</seealso>
IAsyncResult BeginDescribeRecord(DescribeRecordRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeRecord operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeRecord.</param>
///
/// <returns>Returns a DescribeRecordResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeRecord">REST API Reference for DescribeRecord Operation</seealso>
DescribeRecordResponse EndDescribeRecord(IAsyncResult asyncResult);
#endregion
#region DescribeServiceAction
/// <summary>
/// Describes a self-service action.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeServiceAction service method.</param>
///
/// <returns>The response from the DescribeServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeServiceAction">REST API Reference for DescribeServiceAction Operation</seealso>
DescribeServiceActionResponse DescribeServiceAction(DescribeServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeServiceAction">REST API Reference for DescribeServiceAction Operation</seealso>
IAsyncResult BeginDescribeServiceAction(DescribeServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeServiceAction.</param>
///
/// <returns>Returns a DescribeServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeServiceAction">REST API Reference for DescribeServiceAction Operation</seealso>
DescribeServiceActionResponse EndDescribeServiceAction(IAsyncResult asyncResult);
#endregion
#region DescribeTagOption
/// <summary>
/// Gets information about the specified TagOption.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeTagOption service method.</param>
///
/// <returns>The response from the DescribeTagOption service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeTagOption">REST API Reference for DescribeTagOption Operation</seealso>
DescribeTagOptionResponse DescribeTagOption(DescribeTagOptionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DescribeTagOption operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeTagOption operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeTagOption
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeTagOption">REST API Reference for DescribeTagOption Operation</seealso>
IAsyncResult BeginDescribeTagOption(DescribeTagOptionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DescribeTagOption operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeTagOption.</param>
///
/// <returns>Returns a DescribeTagOptionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeTagOption">REST API Reference for DescribeTagOption Operation</seealso>
DescribeTagOptionResponse EndDescribeTagOption(IAsyncResult asyncResult);
#endregion
#region DisassociatePrincipalFromPortfolio
/// <summary>
/// Disassociates a previously associated principal ARN from a specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DisassociatePrincipalFromPortfolio service method.</param>
///
/// <returns>The response from the DisassociatePrincipalFromPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociatePrincipalFromPortfolio">REST API Reference for DisassociatePrincipalFromPortfolio Operation</seealso>
DisassociatePrincipalFromPortfolioResponse DisassociatePrincipalFromPortfolio(DisassociatePrincipalFromPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DisassociatePrincipalFromPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DisassociatePrincipalFromPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociatePrincipalFromPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociatePrincipalFromPortfolio">REST API Reference for DisassociatePrincipalFromPortfolio Operation</seealso>
IAsyncResult BeginDisassociatePrincipalFromPortfolio(DisassociatePrincipalFromPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DisassociatePrincipalFromPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociatePrincipalFromPortfolio.</param>
///
/// <returns>Returns a DisassociatePrincipalFromPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociatePrincipalFromPortfolio">REST API Reference for DisassociatePrincipalFromPortfolio Operation</seealso>
DisassociatePrincipalFromPortfolioResponse EndDisassociatePrincipalFromPortfolio(IAsyncResult asyncResult);
#endregion
#region DisassociateProductFromPortfolio
/// <summary>
/// Disassociates the specified product from the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DisassociateProductFromPortfolio service method.</param>
///
/// <returns>The response from the DisassociateProductFromPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceInUseException">
/// A resource that is currently in use. Ensure that the resource is not in use and retry
/// the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateProductFromPortfolio">REST API Reference for DisassociateProductFromPortfolio Operation</seealso>
DisassociateProductFromPortfolioResponse DisassociateProductFromPortfolio(DisassociateProductFromPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DisassociateProductFromPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DisassociateProductFromPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociateProductFromPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateProductFromPortfolio">REST API Reference for DisassociateProductFromPortfolio Operation</seealso>
IAsyncResult BeginDisassociateProductFromPortfolio(DisassociateProductFromPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DisassociateProductFromPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociateProductFromPortfolio.</param>
///
/// <returns>Returns a DisassociateProductFromPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateProductFromPortfolio">REST API Reference for DisassociateProductFromPortfolio Operation</seealso>
DisassociateProductFromPortfolioResponse EndDisassociateProductFromPortfolio(IAsyncResult asyncResult);
#endregion
#region DisassociateServiceActionFromProvisioningArtifact
/// <summary>
/// Disassociates the specified self-service action association from the specified provisioning
/// artifact.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DisassociateServiceActionFromProvisioningArtifact service method.</param>
///
/// <returns>The response from the DisassociateServiceActionFromProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateServiceActionFromProvisioningArtifact">REST API Reference for DisassociateServiceActionFromProvisioningArtifact Operation</seealso>
DisassociateServiceActionFromProvisioningArtifactResponse DisassociateServiceActionFromProvisioningArtifact(DisassociateServiceActionFromProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DisassociateServiceActionFromProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DisassociateServiceActionFromProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociateServiceActionFromProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateServiceActionFromProvisioningArtifact">REST API Reference for DisassociateServiceActionFromProvisioningArtifact Operation</seealso>
IAsyncResult BeginDisassociateServiceActionFromProvisioningArtifact(DisassociateServiceActionFromProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DisassociateServiceActionFromProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociateServiceActionFromProvisioningArtifact.</param>
///
/// <returns>Returns a DisassociateServiceActionFromProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateServiceActionFromProvisioningArtifact">REST API Reference for DisassociateServiceActionFromProvisioningArtifact Operation</seealso>
DisassociateServiceActionFromProvisioningArtifactResponse EndDisassociateServiceActionFromProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region DisassociateTagOptionFromResource
/// <summary>
/// Disassociates the specified TagOption from the specified resource.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DisassociateTagOptionFromResource service method.</param>
///
/// <returns>The response from the DisassociateTagOptionFromResource service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateTagOptionFromResource">REST API Reference for DisassociateTagOptionFromResource Operation</seealso>
DisassociateTagOptionFromResourceResponse DisassociateTagOptionFromResource(DisassociateTagOptionFromResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DisassociateTagOptionFromResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DisassociateTagOptionFromResource operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociateTagOptionFromResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateTagOptionFromResource">REST API Reference for DisassociateTagOptionFromResource Operation</seealso>
IAsyncResult BeginDisassociateTagOptionFromResource(DisassociateTagOptionFromResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DisassociateTagOptionFromResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociateTagOptionFromResource.</param>
///
/// <returns>Returns a DisassociateTagOptionFromResourceResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateTagOptionFromResource">REST API Reference for DisassociateTagOptionFromResource Operation</seealso>
DisassociateTagOptionFromResourceResponse EndDisassociateTagOptionFromResource(IAsyncResult asyncResult);
#endregion
#region ExecuteProvisionedProductPlan
/// <summary>
/// Provisions or modifies a product based on the resource changes for the specified plan.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ExecuteProvisionedProductPlan service method.</param>
///
/// <returns>The response from the ExecuteProvisionedProductPlan service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidStateException">
/// An attempt was made to modify a resource that is in a state that is not valid. Check
/// your resources to ensure that they are in valid states before retrying the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductPlan">REST API Reference for ExecuteProvisionedProductPlan Operation</seealso>
ExecuteProvisionedProductPlanResponse ExecuteProvisionedProductPlan(ExecuteProvisionedProductPlanRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ExecuteProvisionedProductPlan operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ExecuteProvisionedProductPlan operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteProvisionedProductPlan
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductPlan">REST API Reference for ExecuteProvisionedProductPlan Operation</seealso>
IAsyncResult BeginExecuteProvisionedProductPlan(ExecuteProvisionedProductPlanRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ExecuteProvisionedProductPlan operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginExecuteProvisionedProductPlan.</param>
///
/// <returns>Returns a ExecuteProvisionedProductPlanResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductPlan">REST API Reference for ExecuteProvisionedProductPlan Operation</seealso>
ExecuteProvisionedProductPlanResponse EndExecuteProvisionedProductPlan(IAsyncResult asyncResult);
#endregion
#region ExecuteProvisionedProductServiceAction
/// <summary>
/// Executes a self-service action against a provisioned product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ExecuteProvisionedProductServiceAction service method.</param>
///
/// <returns>The response from the ExecuteProvisionedProductServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidStateException">
/// An attempt was made to modify a resource that is in a state that is not valid. Check
/// your resources to ensure that they are in valid states before retrying the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductServiceAction">REST API Reference for ExecuteProvisionedProductServiceAction Operation</seealso>
ExecuteProvisionedProductServiceActionResponse ExecuteProvisionedProductServiceAction(ExecuteProvisionedProductServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ExecuteProvisionedProductServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ExecuteProvisionedProductServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteProvisionedProductServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductServiceAction">REST API Reference for ExecuteProvisionedProductServiceAction Operation</seealso>
IAsyncResult BeginExecuteProvisionedProductServiceAction(ExecuteProvisionedProductServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ExecuteProvisionedProductServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginExecuteProvisionedProductServiceAction.</param>
///
/// <returns>Returns a ExecuteProvisionedProductServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ExecuteProvisionedProductServiceAction">REST API Reference for ExecuteProvisionedProductServiceAction Operation</seealso>
ExecuteProvisionedProductServiceActionResponse EndExecuteProvisionedProductServiceAction(IAsyncResult asyncResult);
#endregion
#region ListAcceptedPortfolioShares
/// <summary>
/// Lists all portfolios for which sharing was accepted by this account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListAcceptedPortfolioShares service method.</param>
///
/// <returns>The response from the ListAcceptedPortfolioShares service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListAcceptedPortfolioShares">REST API Reference for ListAcceptedPortfolioShares Operation</seealso>
ListAcceptedPortfolioSharesResponse ListAcceptedPortfolioShares(ListAcceptedPortfolioSharesRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListAcceptedPortfolioShares operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListAcceptedPortfolioShares operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListAcceptedPortfolioShares
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListAcceptedPortfolioShares">REST API Reference for ListAcceptedPortfolioShares Operation</seealso>
IAsyncResult BeginListAcceptedPortfolioShares(ListAcceptedPortfolioSharesRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListAcceptedPortfolioShares operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListAcceptedPortfolioShares.</param>
///
/// <returns>Returns a ListAcceptedPortfolioSharesResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListAcceptedPortfolioShares">REST API Reference for ListAcceptedPortfolioShares Operation</seealso>
ListAcceptedPortfolioSharesResponse EndListAcceptedPortfolioShares(IAsyncResult asyncResult);
#endregion
#region ListConstraintsForPortfolio
/// <summary>
/// Lists the constraints for the specified portfolio and product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListConstraintsForPortfolio service method.</param>
///
/// <returns>The response from the ListConstraintsForPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListConstraintsForPortfolio">REST API Reference for ListConstraintsForPortfolio Operation</seealso>
ListConstraintsForPortfolioResponse ListConstraintsForPortfolio(ListConstraintsForPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListConstraintsForPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListConstraintsForPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListConstraintsForPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListConstraintsForPortfolio">REST API Reference for ListConstraintsForPortfolio Operation</seealso>
IAsyncResult BeginListConstraintsForPortfolio(ListConstraintsForPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListConstraintsForPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListConstraintsForPortfolio.</param>
///
/// <returns>Returns a ListConstraintsForPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListConstraintsForPortfolio">REST API Reference for ListConstraintsForPortfolio Operation</seealso>
ListConstraintsForPortfolioResponse EndListConstraintsForPortfolio(IAsyncResult asyncResult);
#endregion
#region ListLaunchPaths
/// <summary>
/// Lists the paths to the specified product. A path is how the user has access to a specified
/// product, and is necessary when provisioning a product. A path also determines the
/// constraints put on the product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListLaunchPaths service method.</param>
///
/// <returns>The response from the ListLaunchPaths service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListLaunchPaths">REST API Reference for ListLaunchPaths Operation</seealso>
ListLaunchPathsResponse ListLaunchPaths(ListLaunchPathsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListLaunchPaths operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListLaunchPaths operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListLaunchPaths
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListLaunchPaths">REST API Reference for ListLaunchPaths Operation</seealso>
IAsyncResult BeginListLaunchPaths(ListLaunchPathsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListLaunchPaths operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListLaunchPaths.</param>
///
/// <returns>Returns a ListLaunchPathsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListLaunchPaths">REST API Reference for ListLaunchPaths Operation</seealso>
ListLaunchPathsResponse EndListLaunchPaths(IAsyncResult asyncResult);
#endregion
#region ListPortfolioAccess
/// <summary>
/// Lists the account IDs that have access to the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListPortfolioAccess service method.</param>
///
/// <returns>The response from the ListPortfolioAccess service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolioAccess">REST API Reference for ListPortfolioAccess Operation</seealso>
ListPortfolioAccessResponse ListPortfolioAccess(ListPortfolioAccessRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListPortfolioAccess operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListPortfolioAccess operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListPortfolioAccess
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolioAccess">REST API Reference for ListPortfolioAccess Operation</seealso>
IAsyncResult BeginListPortfolioAccess(ListPortfolioAccessRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListPortfolioAccess operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListPortfolioAccess.</param>
///
/// <returns>Returns a ListPortfolioAccessResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolioAccess">REST API Reference for ListPortfolioAccess Operation</seealso>
ListPortfolioAccessResponse EndListPortfolioAccess(IAsyncResult asyncResult);
#endregion
#region ListPortfolios
/// <summary>
/// Lists all portfolios in the catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListPortfolios service method.</param>
///
/// <returns>The response from the ListPortfolios service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolios">REST API Reference for ListPortfolios Operation</seealso>
ListPortfoliosResponse ListPortfolios(ListPortfoliosRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListPortfolios operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListPortfolios operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListPortfolios
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolios">REST API Reference for ListPortfolios Operation</seealso>
IAsyncResult BeginListPortfolios(ListPortfoliosRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListPortfolios operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListPortfolios.</param>
///
/// <returns>Returns a ListPortfoliosResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolios">REST API Reference for ListPortfolios Operation</seealso>
ListPortfoliosResponse EndListPortfolios(IAsyncResult asyncResult);
#endregion
#region ListPortfoliosForProduct
/// <summary>
/// Lists all portfolios that the specified product is associated with.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListPortfoliosForProduct service method.</param>
///
/// <returns>The response from the ListPortfoliosForProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfoliosForProduct">REST API Reference for ListPortfoliosForProduct Operation</seealso>
ListPortfoliosForProductResponse ListPortfoliosForProduct(ListPortfoliosForProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListPortfoliosForProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListPortfoliosForProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListPortfoliosForProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfoliosForProduct">REST API Reference for ListPortfoliosForProduct Operation</seealso>
IAsyncResult BeginListPortfoliosForProduct(ListPortfoliosForProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListPortfoliosForProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListPortfoliosForProduct.</param>
///
/// <returns>Returns a ListPortfoliosForProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfoliosForProduct">REST API Reference for ListPortfoliosForProduct Operation</seealso>
ListPortfoliosForProductResponse EndListPortfoliosForProduct(IAsyncResult asyncResult);
#endregion
#region ListPrincipalsForPortfolio
/// <summary>
/// Lists all principal ARNs associated with the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListPrincipalsForPortfolio service method.</param>
///
/// <returns>The response from the ListPrincipalsForPortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPrincipalsForPortfolio">REST API Reference for ListPrincipalsForPortfolio Operation</seealso>
ListPrincipalsForPortfolioResponse ListPrincipalsForPortfolio(ListPrincipalsForPortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListPrincipalsForPortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListPrincipalsForPortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListPrincipalsForPortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPrincipalsForPortfolio">REST API Reference for ListPrincipalsForPortfolio Operation</seealso>
IAsyncResult BeginListPrincipalsForPortfolio(ListPrincipalsForPortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListPrincipalsForPortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListPrincipalsForPortfolio.</param>
///
/// <returns>Returns a ListPrincipalsForPortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPrincipalsForPortfolio">REST API Reference for ListPrincipalsForPortfolio Operation</seealso>
ListPrincipalsForPortfolioResponse EndListPrincipalsForPortfolio(IAsyncResult asyncResult);
#endregion
#region ListProvisionedProductPlans
/// <summary>
/// Lists the plans for the specified provisioned product or all plans to which the user
/// has access.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListProvisionedProductPlans service method.</param>
///
/// <returns>The response from the ListProvisionedProductPlans service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisionedProductPlans">REST API Reference for ListProvisionedProductPlans Operation</seealso>
ListProvisionedProductPlansResponse ListProvisionedProductPlans(ListProvisionedProductPlansRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListProvisionedProductPlans operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListProvisionedProductPlans operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListProvisionedProductPlans
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisionedProductPlans">REST API Reference for ListProvisionedProductPlans Operation</seealso>
IAsyncResult BeginListProvisionedProductPlans(ListProvisionedProductPlansRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListProvisionedProductPlans operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListProvisionedProductPlans.</param>
///
/// <returns>Returns a ListProvisionedProductPlansResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisionedProductPlans">REST API Reference for ListProvisionedProductPlans Operation</seealso>
ListProvisionedProductPlansResponse EndListProvisionedProductPlans(IAsyncResult asyncResult);
#endregion
#region ListProvisioningArtifacts
/// <summary>
/// Lists all provisioning artifacts (also known as versions) for the specified product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListProvisioningArtifacts service method.</param>
///
/// <returns>The response from the ListProvisioningArtifacts service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifacts">REST API Reference for ListProvisioningArtifacts Operation</seealso>
ListProvisioningArtifactsResponse ListProvisioningArtifacts(ListProvisioningArtifactsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListProvisioningArtifacts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListProvisioningArtifacts operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListProvisioningArtifacts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifacts">REST API Reference for ListProvisioningArtifacts Operation</seealso>
IAsyncResult BeginListProvisioningArtifacts(ListProvisioningArtifactsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListProvisioningArtifacts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListProvisioningArtifacts.</param>
///
/// <returns>Returns a ListProvisioningArtifactsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifacts">REST API Reference for ListProvisioningArtifacts Operation</seealso>
ListProvisioningArtifactsResponse EndListProvisioningArtifacts(IAsyncResult asyncResult);
#endregion
#region ListProvisioningArtifactsForServiceAction
/// <summary>
/// Lists all provisioning artifacts (also known as versions) for the specified self-service
/// action.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListProvisioningArtifactsForServiceAction service method.</param>
///
/// <returns>The response from the ListProvisioningArtifactsForServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifactsForServiceAction">REST API Reference for ListProvisioningArtifactsForServiceAction Operation</seealso>
ListProvisioningArtifactsForServiceActionResponse ListProvisioningArtifactsForServiceAction(ListProvisioningArtifactsForServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListProvisioningArtifactsForServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListProvisioningArtifactsForServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListProvisioningArtifactsForServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifactsForServiceAction">REST API Reference for ListProvisioningArtifactsForServiceAction Operation</seealso>
IAsyncResult BeginListProvisioningArtifactsForServiceAction(ListProvisioningArtifactsForServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListProvisioningArtifactsForServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListProvisioningArtifactsForServiceAction.</param>
///
/// <returns>Returns a ListProvisioningArtifactsForServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifactsForServiceAction">REST API Reference for ListProvisioningArtifactsForServiceAction Operation</seealso>
ListProvisioningArtifactsForServiceActionResponse EndListProvisioningArtifactsForServiceAction(IAsyncResult asyncResult);
#endregion
#region ListRecordHistory
/// <summary>
/// Lists the specified requests or all performed requests.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRecordHistory service method.</param>
///
/// <returns>The response from the ListRecordHistory service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListRecordHistory">REST API Reference for ListRecordHistory Operation</seealso>
ListRecordHistoryResponse ListRecordHistory(ListRecordHistoryRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRecordHistory operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRecordHistory operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListRecordHistory
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListRecordHistory">REST API Reference for ListRecordHistory Operation</seealso>
IAsyncResult BeginListRecordHistory(ListRecordHistoryRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRecordHistory operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRecordHistory.</param>
///
/// <returns>Returns a ListRecordHistoryResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListRecordHistory">REST API Reference for ListRecordHistory Operation</seealso>
ListRecordHistoryResponse EndListRecordHistory(IAsyncResult asyncResult);
#endregion
#region ListResourcesForTagOption
/// <summary>
/// Lists the resources associated with the specified TagOption.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListResourcesForTagOption service method.</param>
///
/// <returns>The response from the ListResourcesForTagOption service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListResourcesForTagOption">REST API Reference for ListResourcesForTagOption Operation</seealso>
ListResourcesForTagOptionResponse ListResourcesForTagOption(ListResourcesForTagOptionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListResourcesForTagOption operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListResourcesForTagOption operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListResourcesForTagOption
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListResourcesForTagOption">REST API Reference for ListResourcesForTagOption Operation</seealso>
IAsyncResult BeginListResourcesForTagOption(ListResourcesForTagOptionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListResourcesForTagOption operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListResourcesForTagOption.</param>
///
/// <returns>Returns a ListResourcesForTagOptionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListResourcesForTagOption">REST API Reference for ListResourcesForTagOption Operation</seealso>
ListResourcesForTagOptionResponse EndListResourcesForTagOption(IAsyncResult asyncResult);
#endregion
#region ListServiceActions
/// <summary>
/// Lists all self-service actions.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListServiceActions service method.</param>
///
/// <returns>The response from the ListServiceActions service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActions">REST API Reference for ListServiceActions Operation</seealso>
ListServiceActionsResponse ListServiceActions(ListServiceActionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListServiceActions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListServiceActions operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListServiceActions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActions">REST API Reference for ListServiceActions Operation</seealso>
IAsyncResult BeginListServiceActions(ListServiceActionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListServiceActions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListServiceActions.</param>
///
/// <returns>Returns a ListServiceActionsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActions">REST API Reference for ListServiceActions Operation</seealso>
ListServiceActionsResponse EndListServiceActions(IAsyncResult asyncResult);
#endregion
#region ListServiceActionsForProvisioningArtifact
/// <summary>
/// Returns a paginated list of self-service actions associated with the specified Product
/// ID and Provisioning Artifact ID.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListServiceActionsForProvisioningArtifact service method.</param>
///
/// <returns>The response from the ListServiceActionsForProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActionsForProvisioningArtifact">REST API Reference for ListServiceActionsForProvisioningArtifact Operation</seealso>
ListServiceActionsForProvisioningArtifactResponse ListServiceActionsForProvisioningArtifact(ListServiceActionsForProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListServiceActionsForProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListServiceActionsForProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListServiceActionsForProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActionsForProvisioningArtifact">REST API Reference for ListServiceActionsForProvisioningArtifact Operation</seealso>
IAsyncResult BeginListServiceActionsForProvisioningArtifact(ListServiceActionsForProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListServiceActionsForProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListServiceActionsForProvisioningArtifact.</param>
///
/// <returns>Returns a ListServiceActionsForProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActionsForProvisioningArtifact">REST API Reference for ListServiceActionsForProvisioningArtifact Operation</seealso>
ListServiceActionsForProvisioningArtifactResponse EndListServiceActionsForProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region ListTagOptions
/// <summary>
/// Lists the specified TagOptions or all TagOptions.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListTagOptions service method.</param>
///
/// <returns>The response from the ListTagOptions service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListTagOptions">REST API Reference for ListTagOptions Operation</seealso>
ListTagOptionsResponse ListTagOptions(ListTagOptionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListTagOptions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListTagOptions operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListTagOptions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListTagOptions">REST API Reference for ListTagOptions Operation</seealso>
IAsyncResult BeginListTagOptions(ListTagOptionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListTagOptions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListTagOptions.</param>
///
/// <returns>Returns a ListTagOptionsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListTagOptions">REST API Reference for ListTagOptions Operation</seealso>
ListTagOptionsResponse EndListTagOptions(IAsyncResult asyncResult);
#endregion
#region ProvisionProduct
/// <summary>
/// Provisions the specified product.
///
///
/// <para>
/// A provisioned product is a resourced instance of a product. For example, provisioning
/// a product based on a CloudFormation template launches a CloudFormation stack and its
/// underlying resources. You can check the status of this request using <a>DescribeRecord</a>.
/// </para>
///
/// <para>
/// If the request contains a tag key with an empty list of values, there is a tag conflict
/// for that key. Do not include conflicted keys as tags, or this causes the error "Parameter
/// validation failed: Missing required parameter in Tags[<i>N</i>]:<i>Value</i>".
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ProvisionProduct service method.</param>
///
/// <returns>The response from the ProvisionProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ProvisionProduct">REST API Reference for ProvisionProduct Operation</seealso>
ProvisionProductResponse ProvisionProduct(ProvisionProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ProvisionProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ProvisionProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndProvisionProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ProvisionProduct">REST API Reference for ProvisionProduct Operation</seealso>
IAsyncResult BeginProvisionProduct(ProvisionProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ProvisionProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginProvisionProduct.</param>
///
/// <returns>Returns a ProvisionProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ProvisionProduct">REST API Reference for ProvisionProduct Operation</seealso>
ProvisionProductResponse EndProvisionProduct(IAsyncResult asyncResult);
#endregion
#region RejectPortfolioShare
/// <summary>
/// Rejects an offer to share the specified portfolio.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RejectPortfolioShare service method.</param>
///
/// <returns>The response from the RejectPortfolioShare service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/RejectPortfolioShare">REST API Reference for RejectPortfolioShare Operation</seealso>
RejectPortfolioShareResponse RejectPortfolioShare(RejectPortfolioShareRequest request);
/// <summary>
/// Initiates the asynchronous execution of the RejectPortfolioShare operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RejectPortfolioShare operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRejectPortfolioShare
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/RejectPortfolioShare">REST API Reference for RejectPortfolioShare Operation</seealso>
IAsyncResult BeginRejectPortfolioShare(RejectPortfolioShareRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the RejectPortfolioShare operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginRejectPortfolioShare.</param>
///
/// <returns>Returns a RejectPortfolioShareResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/RejectPortfolioShare">REST API Reference for RejectPortfolioShare Operation</seealso>
RejectPortfolioShareResponse EndRejectPortfolioShare(IAsyncResult asyncResult);
#endregion
#region ScanProvisionedProducts
/// <summary>
/// Lists the provisioned products that are available (not terminated).
///
///
/// <para>
/// To use additional filtering, see <a>SearchProvisionedProducts</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ScanProvisionedProducts service method.</param>
///
/// <returns>The response from the ScanProvisionedProducts service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ScanProvisionedProducts">REST API Reference for ScanProvisionedProducts Operation</seealso>
ScanProvisionedProductsResponse ScanProvisionedProducts(ScanProvisionedProductsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ScanProvisionedProducts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ScanProvisionedProducts operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndScanProvisionedProducts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ScanProvisionedProducts">REST API Reference for ScanProvisionedProducts Operation</seealso>
IAsyncResult BeginScanProvisionedProducts(ScanProvisionedProductsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ScanProvisionedProducts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginScanProvisionedProducts.</param>
///
/// <returns>Returns a ScanProvisionedProductsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ScanProvisionedProducts">REST API Reference for ScanProvisionedProducts Operation</seealso>
ScanProvisionedProductsResponse EndScanProvisionedProducts(IAsyncResult asyncResult);
#endregion
#region SearchProducts
/// <summary>
/// Gets information about the products to which the caller has access.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SearchProducts service method.</param>
///
/// <returns>The response from the SearchProducts service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProducts">REST API Reference for SearchProducts Operation</seealso>
SearchProductsResponse SearchProducts(SearchProductsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the SearchProducts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SearchProducts operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSearchProducts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProducts">REST API Reference for SearchProducts Operation</seealso>
IAsyncResult BeginSearchProducts(SearchProductsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the SearchProducts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSearchProducts.</param>
///
/// <returns>Returns a SearchProductsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProducts">REST API Reference for SearchProducts Operation</seealso>
SearchProductsResponse EndSearchProducts(IAsyncResult asyncResult);
#endregion
#region SearchProductsAsAdmin
/// <summary>
/// Gets information about the products for the specified portfolio or all products.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SearchProductsAsAdmin service method.</param>
///
/// <returns>The response from the SearchProductsAsAdmin service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProductsAsAdmin">REST API Reference for SearchProductsAsAdmin Operation</seealso>
SearchProductsAsAdminResponse SearchProductsAsAdmin(SearchProductsAsAdminRequest request);
/// <summary>
/// Initiates the asynchronous execution of the SearchProductsAsAdmin operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SearchProductsAsAdmin operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSearchProductsAsAdmin
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProductsAsAdmin">REST API Reference for SearchProductsAsAdmin Operation</seealso>
IAsyncResult BeginSearchProductsAsAdmin(SearchProductsAsAdminRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the SearchProductsAsAdmin operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSearchProductsAsAdmin.</param>
///
/// <returns>Returns a SearchProductsAsAdminResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProductsAsAdmin">REST API Reference for SearchProductsAsAdmin Operation</seealso>
SearchProductsAsAdminResponse EndSearchProductsAsAdmin(IAsyncResult asyncResult);
#endregion
#region SearchProvisionedProducts
/// <summary>
/// Gets information about the provisioned products that meet the specified criteria.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SearchProvisionedProducts service method.</param>
///
/// <returns>The response from the SearchProvisionedProducts service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProvisionedProducts">REST API Reference for SearchProvisionedProducts Operation</seealso>
SearchProvisionedProductsResponse SearchProvisionedProducts(SearchProvisionedProductsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the SearchProvisionedProducts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SearchProvisionedProducts operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSearchProvisionedProducts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProvisionedProducts">REST API Reference for SearchProvisionedProducts Operation</seealso>
IAsyncResult BeginSearchProvisionedProducts(SearchProvisionedProductsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the SearchProvisionedProducts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSearchProvisionedProducts.</param>
///
/// <returns>Returns a SearchProvisionedProductsResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProvisionedProducts">REST API Reference for SearchProvisionedProducts Operation</seealso>
SearchProvisionedProductsResponse EndSearchProvisionedProducts(IAsyncResult asyncResult);
#endregion
#region TerminateProvisionedProduct
/// <summary>
/// Terminates the specified provisioned product.
///
///
/// <para>
/// This operation does not delete any records associated with the provisioned product.
/// </para>
///
/// <para>
/// You can check the status of this request using <a>DescribeRecord</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the TerminateProvisionedProduct service method.</param>
///
/// <returns>The response from the TerminateProvisionedProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/TerminateProvisionedProduct">REST API Reference for TerminateProvisionedProduct Operation</seealso>
TerminateProvisionedProductResponse TerminateProvisionedProduct(TerminateProvisionedProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the TerminateProvisionedProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the TerminateProvisionedProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndTerminateProvisionedProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/TerminateProvisionedProduct">REST API Reference for TerminateProvisionedProduct Operation</seealso>
IAsyncResult BeginTerminateProvisionedProduct(TerminateProvisionedProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the TerminateProvisionedProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginTerminateProvisionedProduct.</param>
///
/// <returns>Returns a TerminateProvisionedProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/TerminateProvisionedProduct">REST API Reference for TerminateProvisionedProduct Operation</seealso>
TerminateProvisionedProductResponse EndTerminateProvisionedProduct(IAsyncResult asyncResult);
#endregion
#region UpdateConstraint
/// <summary>
/// Updates the specified constraint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateConstraint service method.</param>
///
/// <returns>The response from the UpdateConstraint service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateConstraint">REST API Reference for UpdateConstraint Operation</seealso>
UpdateConstraintResponse UpdateConstraint(UpdateConstraintRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateConstraint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateConstraint operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateConstraint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateConstraint">REST API Reference for UpdateConstraint Operation</seealso>
IAsyncResult BeginUpdateConstraint(UpdateConstraintRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateConstraint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateConstraint.</param>
///
/// <returns>Returns a UpdateConstraintResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateConstraint">REST API Reference for UpdateConstraint Operation</seealso>
UpdateConstraintResponse EndUpdateConstraint(IAsyncResult asyncResult);
#endregion
#region UpdatePortfolio
/// <summary>
/// Updates the specified portfolio.
///
///
/// <para>
/// You cannot update a product that was shared with you.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdatePortfolio service method.</param>
///
/// <returns>The response from the UpdatePortfolio service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.LimitExceededException">
/// The current limits of the service would have been exceeded by this operation. Decrease
/// your resource use or increase your service limits and retry the operation.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdatePortfolio">REST API Reference for UpdatePortfolio Operation</seealso>
UpdatePortfolioResponse UpdatePortfolio(UpdatePortfolioRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdatePortfolio operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdatePortfolio operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdatePortfolio
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdatePortfolio">REST API Reference for UpdatePortfolio Operation</seealso>
IAsyncResult BeginUpdatePortfolio(UpdatePortfolioRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdatePortfolio operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdatePortfolio.</param>
///
/// <returns>Returns a UpdatePortfolioResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdatePortfolio">REST API Reference for UpdatePortfolio Operation</seealso>
UpdatePortfolioResponse EndUpdatePortfolio(IAsyncResult asyncResult);
#endregion
#region UpdateProduct
/// <summary>
/// Updates the specified product.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateProduct service method.</param>
///
/// <returns>The response from the UpdateProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProduct">REST API Reference for UpdateProduct Operation</seealso>
UpdateProductResponse UpdateProduct(UpdateProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProduct">REST API Reference for UpdateProduct Operation</seealso>
IAsyncResult BeginUpdateProduct(UpdateProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateProduct.</param>
///
/// <returns>Returns a UpdateProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProduct">REST API Reference for UpdateProduct Operation</seealso>
UpdateProductResponse EndUpdateProduct(IAsyncResult asyncResult);
#endregion
#region UpdateProvisionedProduct
/// <summary>
/// Requests updates to the configuration of the specified provisioned product.
///
///
/// <para>
/// If there are tags associated with the object, they cannot be updated or added. Depending
/// on the specific updates requested, this operation can update with no interruption,
/// with some interruption, or replace the provisioned product entirely.
/// </para>
///
/// <para>
/// You can check the status of this request using <a>DescribeRecord</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateProvisionedProduct service method.</param>
///
/// <returns>The response from the UpdateProvisionedProduct service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisionedProduct">REST API Reference for UpdateProvisionedProduct Operation</seealso>
UpdateProvisionedProductResponse UpdateProvisionedProduct(UpdateProvisionedProductRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateProvisionedProduct operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateProvisionedProduct operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateProvisionedProduct
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisionedProduct">REST API Reference for UpdateProvisionedProduct Operation</seealso>
IAsyncResult BeginUpdateProvisionedProduct(UpdateProvisionedProductRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateProvisionedProduct operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateProvisionedProduct.</param>
///
/// <returns>Returns a UpdateProvisionedProductResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisionedProduct">REST API Reference for UpdateProvisionedProduct Operation</seealso>
UpdateProvisionedProductResponse EndUpdateProvisionedProduct(IAsyncResult asyncResult);
#endregion
#region UpdateProvisioningArtifact
/// <summary>
/// Updates the specified provisioning artifact (also known as a version) for the specified
/// product.
///
///
/// <para>
/// You cannot update a provisioning artifact for a product that was shared with you.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateProvisioningArtifact service method.</param>
///
/// <returns>The response from the UpdateProvisioningArtifact service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisioningArtifact">REST API Reference for UpdateProvisioningArtifact Operation</seealso>
UpdateProvisioningArtifactResponse UpdateProvisioningArtifact(UpdateProvisioningArtifactRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateProvisioningArtifact operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateProvisioningArtifact operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateProvisioningArtifact
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisioningArtifact">REST API Reference for UpdateProvisioningArtifact Operation</seealso>
IAsyncResult BeginUpdateProvisioningArtifact(UpdateProvisioningArtifactRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateProvisioningArtifact operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateProvisioningArtifact.</param>
///
/// <returns>Returns a UpdateProvisioningArtifactResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisioningArtifact">REST API Reference for UpdateProvisioningArtifact Operation</seealso>
UpdateProvisioningArtifactResponse EndUpdateProvisioningArtifact(IAsyncResult asyncResult);
#endregion
#region UpdateServiceAction
/// <summary>
/// Updates a self-service action.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateServiceAction service method.</param>
///
/// <returns>The response from the UpdateServiceAction service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateServiceAction">REST API Reference for UpdateServiceAction Operation</seealso>
UpdateServiceActionResponse UpdateServiceAction(UpdateServiceActionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateServiceAction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateServiceAction operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateServiceAction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateServiceAction">REST API Reference for UpdateServiceAction Operation</seealso>
IAsyncResult BeginUpdateServiceAction(UpdateServiceActionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateServiceAction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateServiceAction.</param>
///
/// <returns>Returns a UpdateServiceActionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateServiceAction">REST API Reference for UpdateServiceAction Operation</seealso>
UpdateServiceActionResponse EndUpdateServiceAction(IAsyncResult asyncResult);
#endregion
#region UpdateTagOption
/// <summary>
/// Updates the specified TagOption.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateTagOption service method.</param>
///
/// <returns>The response from the UpdateTagOption service method, as returned by ServiceCatalog.</returns>
/// <exception cref="Amazon.ServiceCatalog.Model.DuplicateResourceException">
/// The specified resource is a duplicate.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
/// One or more parameters provided to the operation are not valid.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.ResourceNotFoundException">
/// The specified resource was not found.
/// </exception>
/// <exception cref="Amazon.ServiceCatalog.Model.TagOptionNotMigratedException">
/// An operation requiring TagOptions failed because the TagOptions migration process
/// has not been performed for this account. Please use the AWS console to perform the
/// migration process before retrying the operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateTagOption">REST API Reference for UpdateTagOption Operation</seealso>
UpdateTagOptionResponse UpdateTagOption(UpdateTagOptionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateTagOption operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateTagOption operation on AmazonServiceCatalogClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateTagOption
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateTagOption">REST API Reference for UpdateTagOption Operation</seealso>
IAsyncResult BeginUpdateTagOption(UpdateTagOptionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateTagOption operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateTagOption.</param>
///
/// <returns>Returns a UpdateTagOptionResult from ServiceCatalog.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateTagOption">REST API Reference for UpdateTagOption Operation</seealso>
UpdateTagOptionResponse EndUpdateTagOption(IAsyncResult asyncResult);
#endregion
}
} | 63.056927 | 245 | 0.703012 | [
"Apache-2.0"
] | InsiteVR/aws-sdk-net | sdk/src/Services/ServiceCatalog/Generated/_bcl35/IAmazonServiceCatalog.cs | 224,861 | C# |
namespace Qabuze
{
partial class frmDLStat
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDLStat));
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.listView1 = new System.Windows.Forms.ListView();
this.ThreadID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Percentage = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Status = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Tracks = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Downloaded = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Tagged = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Done = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Failed = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Title = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Artist = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar1.Location = new System.Drawing.Point(12, 286);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(523, 23);
this.progressBar1.TabIndex = 0;
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.ThreadID,
this.Percentage,
this.Status,
this.Tracks,
this.Downloaded,
this.Tagged,
this.Done,
this.Failed,
this.Title,
this.Artist});
this.listView1.Location = new System.Drawing.Point(13, 13);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(629, 267);
this.listView1.TabIndex = 1;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// ThreadID
//
this.ThreadID.Text = "#";
this.ThreadID.Width = 25;
//
// Percentage
//
this.Percentage.Text = "%";
this.Percentage.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Percentage.Width = 30;
//
// Status
//
this.Status.Text = "Status";
//
// Tracks
//
this.Tracks.Text = "Tracks";
this.Tracks.Width = 50;
//
// Downloaded
//
this.Downloaded.Text = "Downloaded";
this.Downloaded.Width = 75;
//
// Tagged
//
this.Tagged.Text = "Tagged";
this.Tagged.Width = 55;
//
// Done
//
this.Done.Text = "Done";
this.Done.Width = 45;
//
// Failed
//
this.Failed.Text = "Failed";
this.Failed.Width = 45;
//
// Title
//
this.Title.Text = "Title";
this.Title.Width = 120;
//
// Artist
//
this.Artist.Text = "Artist";
this.Artist.Width = 120;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(541, 285);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(100, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Clear finished ones";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// frmDLStat
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(654, 321);
this.Controls.Add(this.button1);
this.Controls.Add(this.listView1);
this.Controls.Add(this.progressBar1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmDLStat";
this.Text = "frmDLStat";
this.Load += new System.EventHandler(this.frmDLStat_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader ThreadID;
private System.Windows.Forms.ColumnHeader Percentage;
private System.Windows.Forms.ColumnHeader Status;
private System.Windows.Forms.ColumnHeader Tracks;
private System.Windows.Forms.ColumnHeader Downloaded;
private System.Windows.Forms.ColumnHeader Tagged;
private System.Windows.Forms.ColumnHeader Done;
private System.Windows.Forms.ColumnHeader Title;
private System.Windows.Forms.ColumnHeader Artist;
private System.Windows.Forms.ColumnHeader Failed;
private System.Windows.Forms.Button button1;
}
} | 43.080925 | 161 | 0.574668 | [
"MIT"
] | Hadryan/Qabuze | Qabuze/frmDLStat.Designer.cs | 7,455 | C# |
using ESRI.ArcGIS.SystemUI;
namespace BrutileArcGIS.MenuDefs
{
public class NokiaMenuDef : IMenuDef
{
public string Caption
{
get { return "&Nokia - HERE"; }
}
public void GetItemInfo(int pos, IItemDef itemDef)
{
switch (pos)
{
case 0:
itemDef.ID = "AddNokiaStreetLayerCommand";
itemDef.Group = false;
break;
case 1:
itemDef.ID = "AddNokiaSatelliteLayerCommand";
itemDef.Group = false;
break;
case 2:
itemDef.ID = "AddNokiaHybridLayerCommand";
itemDef.Group = false;
break;
case 3:
itemDef.ID = "AddNokiaTerrainLayerCommand";
itemDef.Group = false;
break;
case 4:
itemDef.ID = "AddNokiaTrafficLayerCommand";
itemDef.Group = false;
break;
case 5:
itemDef.ID = "AddNokiaTransitLayerCommand";
itemDef.Group = false;
break;
}
}
public int ItemCount
{
get { return 6; }
}
public string Name
{
get { return "BruTile"; }
}
}
}
| 27.055556 | 65 | 0.417522 | [
"MIT"
] | andrepraska/andre | trunk/ArcBruTile/app/MenuDefs/NokiaMenuDef.cs | 1,463 | C# |
/*
* MGSwipeTableCell.Xamarin is licensed under MIT license. See LICENSE.md file for more information.
* Copyright (c) 2017 Goavega Software
*/
using System;
using ObjCRuntime;
namespace MGSwipeCell.Xamarin.Binding
{
[Native]
public enum MGSwipeTransition : long
{
Border = 0,
Static,
Drag,
ClipCenter,
Rotate3D
}
[Native]
public enum MGSwipeDirection : long
{
LeftToRight = 0,
RightToLeft
}
[Native]
public enum MGSwipeState : long
{
None = 0,
SwipingLeftToRight,
SwipingRightToLeft,
ExpandingLeftToRight,
ExpandingRightToLeft
}
[Native]
public enum MGSwipeExpansionLayout : long
{
Border = 0,
Center
}
[Native]
public enum MGSwipeEasingFunction : long
{
Linear = 0,
QuadIn,
QuadOut,
QuadInOut,
CubicIn,
CubicOut,
CubicInOut,
BounceIn,
BounceOut,
BounceInOut
}
}
| 14.033333 | 100 | 0.705463 | [
"MIT"
] | goavega-software/mgswipetablecell-xamarin | MGSwipeCell.Xamarin.Binding/Structs.cs | 844 | C# |
/*
* SHS -- The Scalable Hyperlink Store
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
* A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.IO.Compression;
using System.Diagnostics;
using SHS;
namespace RegressionTest1 {
class RegressionTest1 {
static void Main(string[] args) {
if (args.Length != 2) {
Console.Error.WriteLine("SHS.RegressionTest1 <leader> <linkfiles.txt>");
} else {
var sw = System.Diagnostics.Stopwatch.StartNew();
var svc = new Service(args[0]);
Console.WriteLine("Service currently provides {0} servers", svc.NumServers());
var store = svc.CreateStore();
Console.WriteLine("Created new store with GUID {0:N}", store.ID);
var linkFiles = File.ReadAllLines(args[1]);
for (int i = 0; i < linkFiles.Length; i++) {
store.AddPageLinks(new PageLinksFileEnumerator(Slice(linkFiles, i, 1)));
store.MarkAtomic();
Console.WriteLine("Added batch {0}. Current store has {1} URLs, {2} links, {3} max in-degree, {4} max out-degree",
i, store.NumUrls(), store.NumLinks(), store.MaxDegree(Dir.Bwd), store.MaxDegree(Dir.Fwd));
ValidateStore(store, new PageLinksFileEnumerator(Slice(linkFiles, 0, i+1)));
}
Console.WriteLine("Deleting store {0:N}", store.ID);
store.Close();
svc.DeleteStore(store.ID);
Console.WriteLine("Done. RegressionTest1 took {0} seconds", 0.001 * sw.ElapsedMilliseconds);
}
}
private static void ValidateStore(Store store, PageLinksFileEnumerator plEnum) {
var sw = Stopwatch.StartNew();
long pageCnt = 0;
while (plEnum.MoveNext()) {
pageCnt++;
var pl = plEnum.Current;
string pageUrl = pl.pageUrl;
long pageUid = store.UrlToUid(pageUrl);
string pageUidUrl = store.UidToUrl(pageUid);
if (string.CompareOrdinal(pageUrl, pageUidUrl) != 0) {
Console.Error.WriteLine();
Console.Error.WriteLine("Regression test failed for page {0} (self-test)", pageCnt);
Console.Error.WriteLine("Original URL: {0}", pageUrl);
Console.Error.WriteLine("UrlToUid UID: {0,16:X}", pageUid);
Console.Error.WriteLine("UidToUrl URL: {0}", pageUidUrl);
System.Environment.Exit(1);
}
int numLinks = pl.linkUrls.Length;
// Ignore self-links
var nonReflectiveL = new List<string>();
for (int j = 0; j < numLinks; j++) {
if (string.CompareOrdinal(pageUrl, pl.linkUrls[j]) != 0) nonReflectiveL.Add(pl.linkUrls[j]);
}
var nonReflectiveA = nonReflectiveL.ToArray();
var linkUids = store.BatchedUrlToUid(nonReflectiveA);
var bwdLinkUids = store.BatchedGetLinks(linkUids, Dir.Bwd);
// Backward test first
for (int j = 0; j < bwdLinkUids.Length; j++) {
bool found = false;
for (int k = 0; k < bwdLinkUids[j].Length && !found; k++) {
if (pageUid == bwdLinkUids[j][k]) found = true;
}
if (!found) {
var bwdLinkUrls = store.BatchedUidToUrl(bwdLinkUids[j]);
Console.Error.WriteLine();
Console.Error.WriteLine("Regression test failed after {0} seconds for page {1} (bwd test)",
0.001 * sw.ElapsedMilliseconds, pageCnt);
Console.Error.WriteLine("page: UID={0:X} URL={1}", pageUid, pageUrl);
Console.Error.WriteLine("link[{0}]: UID={1:X} URL={2}", j, linkUids[j], pl.linkUrls[j]);
Console.Error.WriteLine("bwdLinkUids[{0}].Length={1}", j, bwdLinkUrls.Length);
for (int k = 0; k < bwdLinkUrls.Length; k++) {
Console.Error.WriteLine("bwdLink[{0}]: UID={1:X} URL={2}", k, bwdLinkUids[j][k], bwdLinkUrls[k]);
}
System.Environment.Exit(1);
}
}
// Forward test second
var fwdLinkUrls = store.BatchedUidToUrl(store.GetLinks(pageUid, Dir.Fwd));
Array.Sort<string>(pl.linkUrls, string.CompareOrdinal);
Array.Sort<string>(fwdLinkUrls, string.CompareOrdinal);
int a = 0;
int b = 0;
while (a < numLinks && b < fwdLinkUrls.Length) {
while ((a < numLinks && string.CompareOrdinal(pageUrl, pl.linkUrls[a]) == 0)
|| (a < numLinks - 1 && string.CompareOrdinal(pl.linkUrls[a], pl.linkUrls[a + 1]) == 0)) {
a++;
}
if (a >= numLinks) {
break;
}
if (string.CompareOrdinal(pl.linkUrls[a], fwdLinkUrls[b]) != 0) {
Console.Error.WriteLine();
Console.Error.WriteLine("Regression test (fwd test1) failed for page {0} uid={1,16:x} urlBytes={2}", pageCnt, pageUid, pl.pageUrl);
Console.Error.WriteLine("raw links file has {0} links:", numLinks);
for (int j = 0; j < numLinks; j++) {
Console.Error.WriteLine(" link[{0}]={1}", j, pl.linkUrls[j]);
}
Console.Error.WriteLine("fwd db has {0} links:", fwdLinkUrls.Length);
for (int j = 0; j < fwdLinkUrls.Length; j++) {
Console.Error.WriteLine(" link[{0}]={1}", j, fwdLinkUrls[j]);
}
System.Environment.Exit(1);
}
a++;
b++;
}
if (a < numLinks || b < fwdLinkUrls.Length) {
Console.Error.WriteLine("Regression test (fwd test2) failed for page {0} uid={1,16:x} urlBytes={2}", pageCnt, pageUid, pl.pageUrl);
Console.Error.WriteLine("raw links file has {0} links:", numLinks);
for (int j = 0; j < numLinks; j++) {
Console.Error.WriteLine(" link[{0}]={1}", j, pl.linkUrls[j]);
}
Console.Error.WriteLine("fwd db has {0} links:", fwdLinkUrls.Length);
for (int j = 0; j < fwdLinkUrls.Length; j++) {
Console.Error.WriteLine(" link[{0}]={1}", j, fwdLinkUrls[j]);
}
System.Environment.Exit(1);
}
}
Console.WriteLine("Validated {0} PageLink records against store, taking {1} seconds", pageCnt, 0.001 * sw.ElapsedMilliseconds);
}
private static T[] Slice<T>(T[] a, int start, int len) {
var res = new T[len];
Array.Copy(a, start, res, 0, len);
return res;
}
}
internal class PageLinksFileEnumerator : IEnumerator<PageLinks> {
private readonly string[] fileList;
private int nextFile;
private BinaryReader rd;
private PageLinks current;
internal PageLinksFileEnumerator(string[] fileList) {
this.fileList = fileList;
this.nextFile = 0;
this.rd = null;
}
public PageLinks Current { get { return this.current; } }
object IEnumerator.Current { get { return this.current; } }
public bool MoveNext() {
while (true) {
try {
if (this.rd == null) {
if (this.nextFile < this.fileList.Length) {
this.rd = new BinaryReader(new GZipStream(new BufferedStream(new FileStream(this.fileList[this.nextFile++], FileMode.Open, FileAccess.Read)), CompressionMode.Decompress));
} else {
return false;
}
}
this.current.pageUrl = rd.ReadString();
this.current.linkUrls = new string[rd.ReadInt32()];
for (int i = 0; i < this.current.linkUrls.Length; i++) {
this.current.linkUrls[i] = rd.ReadString();
}
return true;
} catch (EndOfStreamException) {
this.rd.Close();
this.rd = null;
}
}
}
public void Reset() {
if (this.rd != null) {
this.rd.Close();
this.rd = null;
}
this.nextFile = 0;
}
public void Dispose() {
this.rd.Close();
}
}
}
| 40.173709 | 185 | 0.589576 | [
"Apache-2.0"
] | MicrosoftResearch/SHS | RegressionTest1/RegressionTest1.cs | 8,559 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TreeCh.Body {
//数据结构( C#语言版)5.2 二叉树 135
//不带头引用的二叉树
//二叉树的类
public class BiTree<T> {
private Node<T> head; //头引用
public Node<T> Head {//头引用属性
get {
return head;
}
set {
head = value;
}
}//头引用属性
public BiTree() {//构造器
head = null;
}//构造器
public BiTree(T val) {//构造器
Node<T> p = new Node<T>(val);//实例化一个结点,节点的构造器
head = p;//头引用指向结点
}//构造器
public BiTree(T val, Node<T> lp, Node<T> rp) {//构造器
Node<T> p = new Node<T>(val, lp, rp);//实例化一个结点,节点的构造器
head = p;//头引用指向结点
}//构造器
public bool IsEmpty() {//判断是否是空二叉树
if (head == null) {
return true;
} else {
return false;
}
}//判断是否是空二叉树
public Node<T> Root() {//获取根结点
return head;
}//获取根结点
public Node<T> GetLChild(Node<T> p) {//获取结点的左孩子结点
return p.LChild;
}//获取结点的左孩子结点
public Node<T> GetRChild(Node<T> p) {//获取结点的右孩子结点
return p.RChild;
}//获取结点的右孩子结点
public void InsertL(T val, Node<T> p) { //插入到p的左子树
//将结点p的左子树插入值为val的新结点,
//原来的左子树成为新结点的左子树
Node<T> tmp = new Node<T>(val);
tmp.LChild = p.LChild;
p.LChild = tmp;
}
public void InsertR(T val, Node<T> p) { //插入到p的右子树
//将结点p的右子树插入值为val的新结点,
//原来的右子树成为新结点的右子树
Node<T> tmp = new Node<T>(val);
tmp.RChild = p.RChild;
p.RChild = tmp;
}
public Node<T> DeleteL(Node<T> p) {//若p非空,删除p的左子树
if ((p == null) || (p.LChild == null)) {
return null;
}
Node<T> tmp = p.LChild;
p.LChild = null;
return tmp;
}//若p非空,删除p的左子树
public Node<T> DeleteR(Node<T> p) {//若p非空,删除p的右子树
if ((p == null) || (p.RChild == null)) {
return null;
}
Node<T> tmp = p.RChild;
p.RChild = null;
return tmp;
}//若p非空,删除p的右子树
//判断是否是叶子结点
public bool IsLeaf(Node<T> p) {
if ((p != null) && (p.LChild == null) && (p.RChild == null)) {
return true;
} else {
return false;
}
}
//1、 先序遍历( DLR)
public void PreOrder(Node<T> root) {
//根结点为空
if (root == null) {
return;
}
//处理根结点
Console.WriteLine("{0}", root.Data);
//先序遍历左子树
PreOrder(root.LChild);
//先序遍历右子树
PreOrder(root.RChild);
}
//2、 中序遍历( LDR)
//中序遍历的基本思想是:首先中序遍历根结点的左子树,然后访问根结点,
//最后中序遍历其右子树。中序遍历的递归算法实现如下:
public void InOrder(Node<T> root) {
//根结点为空
if (root == null) {
return;
}
//中序遍历左子树
InOrder(root.LChild);
//处理根结点
Console.WriteLine("{0}", root.Data);
//中序遍历右子树
InOrder(root.RChild);
}
//3、 后序遍历( LRD)
//后序遍历的基本思想是:首先后序遍历根结点的左子树,然后后序遍历根结
//点的右子树,最后访问根结点。后序遍历的递归算法实现如下,
public void PostOrder(Node<T> root) {
//根结点为空
if (root == null) {
return;
}
//后序遍历左子树
PostOrder(root.LChild);
//后序遍历右子树
PostOrder(root.RChild);
//处理根结点
Console.WriteLine("{0}", root.Data);
}
//4、 层序遍历(Level Order)
//层序遍历的基本思想是:由于层序遍历结点的顺序是先遇到的结点先访问,
//与队列操作的顺序相同。所以,在进行层序遍历时,设置一个队列,将根结点引
//用入队,当队列非空时,循环执行以下三步:
//( 1) 从队列中取出一个结点引用,并访问该结点;
//(2) 若该结点的左子树非空,将该结点的左子树引用入队;
//(3) 若该结点的右子树非空,将该结点的右子树引用入队;
//层序遍历的算法实现如下:
public void LevelOrder(Node<T> root) {
//根结点为空
if (root == null) {
return;
}
//设置一个队列保存层序遍历的结点
CSeqQueue<Node<T>> sq = new CSeqQueue<Node<T>>(50);
//根结点入队
sq.In(root);
//队列非空,结点没有处理完
while (!sq.IsEmpty()) {
//结点出队
Node<T> tmp = sq.Out();
//处理当前结点
Console.WriteLine("{o}", tmp);
//将当前结点的左孩子结点入队
if (tmp.LChild != null) {
sq.In(tmp.LChild);
}
//将当前结点的右孩子结点入队
if (tmp.RChild != null) {
sq.In(tmp.RChild);
}
}
}
// 【例 5-1】编写算法,在二叉树中查找值为 value 的结点。
//算法思路:在二叉树中查找具有某个特定值的结点就是遍历二叉树,对于遍
//历到的结点,判断其值是否等于 value,如果是则返回该结点,否则返回空。本
//节例题的算法都作为 BiTree<T> 的成员方法。
Node<T> Search(Node<T> root, T value) {
Node<T> p = root;
if (p == null) {
return null;
}
if (!p.Data.Equals(value)) {
return p;
}
if (p.LChild != null) {
return Search(p.LChild, value);
}
if (p.RChild != null) {
return Search(p.RChild, value);
}
return null;
}
//【例 5-2】统计出二叉树中叶子结点的数目。
int CountLeafNode(Node<T> root) {
if (root == null) {
return 0;
} else if (root.LChild == null && root.RChild == null) {
return 1;
} else {
return (
CountLeafNode(root.LChild) +
CountLeafNode(root.RChild)
);
}
}
// 【例 5-3】编写算法,求二叉树的深度。
//算法思路:用递归实现该算法。如果二叉树为空,则返回 0;如果二叉树只
//有一个结点(根结点),返回 1,否则返回根结点的左分支的深度与右分支的深
//度中较大者加 1。
//算法实现如下:
int GetHeight(Node<T> root) {
int lh;
int rh;
if (root == null) {
return 0;
} else if (root.LChild == null && root.RChild == null) {
return 1;
} else {
lh = GetHeight(root.LChild);
rh = GetHeight(root.RChild);
return (lh > rh ? lh : rh) + 1;
}
}//!_GetHeight
}//!_public class BiTree<T>
}//!_namespace TreeCh.Body
| 28.868996 | 74 | 0.426562 | [
"MIT"
] | blacop/DSCSR | DSCSS/TreeCh/Body/BiTree.cs | 8,557 | C# |
using System;
using System.Text;
namespace Tetrifact.Core
{
/// <summary>
/// Obscures/restores strings with base64. This is for cosmetic reasons (to mask complex data structure in public ids), and for sanitizing text for
/// writing as filesystem names.
/// </summary>
public static class Obfuscator
{
public static string Cloak(string input)
{
return Convert.ToBase64String(Encoding.UTF8.GetBytes(input));
}
public static string Decloak(string input)
{
try
{
return Encoding.UTF8.GetString(Convert.FromBase64String(input));
}
catch (FormatException)
{
throw new InvalidFileIdentifierException(input);
}
}
}
}
| 26.866667 | 151 | 0.586849 | [
"MIT"
] | shukriadams/tetrifact | src/Tetrifact.Core/Obfuscator.cs | 808 | C# |
using Newtonsoft.Json;
namespace Lakerfield.BunqSdk.Model
{
[BunqObject("WhitelistSddRead")]
public class WhitelistSddRead
{
/// <summary>
/// The ID of the whitelist entry.
/// </summary>
[JsonProperty(PropertyName = "id")]
public int Id { get; set; }
/// <summary>
/// The account to which payments will come in before possibly being 'redirected' by the whitelist.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_incoming_id")]
public int MonetaryAccountIncomingId { get; set; }
/// <summary>
/// The account from which payments will be deducted when a transaction is matched with this whitelist.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_paying_id")]
public int MonetaryAccountPayingId { get; set; }
/// <summary>
/// The type of the SDD whitelist, can be CORE or B2B.
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }
/// <summary>
/// The status of the whitelist.
/// </summary>
[JsonProperty(PropertyName = "status")]
public string Status { get; set; }
/// <summary>
/// The credit scheme ID provided by the counterparty.
/// </summary>
[JsonProperty(PropertyName = "credit_scheme_identifier")]
public string CreditSchemeIdentifier { get; set; }
/// <summary>
/// The mandate ID provided by the counterparty.
/// </summary>
[JsonProperty(PropertyName = "mandate_identifier")]
public string MandateIdentifier { get; set; }
/// <summary>
/// The account to which payments will be paid.
/// </summary>
[JsonProperty(PropertyName = "counterparty_alias")]
public LabelMonetaryAccount CounterpartyAlias { get; set; }
/// <summary>
/// The monthly maximum amount that can be deducted from the target account.
/// </summary>
[JsonProperty(PropertyName = "maximum_amount_per_month")]
public Amount MaximumAmountPerMonth { get; set; }
/// <summary>
/// The user who created the whitelist entry.
/// </summary>
[JsonProperty(PropertyName = "user_alias_created")]
public LabelUser UserAliasCreated { get; set; }
}
}
| 31.414286 | 107 | 0.657572 | [
"MIT"
] | Lakerfield/bunqsdk | src/Lakerfield.BunqSdk/Model/Generated/WhitelistSddRead.cs | 2,199 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the glue-2017-03-31.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Glue.Model
{
/// <summary>
/// Specifies the physical requirements for a connection.
/// </summary>
public partial class PhysicalConnectionRequirements
{
private string _availabilityZone;
private List<string> _securityGroupIdList = new List<string>();
private string _subnetId;
/// <summary>
/// Gets and sets the property AvailabilityZone.
/// <para>
/// The connection's Availability Zone. This field is redundant because the specified
/// subnet implies the Availability Zone to be used. Currently the field must be populated,
/// but it will be deprecated in the future.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=255)]
public string AvailabilityZone
{
get { return this._availabilityZone; }
set { this._availabilityZone = value; }
}
// Check to see if AvailabilityZone property is set
internal bool IsSetAvailabilityZone()
{
return this._availabilityZone != null;
}
/// <summary>
/// Gets and sets the property SecurityGroupIdList.
/// <para>
/// The security group ID list used by the connection.
/// </para>
/// </summary>
[AWSProperty(Min=0, Max=50)]
public List<string> SecurityGroupIdList
{
get { return this._securityGroupIdList; }
set { this._securityGroupIdList = value; }
}
// Check to see if SecurityGroupIdList property is set
internal bool IsSetSecurityGroupIdList()
{
return this._securityGroupIdList != null && this._securityGroupIdList.Count > 0;
}
/// <summary>
/// Gets and sets the property SubnetId.
/// <para>
/// The subnet ID used by the connection.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=255)]
public string SubnetId
{
get { return this._subnetId; }
set { this._subnetId = value; }
}
// Check to see if SubnetId property is set
internal bool IsSetSubnetId()
{
return this._subnetId != null;
}
}
} | 32.57 | 103 | 0.598096 | [
"Apache-2.0"
] | philasmar/aws-sdk-net | sdk/src/Services/Glue/Generated/Model/PhysicalConnectionRequirements.cs | 3,257 | C# |
using System.Reflection;
namespace Migrations
{
public static class MigrationExtensions
{
/// <summary>
/// Gets the <see cref="MigrationAttribute" /> for the migration definition.
/// </summary>
/// <param name="migration"></param>
/// <returns></returns>
public static MigrationAttribute GetAttribute(this IMigration migration)
{
return migration.GetType().GetCustomAttribute<MigrationAttribute>();
}
}
} | 29.411765 | 88 | 0.614 | [
"MIT"
] | RoboKiwi/Migrations | src/Migrations/MigrationExtensions.cs | 502 | C# |
// Copyright (c) CodeSmith Tools, LLC. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace CodeSmith.SchemaHelper {
public enum VisualStudioVersion : byte {
VS_2005 = 0,
VS_2008 = 1,
VS_2010 = 2,
VS_2012 = 4,
VS_2013 = 5,
VS_2014 = 6
}
}
| 25.125 | 111 | 0.631841 | [
"Apache-2.0"
] | codesmithtools/SchemaHelper | Source/SchemaHelper/Enums/VisualStudioVersion.cs | 404 | C# |
// <auto-generated>
// Auto-generated by StoneAPI, do not modify.
// </auto-generated>
namespace Dropbox.Api.TeamLog
{
using sys = System;
using col = System.Collections.Generic;
using re = System.Text.RegularExpressions;
using enc = Dropbox.Api.Stone;
/// <summary>
/// <para>Created Classification report.</para>
/// </summary>
public class ClassificationCreateReportDetails
{
#pragma warning disable 108
/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<ClassificationCreateReportDetails> Encoder = new ClassificationCreateReportDetailsEncoder();
/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<ClassificationCreateReportDetails> Decoder = new ClassificationCreateReportDetailsDecoder();
/// <summary>
/// <para>Initializes a new instance of the <see
/// cref="ClassificationCreateReportDetails" /> class.</para>
/// </summary>
public ClassificationCreateReportDetails()
{
}
#region Encoder class
/// <summary>
/// <para>Encoder for <see cref="ClassificationCreateReportDetails" />.</para>
/// </summary>
private class ClassificationCreateReportDetailsEncoder : enc.StructEncoder<ClassificationCreateReportDetails>
{
/// <summary>
/// <para>Encode fields of given value.</para>
/// </summary>
/// <param name="value">The value.</param>
/// <param name="writer">The writer.</param>
public override void EncodeFields(ClassificationCreateReportDetails value, enc.IJsonWriter writer)
{
}
}
#endregion
#region Decoder class
/// <summary>
/// <para>Decoder for <see cref="ClassificationCreateReportDetails" />.</para>
/// </summary>
private class ClassificationCreateReportDetailsDecoder : enc.StructDecoder<ClassificationCreateReportDetails>
{
/// <summary>
/// <para>Create a new instance of type <see
/// cref="ClassificationCreateReportDetails" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override ClassificationCreateReportDetails Create()
{
return new ClassificationCreateReportDetails();
}
/// <summary>
/// <para>Set given field.</para>
/// </summary>
/// <param name="value">The field value.</param>
/// <param name="fieldName">The field name.</param>
/// <param name="reader">The json reader.</param>
protected override void SetField(ClassificationCreateReportDetails value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
default:
reader.Skip();
break;
}
}
}
#endregion
}
}
| 33.526316 | 134 | 0.572998 | [
"MIT"
] | AlirezaMaddah/dropbox-sdk-dotnet | dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/ClassificationCreateReportDetails.cs | 3,185 | C# |
using System.Collections.Generic;
using System.Threading.Tasks;
using FirebaseAdmin.Auth;
using PolynomteePubQuiz.Identity.Interfaces;
namespace PolynomteePubQuiz.Identity.Classes
{
public class FirebaseJwtValidator : IJwtValidator
{
public async Task<MinimalUser?> GetUserFromToken(string token)
{
{
try
{
var decodedToken = await FirebaseAuth.DefaultInstance
.VerifyIdTokenAsync(token);
decodedToken.Claims.TryGetValue("roles", out var roles);
var roleSet = new HashSet<string>();
if (roles is not null)
{
foreach (var role in (string[]) roles)
{
roleSet.Add(role);
}
}
return new MinimalUser()
{
Id = decodedToken.Uid,
Roles = roleSet
};
}
catch (FirebaseAuthException)
{
return await Task.FromResult<MinimalUser?>(null);
}
}
}
}
} | 30.853659 | 76 | 0.450593 | [
"MIT"
] | DominikSudwischer/PolynomteePubQuiz | PolynomteePubQuiz/Identity/Classes/FirebaseJwtValidator.cs | 1,265 | C# |
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
namespace Microsoft.CST.OpenSource.FindSquats.Mutators
{
using System.Collections.Generic;
/// <summary>
/// Generates mutations for if a character was duplicated in the string. Or duplicated and replaced.
/// </summary>
public class DuplicatorMutator : IMutator
{
public MutatorType Kind { get; } = MutatorType.Duplicator;
public IEnumerable<Mutation> Generate(string arg)
{
for (int i = 0; i < arg.Length; i++)
{
yield return new Mutation(
mutated: string.Concat(arg[..i], arg[i], arg[i..]),
original: arg,
mutator: Kind,
reason: $"Letter Duplicated: {arg[i]}");
}
for (int i = 0; i < arg.Length - 2; i++)
{
yield return new Mutation(
mutated: string.Concat(arg[..(i + 1)], arg[i], arg[(i + 2)..]),
original: arg,
mutator: Kind,
reason: "Letter Duplicated and Replaced");
}
yield return new Mutation(
mutated: string.Concat(arg[..arg.Length], arg[^1]),
original: arg,
mutator: Kind,
reason: "Letter Duplicated and Replaced");
}
}
} | 34.390244 | 104 | 0.505674 | [
"MIT"
] | jpinz/OSSGadget | src/oss-find-squats-lib/Mutators/DuplicatorMutator.cs | 1,410 | C# |
using LagoVista.AppLoader.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace LagoVista.AppLoader.Views
{
/// <summary>
/// Interaction logic for DeviceReposView.xaml
/// </summary>
public partial class DeviceReposView : LagoVistaPage
{
public DeviceReposView()
{
InitializeComponent();
}
}
}
| 23.433333 | 56 | 0.732575 | [
"MIT"
] | LagoVista/CrossPlatform | samples/LagoVista.AppLoader/Views/DeviceReposView.xaml.cs | 705 | C# |
namespace hafta1WebApi.Models
{
public class QueryParams
{
public int PageSize { get; set; } = 10;
public int Page { get; set; } = 1;
public string OrderType { get; set; } = "desc";
public string? Search { get; set; }
public int? PriceMax { get; set; }
public int? StockMin { get; set; }
}
}
| 23.666667 | 55 | 0.549296 | [
"MIT"
] | Patika-dev-Unlu-Co-Net-Bootcamp/ErtanAktasWeek5 | hafta1WebApi/Models/QueryParams.cs | 357 | C# |
/******************************************************************************
* Copyright (C) Ultraleap, Inc. 2011-2020. *
* Ultraleap proprietary and confidential. *
* *
* Use subject to the terms of the Leap Motion SDK Agreement available at *
* https://developer.leapmotion.com/sdk_agreement, or another agreement *
* between Ultraleap and you, your company or other organization. *
******************************************************************************/
using System;
using System.Runtime.InteropServices;
using NUnit.Framework;
using LeapInternal;
namespace Leap.LeapCSharp.Tests {
[StructLayout(LayoutKind.Sequential)]
struct TestMarshaledStruct {
public int id;
public TestMarshaledStruct(int t) { id = t; }
}
[TestFixture()]
public class StructMarshalTests {
public const int ARRAY_SIZE = 5;
public const int ARRAY_TEST_INDEX = 3;
public const int TEST_ID = 23;
private int _size;
private IntPtr _ptr;
private TestMarshaledStruct _testStruct;
[SetUp]
public void Setup() {
_size = Marshal.SizeOf(typeof(TestMarshaledStruct));
//For each test, allocate a chunk of memory large enough for [ARRAY_SIZE] structs
_ptr = Marshal.AllocHGlobal(_size * ARRAY_SIZE);
_testStruct = new TestMarshaledStruct(TEST_ID);
}
[TearDown]
public void Teardown() {
_size = 0;
Marshal.FreeHGlobal(_ptr);
_ptr = IntPtr.Zero;
_testStruct = new TestMarshaledStruct();
}
[Test]
public void SizeTest() {
int reportedSize = StructMarshal<TestMarshaledStruct>.Size;
Assert.That(_size, Is.EqualTo(reportedSize), "Size must match Marshal.SizeOf.");
}
[Test]
public void PtrToStructTest() {
Marshal.StructureToPtr(_testStruct, _ptr, false);
TestMarshaledStruct output;
StructMarshal<TestMarshaledStruct>.PtrToStruct(_ptr, out output);
Assert.That(_testStruct.id, Is.EqualTo(output.id), "Input must match output.");
}
[Test]
public void ArrayElementToStructTest() {
Marshal.StructureToPtr(_testStruct, (IntPtr)((long)_ptr + _size * ARRAY_TEST_INDEX), false);
TestMarshaledStruct output;
StructMarshal<TestMarshaledStruct>.ArrayElementToStruct(_ptr, ARRAY_TEST_INDEX, out output);
Assert.That(_testStruct.id, Is.EqualTo(output.id), "Input must match output.");
}
}
}
| 34.418919 | 98 | 0.611307 | [
"BSD-3-Clause"
] | HyperLethalVector/ChristmasEsky | Assets/Plugins/LeapMotion/Core/Tests/Editor/StructMarshalTests.cs | 2,547 | C# |
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using Netch.Controllers;
using Netch.Interfaces;
using Netch.Models;
namespace Netch.Servers.ShadowsocksR
{
public class SSRController : Guard, IServerController
{
public SSRController() : base("ShadowsocksR.exe")
{
}
protected override IEnumerable<string> StartedKeywords => new[] { "listening at" };
protected override IEnumerable<string> FailedKeywords => new[] { "Invalid config path", "usage" };
public override string Name => "ShadowsocksR";
public ushort? Socks5LocalPort { get; set; }
public string? LocalAddress { get; set; }
public async Task<Socks5> StartAsync(Server s)
{
var server = (ShadowsocksR)s;
var arguments = new object?[]
{
"-s", await server.AutoResolveHostnameAsync(),
"-p", server.Port,
"-k", server.Password,
"-m", server.EncryptMethod,
"-t", 120,
"-O", server.Protocol,
"-G", server.ProtocolParam,
"-o", server.OBFS,
"-g", server.OBFSParam,
"-b", this.LocalAddress(),
"-l", this.Socks5LocalPort(),
"-u", SpecialArgument.Flag
};
await StartGuardAsync(Arguments.Format(arguments));
return new Socks5Bridge(IPAddress.Loopback.ToString(), this.Socks5LocalPort(), server.Hostname);
}
}
} | 30.941176 | 108 | 0.568441 | [
"MIT"
] | afula/ostrich-windows | Netch/Servers/ShadowsocksR/SSRController.cs | 1,578 | C# |
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine.Experimental.Input.Layouts;
using UnityEngine.Experimental.Input.Utilities;
namespace UnityEngine.Experimental.Input.Editor
{
internal class AddControlSchemePopup : PopupWindowContent
{
public static class Styles
{
public static GUIStyle headerLabel = new GUIStyle(EditorStyles.toolbar);
static Styles()
{
headerLabel.alignment = TextAnchor.MiddleCenter;
headerLabel.fontStyle = FontStyle.Bold;
headerLabel.padding.left = 10;
}
}
private int m_ControlSchemeIndex = -1;
private ReorderableList m_DevicesReorderableList;
private List<DeviceEntryForList> m_Devices = new List<DeviceEntryForList>();
private string m_InputControlSchemeName = "New control scheme";
private int m_RequirementsOptionsChoice;
private InputActionAssetManager m_AssetManager;
private InputActionWindowToolbar m_Toolbar;
private bool m_SetFocus;
private Vector2 m_SchemaNameLabelSize;
private float m_RequirementHeights;
private float m_ButtonsAndLabelsHeights;
private static readonly GUIContent m_RequirementGUI = new GUIContent("Requirements:");
private static readonly GUIContent m_AddControlSchemeGUI = new GUIContent("Add control scheme");
private static readonly GUIContent m_SchemaNameGUI = new GUIContent("Scheme Name");
private static readonly Vector2 s_DefaultSize = new Vector2(300, 200);
private static readonly string[] choices = { "Optional", "Required" };
private string m_OriginalName;
private Action m_Apply;
public AddControlSchemePopup(InputActionAssetManager assetManager, InputActionWindowToolbar toolbar, Action apply)
{
m_AssetManager = assetManager;
m_Toolbar = toolbar;
m_SetFocus = true;
m_Apply = apply;
}
public void SetSchemaForEditing(string schemaName)
{
for (int i = 0; i < m_AssetManager.m_AssetObjectForEditing.m_ControlSchemes.Length; i++)
{
if (m_AssetManager.m_AssetObjectForEditing.m_ControlSchemes[i].name == schemaName)
{
m_ControlSchemeIndex = i;
break;
}
}
SetSchemaParametersFrom(schemaName);
m_OriginalName = schemaName;
}
public void DuplicateParametersFrom(string schemaName)
{
SetSchemaParametersFrom(schemaName);
SetUniqueName();
m_OriginalName = m_InputControlSchemeName;
}
private void SetSchemaParametersFrom(string schemaName)
{
m_InputControlSchemeName = m_AssetManager.m_AssetObjectForEditing.GetControlScheme(schemaName).name;
var schema = m_AssetManager.m_AssetObjectForEditing.GetControlScheme(schemaName);
m_Devices = schema.deviceRequirements.Select(a => new DeviceEntryForList()
{
name = a.controlPath.Substring(1, a.controlPath.Length - 2),
deviceRequirement = a
}).ToList();
}
public override Vector2 GetWindowSize()
{
return m_ButtonsAndLabelsHeights > 0 ? new Vector2(300, m_ButtonsAndLabelsHeights) : s_DefaultSize;
}
public override void OnOpen()
{
m_DevicesReorderableList = new ReorderableList(m_Devices, typeof(InputControlScheme.DeviceRequirement));
m_DevicesReorderableList.headerHeight = 2;
m_DevicesReorderableList.onAddCallback += OnDeviceAdd;
m_DevicesReorderableList.onRemoveCallback += OnDeviceRemove;
}
private void OnDeviceRemove(ReorderableList list)
{
list.list.RemoveAt(list.index);
list.index = -1;
}
private void OnDeviceAdd(ReorderableList list)
{
var a = new AddDeviceDropdown(AddElement);
a.Show(new Rect(Event.current.mousePosition, Vector2.zero));
}
private class AddDeviceDropdown : AdvancedDropdown
{
Action<string, string> m_AddElement;
public AddDeviceDropdown(Action<string, string> addElement)
: base(new AdvancedDropdownState())
{
m_AddElement = addElement;
}
protected override AdvancedDropdownItem BuildRoot()
{
var root = new AdvancedDropdownItem("");
var deviceList = GetDeviceOptions();
deviceList.Sort();
foreach (var device in deviceList)
{
root.AddChild(new AddDeviceDropdownItem(device.ToString(), device.id));
}
return root;
}
protected override void ItemSelected(AdvancedDropdownItem item)
{
m_AddElement((item as AddDeviceDropdownItem).name, (item as AddDeviceDropdownItem).m_DeviceId);
}
private class AddDeviceDropdownItem : AdvancedDropdownItem
{
public string m_DeviceId;
public AddDeviceDropdownItem(string name, string id)
: base(name)
{
m_DeviceId = id;
}
}
}
private static List<DeviceEntryForList> GetDeviceOptions()
{
var devices = new List<DeviceEntryForList>();
BuildTreeForAbstractDevices(devices);
BuildTreeForSpecificDevices(devices);
return devices;
}
private static void BuildTreeForAbstractDevices(List<DeviceEntryForList> deviceList)
{
foreach (var deviceLayout in EditorInputControlLayoutCache.allDeviceLayouts)
AddDeviceTreeItem(deviceLayout, deviceList);
}
private static void BuildTreeForSpecificDevices(List<DeviceEntryForList> deviceList)
{
foreach (var layout in EditorInputControlLayoutCache.allProductLayouts)
{
var rootLayoutName = InputControlLayout.s_Layouts.GetRootLayoutName(layout.name).ToString();
if (string.IsNullOrEmpty(rootLayoutName))
rootLayoutName = "Other";
else
rootLayoutName = rootLayoutName.GetPlural();
AddDeviceTreeItem(layout, deviceList);
}
}
private static void AddDeviceTreeItem(InputControlLayout layout, List<DeviceEntryForList> deviceList)
{
var entry = new DeviceEntryForList
{
name = layout.name
};
deviceList.Add(entry);
foreach (var commonUsage in layout.commonUsages)
{
var entryWithUsage = new DeviceEntryForList
{
name = layout.name,
commonUsage = commonUsage
};
deviceList.Add(entryWithUsage);
}
}
private void AddElement(string name, string controlPath)
{
if (!m_DevicesReorderableList.list.Cast<DeviceEntryForList>().Any(a => a.name == name))
{
var device = new InputControlScheme.DeviceRequirement
{
controlPath = controlPath
};
m_Devices.Add(new DeviceEntryForList(){name = name, deviceRequirement = device});
m_DevicesReorderableList.index = m_DevicesReorderableList.list.Count - 1;
}
}
public override void OnGUI(Rect rect)
{
if (Event.current.type == EventType.KeyDown)
{
if (Event.current.keyCode == KeyCode.Escape)
{
editorWindow.Close();
editorWindow.Close();
Event.current.Use();
}
}
if (Event.current.type == EventType.Repaint)
m_ButtonsAndLabelsHeights = 0;
GUILayout.BeginArea(rect);
DrawTopBar();
EditorGUILayout.BeginVertical(EditorStyles.label);
DrawSpace();
DrawNameEditTextField();
DrawSpace();
DrawDeviceList();
DrawConfirmationButton();
EditorGUILayout.EndVertical();
GUILayout.EndArea();
}
private void DrawConfirmationButton()
{
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel", GUILayout.ExpandWidth(true)))
{
editorWindow.Close();
}
EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(m_InputControlSchemeName) || m_DevicesReorderableList.list.Count <= 0);
if (m_ControlSchemeIndex == -1)
{
if (GUILayout.Button("Add", GUILayout.ExpandWidth(true)))
{
Add();
}
}
else
{
if (GUILayout.Button("Save", GUILayout.ExpandWidth(true)))
{
Save();
}
}
if (Event.current.type == EventType.Repaint)
m_ButtonsAndLabelsHeights += GUILayoutUtility.GetLastRect().height;
EditorGUI.EndDisabledGroup();
EditorGUILayout.EndHorizontal();
}
private void DrawDeviceList()
{
EditorGUILayout.BeginHorizontal(EditorStyles.label);
var requirementsLabelSize = EditorStyles.label.CalcSize(m_RequirementGUI);
var deviceListRect = GUILayoutUtility.GetRect(GetWindowSize().x - requirementsLabelSize.x - 20, m_DevicesReorderableList.GetHeight());
m_DevicesReorderableList.DoList(deviceListRect);
var requirementsHeight = DrawRequirementsCheckboxes();
var listHeight = m_DevicesReorderableList.GetHeight() + EditorGUIUtility.singleLineHeight * 3;
if (Event.current.type == EventType.Repaint)
{
if (listHeight < requirementsHeight)
{
m_ButtonsAndLabelsHeights += requirementsHeight;
}
else
{
m_ButtonsAndLabelsHeights += listHeight;
}
}
EditorGUILayout.EndHorizontal();
}
private void DrawSpace()
{
GUILayout.Space(6f);
if (Event.current.type == EventType.Repaint)
m_ButtonsAndLabelsHeights += 6f;
}
private void DrawTopBar()
{
EditorGUILayout.LabelField(m_AddControlSchemeGUI, Styles.headerLabel);
if (Event.current.type == EventType.Repaint)
m_ButtonsAndLabelsHeights += GUILayoutUtility.GetLastRect().height;
}
private void DrawNameEditTextField()
{
EditorGUILayout.BeginHorizontal();
m_SchemaNameLabelSize = EditorStyles.label.CalcSize(m_RequirementGUI);
EditorGUILayout.LabelField(m_SchemaNameGUI, GUILayout.Width(m_SchemaNameLabelSize.x));
GUI.SetNextControlName("SchemaName");
EditorGUI.BeginChangeCheck();
m_InputControlSchemeName = EditorGUILayout.TextField(m_InputControlSchemeName);
if (EditorGUI.EndChangeCheck())
{
SetUniqueName();
}
if (m_SetFocus)
{
EditorGUI.FocusTextInControl("SchemaName");
m_SetFocus = false;
}
EditorGUILayout.EndHorizontal();
}
private float DrawRequirementsCheckboxes()
{
EditorGUILayout.BeginVertical();
EditorGUILayout.LabelField(m_RequirementGUI, GUILayout.Width(200));
var requirementHeights = GUILayoutUtility.GetLastRect().y;
EditorGUI.BeginDisabledGroup(m_DevicesReorderableList.index == -1);
var requirementsOption = -1;
if (m_DevicesReorderableList.index >= 0)
{
var deviceEntryForList = (DeviceEntryForList)m_DevicesReorderableList.list[m_DevicesReorderableList.index];
requirementsOption = deviceEntryForList.deviceRequirement.isOptional ? 0 : 1;
}
EditorGUI.BeginChangeCheck();
requirementsOption = GUILayout.SelectionGrid(requirementsOption, choices, 1, EditorStyles.radioButton);
requirementHeights += GUILayoutUtility.GetLastRect().y;
if (EditorGUI.EndChangeCheck())
{
m_Devices[m_DevicesReorderableList.index].deviceRequirement.isOptional = requirementsOption == 0;
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.EndVertical();
return requirementHeights;
}
private void Save()
{
m_AssetManager.m_AssetObjectForEditing.m_ControlSchemes[m_ControlSchemeIndex].m_DeviceRequirements = m_Devices.Select(a => a.deviceRequirement).ToArray();
m_AssetManager.m_AssetObjectForEditing.m_ControlSchemes[m_ControlSchemeIndex].m_Name = m_InputControlSchemeName;
m_Apply();
m_Toolbar.SelectControlScheme(m_InputControlSchemeName);
editorWindow.Close();
}
private void Add()
{
var controlScheme = new InputControlScheme(m_InputControlSchemeName)
{
m_DeviceRequirements = m_Devices.Select(a => a.deviceRequirement).ToArray()
};
m_AssetManager.m_AssetObjectForEditing.AddControlScheme(controlScheme);
m_Apply();
m_Toolbar.SelectControlScheme(m_InputControlSchemeName);
m_Toolbar.OnSchemeChanged(m_Toolbar.selectedControlSchemeName);
editorWindow.Close();
}
class DeviceEntryForList : IComparable
{
public string name;
public InputControlScheme.DeviceRequirement deviceRequirement;
public InternedString commonUsage;
public string id
{
get
{
if (string.IsNullOrEmpty(commonUsage))
{
return $"<{name}>";
}
return $"<{name}>{{{commonUsage}}}";
}
}
public override string ToString()
{
if (string.IsNullOrEmpty(commonUsage))
return name;
return $"{name} {commonUsage}";
}
public int CompareTo(object obj)
{
var c = (DeviceEntryForList)obj;
return string.Compare(id, c.id);
}
}
public void SetUniqueName()
{
if (m_InputControlSchemeName == m_OriginalName)
return;
m_AssetManager.serializedObject.Update();
var controlSchemeArrayProperty = m_AssetManager.serializedObject.FindProperty("m_ControlSchemes");
m_InputControlSchemeName = InputActionSerializationHelpers.FindUniqueName(controlSchemeArrayProperty, m_InputControlSchemeName);
}
}
}
#endif // UNITY_EDITOR
| 37.449519 | 166 | 0.586944 | [
"MIT"
] | DrPaulRobertson/custom-controller-demos | DistanceDemo/Library/PackageCache/com.unity.inputsystem@0.2.0-preview/InputSystem/Editor/InputActionAsset/AddControlSchemePopup.cs | 15,579 | C# |
using UnityEngine;
using UnityEditor;
using BitsNBobs.Pool;
namespace BitsNBobs.Pool.Editor
{
[CustomEditor(typeof(RecyclerManager))]
internal class RecyclerManagerEditor : UnityEditor.Editor
{
/// <summary>
/// Recyclebin List
/// </summary>
SerializedProperty pools;
private void OnEnable()
{
pools = serializedObject.FindProperty("Pools");
}
void RemoveButton(int index)
{
EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
if (GUILayout.Button(new GUIContent("X")))
{
pools.DeleteArrayElementAtIndex(index);
}
EditorGUI.EndDisabledGroup();
}
public override void OnInspectorGUI()
{
EditorGUILayout.LabelField("Manage your object pools here", new GUIStyle(EditorStyles.label)
{
alignment = TextAnchor.MiddleCenter,
fontSize = 10,
fontStyle = FontStyle.Normal
}, GUILayout.Height(16));
EditorGUILayout.Space();
serializedObject.Update();
for (int i = 0; i < pools.arraySize; i++)
{
SerializedProperty current = pools.GetArrayElementAtIndex(i);
SerializedProperty _label = current.FindPropertyRelative("label"); ;
bool isvalid = !string.IsNullOrEmpty(_label.stringValue);
GUILayout.BeginVertical(GUI.skin.box);
EditorGUILayout.BeginHorizontal();
GUILayout.Space(10);
current.isExpanded = EditorGUILayout.Foldout(current.isExpanded, isvalid ? _label.stringValue : "-No label-");
GUILayout.FlexibleSpace();
RemoveButton(i);
EditorGUILayout.EndHorizontal();
if (i < pools.arraySize && i >= 0)
{
SerializedProperty _maxitems = current.FindPropertyRelative("MaxItems");
SerializedProperty _prefab = current.FindPropertyRelative("Prefab");
SerializedProperty _preloadcount = current.FindPropertyRelative("PreAllocateCount");
SerializedProperty _PoolParent = current.FindPropertyRelative("PoolParent");
if (current.isExpanded)
{
EditorGUILayout.Space();
_label.stringValue = EditorGUILayout.TextField("Label", _label.stringValue);
_maxitems.intValue = EditorGUILayout.IntField("Max Items", Mathf.Clamp(_maxitems.intValue , 1 , int.MaxValue));
EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
_preloadcount.intValue = EditorGUILayout.IntField("Pre-Allocate Count",
Mathf.Clamp(_preloadcount.intValue, 0, _maxitems.intValue));
_prefab.objectReferenceValue = EditorGUILayout.ObjectField("Prefab", _prefab.objectReferenceValue,
typeof(GameObject), false);
_PoolParent.objectReferenceValue = EditorGUILayout.ObjectField("Prefab Parent", _PoolParent.objectReferenceValue,
typeof(Transform), true);
EditorGUI.EndDisabledGroup();
}
}
GUILayout.Space(2);
GUILayout.EndVertical();
}
if (!Application.isPlaying)
{
GUILayout.Space(2);
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Add new", GUI.skin.FindStyle("LargeButton") , GUILayout.Height(25f),GUILayout.Width(150)))
{
int index = pools.arraySize > 0 ? pools.arraySize : 0;
pools.InsertArrayElementAtIndex(index);
SerializedProperty prop = pools.GetArrayElementAtIndex(index);
SerializedProperty label = prop.FindPropertyRelative("label");
label.stringValue = string.Empty;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.Space(5f);
}
serializedObject.ApplyModifiedProperties();
}
}
}
| 33.131387 | 137 | 0.543952 | [
"MIT"
] | psarras/BitsNBobs.Utilities | Packages/BitsNBobs.Utilities/Editor/Pool/RecyclerManagerEditor.cs | 4,539 | C# |
#if !LIGHT_EXPRESSION
using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using NUnit.Framework;
namespace FastExpressionCompiler.IssueTests
{
[TestFixture]
public class Issue179_Add_something_like_LambdaExpression_CompileToMethod
{
[Test]
public void Test()
{
var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("MyDynamicAssembly"), AssemblyBuilderAccess.Run);
var moduleBuilder = assemblyBuilder.DefineDynamicModule("MyDynamicModule");
var typeBuilder = moduleBuilder.DefineType("MyType", TypeAttributes.Public);
var methodBuilder = typeBuilder.DefineMethod("MyAdd",
MethodAttributes.Public | MethodAttributes.Static, // static is required to be able to compile to method
CallingConventions.Standard,
typeof(int), new[] { typeof(int), typeof(int) });
var paramA = Expression.Parameter(typeof(int));
var paramB = Expression.Parameter(typeof(int));
var funcExpr = Expression.Lambda<Func<int, int, int>>(
Expression.Add(paramA, paramB),
paramA, paramB);
funcExpr.CompileFastToIL(methodBuilder.GetILGenerator());
var dynamicType = typeBuilder.CreateType();
var myAddMethod = dynamicType.GetTypeInfo().GetDeclaredMethod("MyAdd");
var func = (Func<int, int, int>)Delegate.CreateDelegate(funcExpr.Type, myAddMethod);
Assert.AreEqual(42, func(39, 3));
}
}
}
#endif
| 34.425532 | 138 | 0.661928 | [
"MIT"
] | MarchingCube/FastExpressionCompiler | test/FastExpressionCompiler.IssueTests/Issue179_Add_something_like_LambdaExpression_CompileToMethod.cs | 1,620 | C# |
using UnityEngine;
namespace Mirror.Experimental
{
[AddComponentMenu("Network/ Experimental/Network Rigidbody")]
[HelpURL("https://mirror-networking.gitbook.io/docs/components/network-rigidbody")]
public class NetworkRigidbody : NetworkBehaviour
{
[Header("Settings")]
[SerializeField] internal Rigidbody target = null;
[Tooltip("Set to true if moves come from owner client, set to false if moves always come from server")]
public bool clientAuthority = false;
[Header("Velocity")]
[Tooltip("Syncs Velocity every SyncInterval")]
[SerializeField] bool syncVelocity = true;
[Tooltip("Set velocity to 0 each frame (only works if syncVelocity is false")]
[SerializeField] bool clearVelocity = false;
[Tooltip("Only Syncs Value if distance between previous and current is great than sensitivity")]
[SerializeField] float velocitySensitivity = 0.1f;
[Header("Angular Velocity")]
[Tooltip("Syncs AngularVelocity every SyncInterval")]
[SerializeField] bool syncAngularVelocity = true;
[Tooltip("Set angularVelocity to 0 each frame (only works if syncAngularVelocity is false")]
[SerializeField] bool clearAngularVelocity = false;
[Tooltip("Only Syncs Value if distance between previous and current is great than sensitivity")]
[SerializeField] float angularVelocitySensitivity = 0.1f;
/// <summary>
/// Values sent on client with authority after they are sent to the server
/// </summary>
readonly ClientSyncState previousValue = new ClientSyncState();
void OnValidate()
{
if (target == null)
{
target = GetComponent<Rigidbody>();
}
}
#region Sync vars
[SyncVar(hook = nameof(OnVelocityChanged))]
Vector3 velocity;
[SyncVar(hook = nameof(OnAngularVelocityChanged))]
Vector3 angularVelocity;
[SyncVar(hook = nameof(OnIsKinematicChanged))]
bool isKinematic;
[SyncVar(hook = nameof(OnUseGravityChanged))]
bool useGravity;
[SyncVar(hook = nameof(OnuDragChanged))]
float drag;
[SyncVar(hook = nameof(OnAngularDragChanged))]
float angularDrag;
/// <summary>
/// Ignore value if is host or client with Authority
/// </summary>
/// <returns></returns>
bool IgnoreSync => isServer || ClientWithAuthority;
bool ClientWithAuthority => clientAuthority && hasAuthority;
void OnVelocityChanged(Vector3 _, Vector3 newValue)
{
if (IgnoreSync)
return;
target.velocity = newValue;
}
void OnAngularVelocityChanged(Vector3 _, Vector3 newValue)
{
if (IgnoreSync)
return;
target.angularVelocity = newValue;
}
void OnIsKinematicChanged(bool _, bool newValue)
{
if (IgnoreSync)
return;
target.isKinematic = newValue;
}
void OnUseGravityChanged(bool _, bool newValue)
{
if (IgnoreSync)
return;
target.useGravity = newValue;
}
void OnuDragChanged(float _, float newValue)
{
if (IgnoreSync)
return;
target.drag = newValue;
}
void OnAngularDragChanged(float _, float newValue)
{
if (IgnoreSync)
return;
target.angularDrag = newValue;
}
#endregion
internal void Update()
{
if (isServer)
{
SyncToClients();
}
else if (ClientWithAuthority)
{
SendToServer();
}
}
internal void FixedUpdate()
{
if (clearAngularVelocity && !syncAngularVelocity)
{
target.angularVelocity = Vector3.zero;
}
if (clearVelocity && !syncVelocity)
{
target.velocity = Vector3.zero;
}
}
/// <summary>
/// Updates sync var values on server so that they sync to the client
/// </summary>
[Server]
void SyncToClients()
{
// only update if they have changed more than Sensitivity
Vector3 currentVelocity = syncVelocity ? target.velocity : default;
Vector3 currentAngularVelocity = syncAngularVelocity ? target.angularVelocity : default;
bool velocityChanged = syncVelocity && ((previousValue.velocity - currentVelocity).sqrMagnitude > velocitySensitivity * velocitySensitivity);
bool angularVelocityChanged = syncAngularVelocity && ((previousValue.angularVelocity - currentAngularVelocity).sqrMagnitude > angularVelocitySensitivity * angularVelocitySensitivity);
if (velocityChanged)
{
velocity = currentVelocity;
previousValue.velocity = currentVelocity;
}
if (angularVelocityChanged)
{
angularVelocity = currentAngularVelocity;
previousValue.angularVelocity = currentAngularVelocity;
}
// other rigidbody settings
isKinematic = target.isKinematic;
useGravity = target.useGravity;
drag = target.drag;
angularDrag = target.angularDrag;
}
/// <summary>
/// Uses Command to send values to server
/// </summary>
[Client]
void SendToServer()
{
if (!hasAuthority)
{
Debug.LogWarning("SendToServer called without authority");
return;
}
SendVelocity();
SendRigidBodySettings();
}
[Client]
void SendVelocity()
{
float now = Time.time;
if (now < previousValue.nextSyncTime)
return;
Vector3 currentVelocity = syncVelocity ? target.velocity : default;
Vector3 currentAngularVelocity = syncAngularVelocity ? target.angularVelocity : default;
bool velocityChanged = syncVelocity && ((previousValue.velocity - currentVelocity).sqrMagnitude > velocitySensitivity * velocitySensitivity);
bool angularVelocityChanged = syncAngularVelocity && ((previousValue.angularVelocity - currentAngularVelocity).sqrMagnitude > angularVelocitySensitivity * angularVelocitySensitivity);
// if angularVelocity has changed it is likely that velocity has also changed so just sync both values
// however if only velocity has changed just send velocity
if (angularVelocityChanged)
{
CmdSendVelocityAndAngular(currentVelocity, currentAngularVelocity);
previousValue.velocity = currentVelocity;
previousValue.angularVelocity = currentAngularVelocity;
}
else if (velocityChanged)
{
CmdSendVelocity(currentVelocity);
previousValue.velocity = currentVelocity;
}
// only update syncTime if either has changed
if (angularVelocityChanged || velocityChanged)
{
previousValue.nextSyncTime = now + syncInterval;
}
}
[Client]
void SendRigidBodySettings()
{
// These shouldn't change often so it is ok to send in their own Command
if (previousValue.isKinematic != target.isKinematic)
{
CmdSendIsKinematic(target.isKinematic);
previousValue.isKinematic = target.isKinematic;
}
if (previousValue.useGravity != target.useGravity)
{
CmdSendUseGravity(target.useGravity);
previousValue.useGravity = target.useGravity;
}
if (previousValue.drag != target.drag)
{
CmdSendDrag(target.drag);
previousValue.drag = target.drag;
}
if (previousValue.angularDrag != target.angularDrag)
{
CmdSendAngularDrag(target.angularDrag);
previousValue.angularDrag = target.angularDrag;
}
}
/// <summary>
/// Called when only Velocity has changed on the client
/// </summary>
[Command]
void CmdSendVelocity(Vector3 velocity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.velocity = velocity;
target.velocity = velocity;
}
/// <summary>
/// Called when angularVelocity has changed on the client
/// </summary>
[Command]
void CmdSendVelocityAndAngular(Vector3 velocity, Vector3 angularVelocity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
if (syncVelocity)
{
this.velocity = velocity;
target.velocity = velocity;
}
this.angularVelocity = angularVelocity;
target.angularVelocity = angularVelocity;
}
[Command]
void CmdSendIsKinematic(bool isKinematic)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.isKinematic = isKinematic;
target.isKinematic = isKinematic;
}
[Command]
void CmdSendUseGravity(bool useGravity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.useGravity = useGravity;
target.useGravity = useGravity;
}
[Command]
void CmdSendDrag(float drag)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.drag = drag;
target.drag = drag;
}
[Command]
void CmdSendAngularDrag(float angularDrag)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.angularDrag = angularDrag;
target.angularDrag = angularDrag;
}
/// <summary>
/// holds previously synced values
/// </summary>
public class ClientSyncState
{
/// <summary>
/// Next sync time that velocity will be synced, based on syncInterval.
/// </summary>
public float nextSyncTime;
public Vector3 velocity;
public Vector3 angularVelocity;
public bool isKinematic;
public bool useGravity;
public float drag;
public float angularDrag;
}
}
}
| 31.18232 | 195 | 0.56724 | [
"MIT"
] | BenThrelfall/DungeonTool | Assets/Mirror/Components/Experimental/NetworkRigidbody.cs | 11,288 | C# |
using System.Collections.Generic;
using Merchello.Core.Models;
namespace Merchello.Core.Gateways.Shipping
{
/// <summary>
/// Defines a shipping context
/// </summary>
public interface IShippingContext : IGatewayProviderTypedContextBase<ShippingGatewayProviderBase>
{
/// <summary>
/// Returns a collection of all <see cref="IShipmentRateQuote"/> that are available for the <see cref="IShipment"/>
/// </summary>
/// <param name="shipment">The <see cref="IShipment"/> to quote</param>
/// <returns>A collection of <see cref="IShipmentRateQuote"/></returns>
IEnumerable<IShipmentRateQuote> GetShipRateQuotesForShipment(IShipment shipment);
/// <summary>
/// Returns a list of all countries that can be assigned to a shipment
/// </summary>
/// <returns></returns>
IEnumerable<ICountry> GetAllowedShipmentDestinationCountries();
/// <summary>
/// Gets a collection of <see cref="ShippingGatewayProviderBase"/> by ship country
/// </summary>
/// <param name="shipCountry"></param>
/// <returns></returns>
IEnumerable<IShippingGatewayProvider> GetGatewayProvidersByShipCountry(IShipCountry shipCountry);
}
} | 38.454545 | 123 | 0.660362 | [
"MIT"
] | bowserm/Merchello | src/Merchello.Core/Gateways/Shipping/IShippingContext.cs | 1,271 | C# |
using Newtonsoft.Json;
using System;
namespace Reddit.Things
{
[Serializable]
public class PostResult : BaseResult
{
[JsonProperty("data")]
public PostResultData Data;
}
}
| 15.846154 | 40 | 0.650485 | [
"MIT"
] | EmielD/Reddit.NET | src/Reddit.NET/Things/Post/PostResult.cs | 208 | C# |
using Xamarin.Forms;
namespace DotNetRu.Clients.UI.Controls
{
public partial class FooterDivider : ContentView
{
public FooterDivider()
{
this.InitializeComponent();
}
}
}
| 15.928571 | 52 | 0.605381 | [
"MIT"
] | DotNetRu/App | DotNetRu.Clients.UI/Controls/FooterDivider.xaml.cs | 225 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace gov.va.medora.mdws.dto
{
public class Synopsis
{
public SiteArray treatingFacilities;
public TaggedAllergyArrays allergies;
public TaggedTextArray immunizations;
public TaggedMedicationArrays medications;
public TaggedMedicationArrays supplements;
public TaggedTextArray healthSummaries;
public TaggedTextArray detailedHealthSummaries;
public TaggedVitalSignSetArrays vitalSigns;
public TaggedChemHemRptArrays chemHemReports;
public TaggedMicrobiologyRptArrays microbiologyReports;
public TaggedProblemArrays problemLists;
public TaggedRadiologyReportArrays radiologyReports;
public TaggedSurgeryReportArrays surgeryReports;
public TaggedTextArray advanceDirectives;
public Synopsis() { }
}
} | 32.964286 | 63 | 0.748646 | [
"Apache-2.0"
] | VHAINNOVATIONS/RAPTOR | OtherComponents/MDWSvistalayer/MDWS Source/mdws/mdws/src/dto/Synopsis.cs | 925 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.SolutionCrawler.State
{
internal abstract class AbstractAnalyzerState<TKey, TValue, TData>
{
protected readonly ConcurrentDictionary<TKey, CacheEntry> DataCache = new ConcurrentDictionary<TKey, CacheEntry>(concurrencyLevel: 2, capacity: 10);
protected abstract TKey GetCacheKey(TValue value);
protected abstract Solution GetSolution(TValue value);
protected abstract bool ShouldCache(TValue value);
protected abstract int GetCount(TData data);
protected abstract Task<Stream> ReadStreamAsync(IPersistentStorage storage, TValue value, CancellationToken cancellationToken);
protected abstract TData TryGetExistingData(Stream stream, TValue value, CancellationToken cancellationToken);
protected abstract void WriteTo(Stream stream, TData data, CancellationToken cancellationToken);
protected abstract Task<bool> WriteStreamAsync(IPersistentStorage storage, TValue value, Stream stream, CancellationToken cancellationToken);
public int Count => this.DataCache.Count;
public int GetDataCount(TKey key)
{
if (!this.DataCache.TryGetValue(key, out var entry))
{
return 0;
}
return entry.Count;
}
public async Task<TData> TryGetExistingDataAsync(TValue value, CancellationToken cancellationToken)
{
if (!this.DataCache.TryGetValue(GetCacheKey(value), out var entry))
{
// we don't have data
return default;
}
// we have in memory cache for the document
if (entry.HasCachedData)
{
return entry.Data;
}
// we have persisted data
var solution = GetSolution(value);
var persistService = solution.Workspace.Services.GetService<IPersistentStorageService>();
try
{
using (var storage = persistService.GetStorage(solution))
using (var stream = await ReadStreamAsync(storage, value, cancellationToken).ConfigureAwait(false))
{
if (stream != null)
{
return TryGetExistingData(stream, value, cancellationToken);
}
}
}
catch (Exception e) when (IOUtilities.IsNormalIOException(e))
{
}
return default;
}
public async Task PersistAsync(TValue value, TData data, CancellationToken cancellationToken)
{
var succeeded = await WriteToStreamAsync(value, data, cancellationToken).ConfigureAwait(false);
var id = GetCacheKey(value);
// if data is for opened document or if persistence failed,
// we keep small cache so that we don't pay cost of deserialize/serializing data that keep changing
this.DataCache[id] = (!succeeded || ShouldCache(value)) ? new CacheEntry(data, GetCount(data)) : new CacheEntry(default, GetCount(data));
}
public virtual bool Remove(TKey id)
{
// remove doesn't actually remove data from the persistent storage
// that will be automatically managed by the service itself.
return this.DataCache.TryRemove(id, out _);
}
private async Task<bool> WriteToStreamAsync(TValue value, TData data, CancellationToken cancellationToken)
{
using (var stream = SerializableBytes.CreateWritableStream())
{
WriteTo(stream, data, cancellationToken);
var solution = GetSolution(value);
var persistService = solution.Workspace.Services.GetService<IPersistentStorageService>();
using (var storage = persistService.GetStorage(solution))
{
stream.Position = 0;
return await WriteStreamAsync(storage, value, stream, cancellationToken).ConfigureAwait(false);
}
}
}
protected readonly struct CacheEntry
{
public readonly TData Data;
public readonly int Count;
public CacheEntry(TData data, int count)
{
Data = data;
Count = count;
}
public bool HasCachedData => !object.Equals(Data, default);
}
}
}
| 38.511811 | 161 | 0.622572 | [
"Apache-2.0"
] | GovernessS/roslyn | src/Features/Core/Portable/SolutionCrawler/State/AbstractAnalyzerState.cs | 4,893 | C# |
using DurableFunctions.FunctionChaining;
using DurableFunctions.HumanInteraction;
using Microsoft.Azure.WebJobs;
using SendGrid.Helpers.Mail;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace DurableFunctions.Helpers
{
public static class SendGridHelper
{
public static async Task<SendGridMessage> CreateMessageAsync(Invoice invoice,TextReader invoiceReader)
{
var message = new SendGridMessage()
{
Subject = "Azure Functions Invoice",
From = new EmailAddress("azureinvoice@invoiceplatform.com")
};
message.AddTo(new EmailAddress(invoice.order.custEmail));
var buffer = await invoiceReader.ReadBufferAsync();
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(buffer);
var text = System.Convert.ToBase64String(plainTextBytes);
message.AddContent("text/plain", System.Text.Encoding.UTF8.GetString(plainTextBytes));
message.AddAttachment(invoice.GetFileName(), text, "text/plain", "attachment", "Invoice File");
return message;
}
public static SendGridMessage CreateMessageForManager(VacationResponse response)
{
var message = new SendGridMessage()
{
Subject = $"Vacation Request for {response.request.employeeFirstName} {response.request.employeeLastName}",
From = new EmailAddress("noreply@vacationplatform.com")
};
message.AddTo(new EmailAddress(response.request.managerEmail));
var msgBuilder = new StringBuilder();
msgBuilder.AppendLine($"<p>{response.request.employeeFirstName } {response.request.employeeLastName} request a vacation '{response.request.notes}'<br/>");
msgBuilder.AppendLine($"from {response.request.dateFrom } to {response.request.dateTo}.</p>");
msgBuilder.AppendLine($"<br/><br/>");
msgBuilder.AppendLine($"<p>Please use the code <b>{response.instanceId}</b> to accept or reject the request.");
message.HtmlContent = msgBuilder.ToString();
return message;
}
public static SendGridMessage CreateMessageForEmployee(VacationResponse response)
{
var message = new SendGridMessage()
{
Subject = $"Your Vacation Request from {response.request.dateFrom:dd/MM/yyyy} to {response.request.dateTo:dd/MM/yyyy}",
From = new EmailAddress("noreply@vacationplatform.com")
};
message.AddTo(new EmailAddress(response.request.employeeEmail));
var msgBuilder = new StringBuilder();
msgBuilder.AppendLine($"<p>Hi, {response.request.employeeFirstName } <br/> your vacation request '{response.request.notes}'");
msgBuilder.AppendLine($"from {response.request.dateFrom:dd/MM/yyyy} to {response.request.dateTo:dd/MM/yyyy} is ");
if (response.isApproved.HasValue && response.isApproved.Value)
{
msgBuilder.AppendLine($"<b>Approved</b>");
}
else
{
msgBuilder.AppendLine($"<b>Rejected</b>");
}
msgBuilder.AppendLine($"</p>");
message.HtmlContent = msgBuilder.ToString();
return message;
}
}
}
| 42.407407 | 166 | 0.635517 | [
"MIT"
] | massimobonanni/AzureDurableFunctionsSuccinctly | DurableFunctions/Helpers/SendGridHelper.cs | 3,437 | C# |
//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Entity Developer for SQL Server tool using LINQ to SQL template.
// Code is generated on: 21/11/2017 6:32:16 PM
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------
using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.ComponentModel;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
namespace DbContext
{
[System.Data.Linq.Mapping.DatabaseAttribute(Name = "NORTHWND")]
public partial class DbDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new System.Data.Linq.Mapping.AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertCategories(Categories instance);
partial void UpdateCategories(Categories instance);
partial void DeleteCategories(Categories instance);
partial void InsertCustomerCustomerDemo(CustomerCustomerDemo instance);
partial void UpdateCustomerCustomerDemo(CustomerCustomerDemo instance);
partial void DeleteCustomerCustomerDemo(CustomerCustomerDemo instance);
partial void InsertCustomerDemographics(CustomerDemographics instance);
partial void UpdateCustomerDemographics(CustomerDemographics instance);
partial void DeleteCustomerDemographics(CustomerDemographics instance);
partial void InsertCustomers(Customers instance);
partial void UpdateCustomers(Customers instance);
partial void DeleteCustomers(Customers instance);
partial void InsertEmployees(Employees instance);
partial void UpdateEmployees(Employees instance);
partial void DeleteEmployees(Employees instance);
partial void InsertEmployeeTerritories(EmployeeTerritories instance);
partial void UpdateEmployeeTerritories(EmployeeTerritories instance);
partial void DeleteEmployeeTerritories(EmployeeTerritories instance);
partial void InsertOrderDetails(OrderDetails instance);
partial void UpdateOrderDetails(OrderDetails instance);
partial void DeleteOrderDetails(OrderDetails instance);
partial void InsertOrders(Orders instance);
partial void UpdateOrders(Orders instance);
partial void DeleteOrders(Orders instance);
partial void InsertProducts(Products instance);
partial void UpdateProducts(Products instance);
partial void DeleteProducts(Products instance);
partial void InsertRegion(Region instance);
partial void UpdateRegion(Region instance);
partial void DeleteRegion(Region instance);
#endregion
public DbDataContext() :
base(GetConnectionString("NORTHWNDDataContextConnectionString"), mappingSource)
{
OnCreated();
}
public DbDataContext(System.Data.Linq.Mapping.MappingSource mappingSource) :
base(GetConnectionString("NORTHWNDDataContextConnectionString"), mappingSource)
{
OnCreated();
}
private static string GetConnectionString(string connectionStringName)
{
System.Configuration.ConnectionStringSettings connectionStringSettings = System.Configuration.ConfigurationManager.ConnectionStrings[connectionStringName];
if (connectionStringSettings == null)
throw new InvalidOperationException("Connection string \"" + connectionStringName +"\" could not be found in the configuration file.");
return connectionStringSettings.ConnectionString;
}
public DbDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DbDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DbDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public DbDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table<Categories> Categories
{
get
{
return this.GetTable<Categories>();
}
}
public System.Data.Linq.Table<CustomerCustomerDemo> CustomerCustomerDemo
{
get
{
return this.GetTable<CustomerCustomerDemo>();
}
}
public System.Data.Linq.Table<CustomerDemographics> CustomerDemographics
{
get
{
return this.GetTable<CustomerDemographics>();
}
}
public System.Data.Linq.Table<Customers> Customers
{
get
{
return this.GetTable<Customers>();
}
}
public System.Data.Linq.Table<Employees> Employees
{
get
{
return this.GetTable<Employees>();
}
}
public System.Data.Linq.Table<EmployeeTerritories> EmployeeTerritories
{
get
{
return this.GetTable<EmployeeTerritories>();
}
}
public System.Data.Linq.Table<OrderDetails> OrderDetails
{
get
{
return this.GetTable<OrderDetails>();
}
}
public System.Data.Linq.Table<Orders> Orders
{
get
{
return this.GetTable<Orders>();
}
}
public System.Data.Linq.Table<Products> Products
{
get
{
return this.GetTable<Products>();
}
}
public System.Data.Linq.Table<Region> Region
{
get
{
return this.GetTable<Region>();
}
}
}
}
namespace DbContext
{
/// <summary>
/// There are no comments for DbContext.Categories in the schema.
/// </summary>
[Table(Name = @"dbo.Categories")]
public partial class Categories : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _CategoryID;
private string _CategoryName;
private string _Description;
private byte[] _Picture;
#pragma warning restore 0649
private EntitySet<Products> _Products;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnCategoryIDChanging(int value);
partial void OnCategoryIDChanged();
partial void OnCategoryNameChanging(string value);
partial void OnCategoryNameChanged();
partial void OnDescriptionChanging(string value);
partial void OnDescriptionChanged();
partial void OnPictureChanging(byte[] value);
partial void OnPictureChanged();
#endregion
public Categories()
{
this._Products = new EntitySet<Products>(new Action<Products>(this.attach_Products), new Action<Products>(this.detach_Products));
OnCreated();
}
/// <summary>
/// There are no comments for CategoryID in the schema.
/// </summary>
[Column(Storage = "_CategoryID", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "int NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int CategoryID
{
get
{
return this._CategoryID;
}
set
{
if (this._CategoryID != value)
{
this.OnCategoryIDChanging(value);
this.SendPropertyChanging("CategoryID");
this._CategoryID = value;
this.SendPropertyChanged("CategoryID");
this.OnCategoryIDChanged();
}
}
}
/// <summary>
/// There are no comments for CategoryName in the schema.
/// </summary>
[Column(Storage = "_CategoryName", CanBeNull = false, DbType = "nvarchar(15) NOT NULL")]
public string CategoryName
{
get
{
return this._CategoryName;
}
set
{
if (this._CategoryName != value)
{
this.OnCategoryNameChanging(value);
this.SendPropertyChanging("CategoryName");
this._CategoryName = value;
this.SendPropertyChanged("CategoryName");
this.OnCategoryNameChanged();
}
}
}
/// <summary>
/// There are no comments for Description in the schema.
/// </summary>
[Column(Storage = "_Description", DbType = "nvarchar(MAX)", UpdateCheck = UpdateCheck.Never)]
public string Description
{
get
{
return this._Description;
}
set
{
if (this._Description != value)
{
this.OnDescriptionChanging(value);
this.SendPropertyChanging("Description");
this._Description = value;
this.SendPropertyChanged("Description");
this.OnDescriptionChanged();
}
}
}
/// <summary>
/// There are no comments for Picture in the schema.
/// </summary>
[Column(Storage = "_Picture", DbType = "varbinary(MAX)", UpdateCheck = UpdateCheck.Never)]
public byte[] Picture
{
get
{
return this._Picture;
}
set
{
if (this._Picture != value)
{
this.OnPictureChanging(value);
this.SendPropertyChanging("Picture");
this._Picture = value;
this.SendPropertyChanged("Picture");
this.OnPictureChanged();
}
}
}
/// <summary>
/// There are no comments for Products in the schema.
/// </summary>
[Association(Name="Categories_Products", Storage="_Products", ThisKey="CategoryID", OtherKey="CategoryID", DeleteRule="NO ACTION")]
public EntitySet<Products> Products
{
get
{
return this._Products;
}
set
{
this._Products.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_Products(Products entity)
{
this.SendPropertyChanging();
entity.Categories = this;
}
private void detach_Products(Products entity)
{
this.SendPropertyChanging();
entity.Categories = null;
}
}
/// <summary>
/// There are no comments for DbContext.CustomerCustomerDemo in the schema.
/// </summary>
[Table(Name = @"dbo.CustomerCustomerDemos")]
public partial class CustomerCustomerDemo : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private string _CustomerID;
private string _CustomerTypeID;
#pragma warning restore 0649
private EntityRef<CustomerDemographics> _CustomerDemographics;
private EntityRef<Customers> _Customers;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnCustomerIDChanging(string value);
partial void OnCustomerIDChanged();
partial void OnCustomerTypeIDChanging(string value);
partial void OnCustomerTypeIDChanged();
#endregion
public CustomerCustomerDemo()
{
this._CustomerDemographics = default(EntityRef<CustomerDemographics>);
this._Customers = default(EntityRef<Customers>);
OnCreated();
}
/// <summary>
/// There are no comments for CustomerID in the schema.
/// </summary>
[Column(Storage = "_CustomerID", CanBeNull = false, DbType = "nchar(5) NOT NULL", IsPrimaryKey = true)]
public string CustomerID
{
get
{
return this._CustomerID;
}
set
{
if (this._CustomerID != value)
{
if (this._Customers.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCustomerIDChanging(value);
this.SendPropertyChanging("CustomerID");
this._CustomerID = value;
this.SendPropertyChanged("CustomerID");
this.OnCustomerIDChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerTypeID in the schema.
/// </summary>
[Column(Storage = "_CustomerTypeID", CanBeNull = false, DbType = "nchar(10) NOT NULL", IsPrimaryKey = true)]
public string CustomerTypeID
{
get
{
return this._CustomerTypeID;
}
set
{
if (this._CustomerTypeID != value)
{
if (this._CustomerDemographics.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCustomerTypeIDChanging(value);
this.SendPropertyChanging("CustomerTypeID");
this._CustomerTypeID = value;
this.SendPropertyChanged("CustomerTypeID");
this.OnCustomerTypeIDChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerDemographics in the schema.
/// </summary>
[Association(Name="CustomerDemographics_CustomerCustomerDemo", Storage="_CustomerDemographics", ThisKey="CustomerTypeID", OtherKey="CustomerTypeID", IsForeignKey=true)]
public CustomerDemographics CustomerDemographics
{
get
{
return this._CustomerDemographics.Entity;
}
set
{
CustomerDemographics previousValue = this._CustomerDemographics.Entity;
if ((previousValue != value) || (this._CustomerDemographics.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("CustomerDemographics");
if (previousValue != null)
{
this._CustomerDemographics.Entity = null;
previousValue.CustomerCustomerDemo.Remove(this);
}
this._CustomerDemographics.Entity = value;
if (value != null)
{
this._CustomerTypeID = value.CustomerTypeID;
value.CustomerCustomerDemo.Add(this);
}
else
{
this._CustomerTypeID = default(string);
}
this.SendPropertyChanged("CustomerDemographics");
}
}
}
/// <summary>
/// There are no comments for Customers in the schema.
/// </summary>
[Association(Name="Customers_CustomerCustomerDemo", Storage="_Customers", ThisKey="CustomerID", OtherKey="CustomerID", IsForeignKey=true)]
public Customers Customers
{
get
{
return this._Customers.Entity;
}
set
{
Customers previousValue = this._Customers.Entity;
if ((previousValue != value) || (this._Customers.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Customers");
if (previousValue != null)
{
this._Customers.Entity = null;
previousValue.CustomerCustomerDemo.Remove(this);
}
this._Customers.Entity = value;
if (value != null)
{
this._CustomerID = value.CustomerID;
value.CustomerCustomerDemo.Add(this);
}
else
{
this._CustomerID = default(string);
}
this.SendPropertyChanged("Customers");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
/// <summary>
/// There are no comments for DbContext.CustomerDemographics in the schema.
/// </summary>
[Table(Name = @"dbo.CustomerDemographics")]
public partial class CustomerDemographics : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private string _CustomerTypeID;
private string _CustomerDesc;
#pragma warning restore 0649
private EntitySet<CustomerCustomerDemo> _CustomerCustomerDemo;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnCustomerTypeIDChanging(string value);
partial void OnCustomerTypeIDChanged();
partial void OnCustomerDescChanging(string value);
partial void OnCustomerDescChanged();
#endregion
public CustomerDemographics()
{
this._CustomerCustomerDemo = new EntitySet<CustomerCustomerDemo>(new Action<CustomerCustomerDemo>(this.attach_CustomerCustomerDemo), new Action<CustomerCustomerDemo>(this.detach_CustomerCustomerDemo));
OnCreated();
}
/// <summary>
/// There are no comments for CustomerTypeID in the schema.
/// </summary>
[Column(Storage = "_CustomerTypeID", CanBeNull = false, DbType = "nchar(10) NOT NULL", IsPrimaryKey = true)]
public string CustomerTypeID
{
get
{
return this._CustomerTypeID;
}
set
{
if (this._CustomerTypeID != value)
{
this.OnCustomerTypeIDChanging(value);
this.SendPropertyChanging("CustomerTypeID");
this._CustomerTypeID = value;
this.SendPropertyChanged("CustomerTypeID");
this.OnCustomerTypeIDChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerDesc in the schema.
/// </summary>
[Column(Storage = "_CustomerDesc", DbType = "nvarchar(MAX)", UpdateCheck = UpdateCheck.Never)]
public string CustomerDesc
{
get
{
return this._CustomerDesc;
}
set
{
if (this._CustomerDesc != value)
{
this.OnCustomerDescChanging(value);
this.SendPropertyChanging("CustomerDesc");
this._CustomerDesc = value;
this.SendPropertyChanged("CustomerDesc");
this.OnCustomerDescChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerCustomerDemo in the schema.
/// </summary>
[Association(Name="CustomerDemographics_CustomerCustomerDemo", Storage="_CustomerCustomerDemo", ThisKey="CustomerTypeID", OtherKey="CustomerTypeID", DeleteRule="NO ACTION")]
public EntitySet<CustomerCustomerDemo> CustomerCustomerDemo
{
get
{
return this._CustomerCustomerDemo;
}
set
{
this._CustomerCustomerDemo.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_CustomerCustomerDemo(CustomerCustomerDemo entity)
{
this.SendPropertyChanging();
entity.CustomerDemographics = this;
}
private void detach_CustomerCustomerDemo(CustomerCustomerDemo entity)
{
this.SendPropertyChanging();
entity.CustomerDemographics = null;
}
}
/// <summary>
/// There are no comments for DbContext.Customers in the schema.
/// </summary>
[Table(Name = @"dbo.Customers")]
public partial class Customers : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private string _CustomerID;
private string _CompanyName;
private string _ContactName;
private string _ContactTitle;
private string _Address;
private string _City;
private string _Region;
private string _PostalCode;
private string _Country;
private string _Phone;
private string _Fax;
#pragma warning restore 0649
private EntitySet<CustomerCustomerDemo> _CustomerCustomerDemo;
private EntitySet<Orders> _Orders;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnCustomerIDChanging(string value);
partial void OnCustomerIDChanged();
partial void OnCompanyNameChanging(string value);
partial void OnCompanyNameChanged();
partial void OnContactNameChanging(string value);
partial void OnContactNameChanged();
partial void OnContactTitleChanging(string value);
partial void OnContactTitleChanged();
partial void OnAddressChanging(string value);
partial void OnAddressChanged();
partial void OnCityChanging(string value);
partial void OnCityChanged();
partial void OnRegionChanging(string value);
partial void OnRegionChanged();
partial void OnPostalCodeChanging(string value);
partial void OnPostalCodeChanged();
partial void OnCountryChanging(string value);
partial void OnCountryChanged();
partial void OnPhoneChanging(string value);
partial void OnPhoneChanged();
partial void OnFaxChanging(string value);
partial void OnFaxChanged();
#endregion
public Customers()
{
this._CustomerCustomerDemo = new EntitySet<CustomerCustomerDemo>(new Action<CustomerCustomerDemo>(this.attach_CustomerCustomerDemo), new Action<CustomerCustomerDemo>(this.detach_CustomerCustomerDemo));
this._Orders = new EntitySet<Orders>(new Action<Orders>(this.attach_Orders), new Action<Orders>(this.detach_Orders));
OnCreated();
}
/// <summary>
/// There are no comments for CustomerID in the schema.
/// </summary>
[Column(Storage = "_CustomerID", CanBeNull = false, DbType = "nchar(5) NOT NULL", IsPrimaryKey = true)]
public string CustomerID
{
get
{
return this._CustomerID;
}
set
{
if (this._CustomerID != value)
{
this.OnCustomerIDChanging(value);
this.SendPropertyChanging("CustomerID");
this._CustomerID = value;
this.SendPropertyChanged("CustomerID");
this.OnCustomerIDChanged();
}
}
}
/// <summary>
/// There are no comments for CompanyName in the schema.
/// </summary>
[Column(Storage = "_CompanyName", CanBeNull = false, DbType = "nvarchar(40) NOT NULL")]
public string CompanyName
{
get
{
return this._CompanyName;
}
set
{
if (this._CompanyName != value)
{
this.OnCompanyNameChanging(value);
this.SendPropertyChanging("CompanyName");
this._CompanyName = value;
this.SendPropertyChanged("CompanyName");
this.OnCompanyNameChanged();
}
}
}
/// <summary>
/// There are no comments for ContactName in the schema.
/// </summary>
[Column(Storage = "_ContactName", DbType = "nvarchar(30)")]
public string ContactName
{
get
{
return this._ContactName;
}
set
{
if (this._ContactName != value)
{
this.OnContactNameChanging(value);
this.SendPropertyChanging("ContactName");
this._ContactName = value;
this.SendPropertyChanged("ContactName");
this.OnContactNameChanged();
}
}
}
/// <summary>
/// There are no comments for ContactTitle in the schema.
/// </summary>
[Column(Storage = "_ContactTitle", DbType = "nvarchar(30)")]
public string ContactTitle
{
get
{
return this._ContactTitle;
}
set
{
if (this._ContactTitle != value)
{
this.OnContactTitleChanging(value);
this.SendPropertyChanging("ContactTitle");
this._ContactTitle = value;
this.SendPropertyChanged("ContactTitle");
this.OnContactTitleChanged();
}
}
}
/// <summary>
/// There are no comments for Address in the schema.
/// </summary>
[Column(Storage = "_Address", DbType = "nvarchar(60)")]
public string Address
{
get
{
return this._Address;
}
set
{
if (this._Address != value)
{
this.OnAddressChanging(value);
this.SendPropertyChanging("Address");
this._Address = value;
this.SendPropertyChanged("Address");
this.OnAddressChanged();
}
}
}
/// <summary>
/// There are no comments for City in the schema.
/// </summary>
[Column(Storage = "_City", DbType = "nvarchar(15)")]
public string City
{
get
{
return this._City;
}
set
{
if (this._City != value)
{
this.OnCityChanging(value);
this.SendPropertyChanging("City");
this._City = value;
this.SendPropertyChanged("City");
this.OnCityChanged();
}
}
}
/// <summary>
/// There are no comments for Region in the schema.
/// </summary>
[Column(Storage = "_Region", DbType = "nvarchar(15)")]
public string Region
{
get
{
return this._Region;
}
set
{
if (this._Region != value)
{
this.OnRegionChanging(value);
this.SendPropertyChanging("Region");
this._Region = value;
this.SendPropertyChanged("Region");
this.OnRegionChanged();
}
}
}
/// <summary>
/// There are no comments for PostalCode in the schema.
/// </summary>
[Column(Storage = "_PostalCode", DbType = "nvarchar(10)")]
public string PostalCode
{
get
{
return this._PostalCode;
}
set
{
if (this._PostalCode != value)
{
this.OnPostalCodeChanging(value);
this.SendPropertyChanging("PostalCode");
this._PostalCode = value;
this.SendPropertyChanged("PostalCode");
this.OnPostalCodeChanged();
}
}
}
/// <summary>
/// There are no comments for Country in the schema.
/// </summary>
[Column(Storage = "_Country", DbType = "nvarchar(15)")]
public string Country
{
get
{
return this._Country;
}
set
{
if (this._Country != value)
{
this.OnCountryChanging(value);
this.SendPropertyChanging("Country");
this._Country = value;
this.SendPropertyChanged("Country");
this.OnCountryChanged();
}
}
}
/// <summary>
/// There are no comments for Phone in the schema.
/// </summary>
[Column(Storage = "_Phone", DbType = "nvarchar(24)")]
public string Phone
{
get
{
return this._Phone;
}
set
{
if (this._Phone != value)
{
this.OnPhoneChanging(value);
this.SendPropertyChanging("Phone");
this._Phone = value;
this.SendPropertyChanged("Phone");
this.OnPhoneChanged();
}
}
}
/// <summary>
/// There are no comments for Fax in the schema.
/// </summary>
[Column(Storage = "_Fax", DbType = "nvarchar(24)")]
public string Fax
{
get
{
return this._Fax;
}
set
{
if (this._Fax != value)
{
this.OnFaxChanging(value);
this.SendPropertyChanging("Fax");
this._Fax = value;
this.SendPropertyChanged("Fax");
this.OnFaxChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerCustomerDemo in the schema.
/// </summary>
[Association(Name="Customers_CustomerCustomerDemo", Storage="_CustomerCustomerDemo", ThisKey="CustomerID", OtherKey="CustomerID", DeleteRule="NO ACTION")]
public EntitySet<CustomerCustomerDemo> CustomerCustomerDemo
{
get
{
return this._CustomerCustomerDemo;
}
set
{
this._CustomerCustomerDemo.Assign(value);
}
}
/// <summary>
/// There are no comments for Orders in the schema.
/// </summary>
[Association(Name="Customers_Orders", Storage="_Orders", ThisKey="CustomerID", OtherKey="CustomerID", DeleteRule="NO ACTION")]
public EntitySet<Orders> Orders
{
get
{
return this._Orders;
}
set
{
this._Orders.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_CustomerCustomerDemo(CustomerCustomerDemo entity)
{
this.SendPropertyChanging();
entity.Customers = this;
}
private void detach_CustomerCustomerDemo(CustomerCustomerDemo entity)
{
this.SendPropertyChanging();
entity.Customers = null;
}
private void attach_Orders(Orders entity)
{
this.SendPropertyChanging();
entity.Customers = this;
}
private void detach_Orders(Orders entity)
{
this.SendPropertyChanging();
entity.Customers = null;
}
}
/// <summary>
/// There are no comments for DbContext.Employees in the schema.
/// </summary>
[Table(Name = @"dbo.Employees")]
public partial class Employees : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _EmployeeID;
private string _LastName;
private string _FirstName;
private string _Title;
private string _TitleOfCourtesy;
private System.Nullable<System.DateTime> _BirthDate;
private System.Nullable<System.DateTime> _HireDate;
private string _Address;
private string _City;
private string _Region;
private string _PostalCode;
private string _Country;
private string _HomePhone;
private string _Extension;
private byte[] _Photo;
private string _Notes;
private System.Nullable<int> _ReportsTo;
private string _PhotoPath;
#pragma warning restore 0649
private EntitySet<Employees> _Employees_ReportsTo1;
private EntityRef<Employees> _Employees_ReportsTo;
private EntitySet<EmployeeTerritories> _EmployeeTerritories;
private EntitySet<Orders> _Orders;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnEmployeeIDChanging(int value);
partial void OnEmployeeIDChanged();
partial void OnLastNameChanging(string value);
partial void OnLastNameChanged();
partial void OnFirstNameChanging(string value);
partial void OnFirstNameChanged();
partial void OnTitleChanging(string value);
partial void OnTitleChanged();
partial void OnTitleOfCourtesyChanging(string value);
partial void OnTitleOfCourtesyChanged();
partial void OnBirthDateChanging(System.Nullable<System.DateTime> value);
partial void OnBirthDateChanged();
partial void OnHireDateChanging(System.Nullable<System.DateTime> value);
partial void OnHireDateChanged();
partial void OnAddressChanging(string value);
partial void OnAddressChanged();
partial void OnCityChanging(string value);
partial void OnCityChanged();
partial void OnRegionChanging(string value);
partial void OnRegionChanged();
partial void OnPostalCodeChanging(string value);
partial void OnPostalCodeChanged();
partial void OnCountryChanging(string value);
partial void OnCountryChanged();
partial void OnHomePhoneChanging(string value);
partial void OnHomePhoneChanged();
partial void OnExtensionChanging(string value);
partial void OnExtensionChanged();
partial void OnPhotoChanging(byte[] value);
partial void OnPhotoChanged();
partial void OnNotesChanging(string value);
partial void OnNotesChanged();
partial void OnReportsToChanging(System.Nullable<int> value);
partial void OnReportsToChanged();
partial void OnPhotoPathChanging(string value);
partial void OnPhotoPathChanged();
#endregion
public Employees()
{
this._Employees_ReportsTo1 = new EntitySet<Employees>(new Action<Employees>(this.attach_Employees_ReportsTo1), new Action<Employees>(this.detach_Employees_ReportsTo1));
this._Employees_ReportsTo = default(EntityRef<Employees>);
this._EmployeeTerritories = new EntitySet<EmployeeTerritories>(new Action<EmployeeTerritories>(this.attach_EmployeeTerritories), new Action<EmployeeTerritories>(this.detach_EmployeeTerritories));
this._Orders = new EntitySet<Orders>(new Action<Orders>(this.attach_Orders), new Action<Orders>(this.detach_Orders));
OnCreated();
}
/// <summary>
/// There are no comments for EmployeeID in the schema.
/// </summary>
[Column(Storage = "_EmployeeID", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "int NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int EmployeeID
{
get
{
return this._EmployeeID;
}
set
{
if (this._EmployeeID != value)
{
this.OnEmployeeIDChanging(value);
this.SendPropertyChanging("EmployeeID");
this._EmployeeID = value;
this.SendPropertyChanged("EmployeeID");
this.OnEmployeeIDChanged();
}
}
}
/// <summary>
/// There are no comments for LastName in the schema.
/// </summary>
[Column(Storage = "_LastName", CanBeNull = false, DbType = "nvarchar(20) NOT NULL")]
public string LastName
{
get
{
return this._LastName;
}
set
{
if (this._LastName != value)
{
this.OnLastNameChanging(value);
this.SendPropertyChanging("LastName");
this._LastName = value;
this.SendPropertyChanged("LastName");
this.OnLastNameChanged();
}
}
}
/// <summary>
/// There are no comments for FirstName in the schema.
/// </summary>
[Column(Storage = "_FirstName", CanBeNull = false, DbType = "nvarchar(10) NOT NULL")]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
if (this._FirstName != value)
{
this.OnFirstNameChanging(value);
this.SendPropertyChanging("FirstName");
this._FirstName = value;
this.SendPropertyChanged("FirstName");
this.OnFirstNameChanged();
}
}
}
/// <summary>
/// There are no comments for Title in the schema.
/// </summary>
[Column(Storage = "_Title", DbType = "nvarchar(30)")]
public string Title
{
get
{
return this._Title;
}
set
{
if (this._Title != value)
{
this.OnTitleChanging(value);
this.SendPropertyChanging("Title");
this._Title = value;
this.SendPropertyChanged("Title");
this.OnTitleChanged();
}
}
}
/// <summary>
/// There are no comments for TitleOfCourtesy in the schema.
/// </summary>
[Column(Storage = "_TitleOfCourtesy", DbType = "nvarchar(25)")]
public string TitleOfCourtesy
{
get
{
return this._TitleOfCourtesy;
}
set
{
if (this._TitleOfCourtesy != value)
{
this.OnTitleOfCourtesyChanging(value);
this.SendPropertyChanging("TitleOfCourtesy");
this._TitleOfCourtesy = value;
this.SendPropertyChanged("TitleOfCourtesy");
this.OnTitleOfCourtesyChanged();
}
}
}
/// <summary>
/// There are no comments for BirthDate in the schema.
/// </summary>
[Column(Storage = "_BirthDate", DbType = "datetime2")]
public System.Nullable<System.DateTime> BirthDate
{
get
{
return this._BirthDate;
}
set
{
if (this._BirthDate != value)
{
this.OnBirthDateChanging(value);
this.SendPropertyChanging("BirthDate");
this._BirthDate = value;
this.SendPropertyChanged("BirthDate");
this.OnBirthDateChanged();
}
}
}
/// <summary>
/// There are no comments for HireDate in the schema.
/// </summary>
[Column(Storage = "_HireDate", DbType = "datetime2")]
public System.Nullable<System.DateTime> HireDate
{
get
{
return this._HireDate;
}
set
{
if (this._HireDate != value)
{
this.OnHireDateChanging(value);
this.SendPropertyChanging("HireDate");
this._HireDate = value;
this.SendPropertyChanged("HireDate");
this.OnHireDateChanged();
}
}
}
/// <summary>
/// There are no comments for Address in the schema.
/// </summary>
[Column(Storage = "_Address", DbType = "nvarchar(60)")]
public string Address
{
get
{
return this._Address;
}
set
{
if (this._Address != value)
{
this.OnAddressChanging(value);
this.SendPropertyChanging("Address");
this._Address = value;
this.SendPropertyChanged("Address");
this.OnAddressChanged();
}
}
}
/// <summary>
/// There are no comments for City in the schema.
/// </summary>
[Column(Storage = "_City", DbType = "nvarchar(15)")]
public string City
{
get
{
return this._City;
}
set
{
if (this._City != value)
{
this.OnCityChanging(value);
this.SendPropertyChanging("City");
this._City = value;
this.SendPropertyChanged("City");
this.OnCityChanged();
}
}
}
/// <summary>
/// There are no comments for Region in the schema.
/// </summary>
[Column(Storage = "_Region", DbType = "nvarchar(15)")]
public string Region
{
get
{
return this._Region;
}
set
{
if (this._Region != value)
{
this.OnRegionChanging(value);
this.SendPropertyChanging("Region");
this._Region = value;
this.SendPropertyChanged("Region");
this.OnRegionChanged();
}
}
}
/// <summary>
/// There are no comments for PostalCode in the schema.
/// </summary>
[Column(Storage = "_PostalCode", DbType = "nvarchar(10)")]
public string PostalCode
{
get
{
return this._PostalCode;
}
set
{
if (this._PostalCode != value)
{
this.OnPostalCodeChanging(value);
this.SendPropertyChanging("PostalCode");
this._PostalCode = value;
this.SendPropertyChanged("PostalCode");
this.OnPostalCodeChanged();
}
}
}
/// <summary>
/// There are no comments for Country in the schema.
/// </summary>
[Column(Storage = "_Country", DbType = "nvarchar(15)")]
public string Country
{
get
{
return this._Country;
}
set
{
if (this._Country != value)
{
this.OnCountryChanging(value);
this.SendPropertyChanging("Country");
this._Country = value;
this.SendPropertyChanged("Country");
this.OnCountryChanged();
}
}
}
/// <summary>
/// There are no comments for HomePhone in the schema.
/// </summary>
[Column(Storage = "_HomePhone", DbType = "nvarchar(24)")]
public string HomePhone
{
get
{
return this._HomePhone;
}
set
{
if (this._HomePhone != value)
{
this.OnHomePhoneChanging(value);
this.SendPropertyChanging("HomePhone");
this._HomePhone = value;
this.SendPropertyChanged("HomePhone");
this.OnHomePhoneChanged();
}
}
}
/// <summary>
/// There are no comments for Extension in the schema.
/// </summary>
[Column(Storage = "_Extension", DbType = "nvarchar(4)")]
public string Extension
{
get
{
return this._Extension;
}
set
{
if (this._Extension != value)
{
this.OnExtensionChanging(value);
this.SendPropertyChanging("Extension");
this._Extension = value;
this.SendPropertyChanged("Extension");
this.OnExtensionChanged();
}
}
}
/// <summary>
/// There are no comments for Photo in the schema.
/// </summary>
[Column(Storage = "_Photo", DbType = "varbinary(MAX)", UpdateCheck = UpdateCheck.Never)]
public byte[] Photo
{
get
{
return this._Photo;
}
set
{
if (this._Photo != value)
{
this.OnPhotoChanging(value);
this.SendPropertyChanging("Photo");
this._Photo = value;
this.SendPropertyChanged("Photo");
this.OnPhotoChanged();
}
}
}
/// <summary>
/// There are no comments for Notes in the schema.
/// </summary>
[Column(Storage = "_Notes", DbType = "nvarchar(MAX)", UpdateCheck = UpdateCheck.Never)]
public string Notes
{
get
{
return this._Notes;
}
set
{
if (this._Notes != value)
{
this.OnNotesChanging(value);
this.SendPropertyChanging("Notes");
this._Notes = value;
this.SendPropertyChanged("Notes");
this.OnNotesChanged();
}
}
}
/// <summary>
/// There are no comments for ReportsTo in the schema.
/// </summary>
[Column(Storage = "_ReportsTo", DbType = "int")]
public System.Nullable<int> ReportsTo
{
get
{
return this._ReportsTo;
}
set
{
if (this._ReportsTo != value)
{
if (this._Employees_ReportsTo.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnReportsToChanging(value);
this.SendPropertyChanging("ReportsTo");
this._ReportsTo = value;
this.SendPropertyChanged("ReportsTo");
this.OnReportsToChanged();
}
}
}
/// <summary>
/// There are no comments for PhotoPath in the schema.
/// </summary>
[Column(Storage = "_PhotoPath", DbType = "nvarchar(255)")]
public string PhotoPath
{
get
{
return this._PhotoPath;
}
set
{
if (this._PhotoPath != value)
{
this.OnPhotoPathChanging(value);
this.SendPropertyChanging("PhotoPath");
this._PhotoPath = value;
this.SendPropertyChanged("PhotoPath");
this.OnPhotoPathChanged();
}
}
}
/// <summary>
/// There are no comments for Employees_ReportsTo1 in the schema.
/// </summary>
[Association(Name="Employees_Employees", Storage="_Employees_ReportsTo1", ThisKey="EmployeeID", OtherKey="ReportsTo", DeleteRule="NO ACTION")]
public EntitySet<Employees> Employees_ReportsTo1
{
get
{
return this._Employees_ReportsTo1;
}
set
{
this._Employees_ReportsTo1.Assign(value);
}
}
/// <summary>
/// There are no comments for Employees_ReportsTo in the schema.
/// </summary>
[Association(Name="Employees_Employees", Storage="_Employees_ReportsTo", ThisKey="ReportsTo", OtherKey="EmployeeID", IsForeignKey=true)]
public Employees Employees_ReportsTo
{
get
{
return this._Employees_ReportsTo.Entity;
}
set
{
Employees previousValue = this._Employees_ReportsTo.Entity;
if ((previousValue != value) || (this._Employees_ReportsTo.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Employees_ReportsTo");
if (previousValue != null)
{
this._Employees_ReportsTo.Entity = null;
previousValue.Employees_ReportsTo1.Remove(this);
}
this._Employees_ReportsTo.Entity = value;
if (value != null)
{
this._ReportsTo = value.EmployeeID;
value.Employees_ReportsTo1.Add(this);
}
else
{
this._ReportsTo = default(System.Nullable<int>);
}
this.SendPropertyChanged("Employees_ReportsTo");
}
}
}
/// <summary>
/// There are no comments for EmployeeTerritories in the schema.
/// </summary>
[Association(Name="Employees_EmployeeTerritories", Storage="_EmployeeTerritories", ThisKey="EmployeeID", OtherKey="EmployeeID", DeleteRule="NO ACTION")]
public EntitySet<EmployeeTerritories> EmployeeTerritories
{
get
{
return this._EmployeeTerritories;
}
set
{
this._EmployeeTerritories.Assign(value);
}
}
/// <summary>
/// There are no comments for Orders in the schema.
/// </summary>
[Association(Name="Employees_Orders", Storage="_Orders", ThisKey="EmployeeID", OtherKey="EmployeeID", DeleteRule="NO ACTION")]
public EntitySet<Orders> Orders
{
get
{
return this._Orders;
}
set
{
this._Orders.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_Employees_ReportsTo1(Employees entity)
{
this.SendPropertyChanging();
entity.Employees_ReportsTo = this;
}
private void detach_Employees_ReportsTo1(Employees entity)
{
this.SendPropertyChanging();
entity.Employees_ReportsTo = null;
}
private void attach_EmployeeTerritories(EmployeeTerritories entity)
{
this.SendPropertyChanging();
entity.Employees = this;
}
private void detach_EmployeeTerritories(EmployeeTerritories entity)
{
this.SendPropertyChanging();
entity.Employees = null;
}
private void attach_Orders(Orders entity)
{
this.SendPropertyChanging();
entity.Employees = this;
}
private void detach_Orders(Orders entity)
{
this.SendPropertyChanging();
entity.Employees = null;
}
}
/// <summary>
/// There are no comments for DbContext.EmployeeTerritories in the schema.
/// </summary>
[Table(Name = @"dbo.EmployeeTerritories")]
public partial class EmployeeTerritories : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _EmployeeID;
private string _TerritoryID;
#pragma warning restore 0649
private EntityRef<Employees> _Employees;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnEmployeeIDChanging(int value);
partial void OnEmployeeIDChanged();
partial void OnTerritoryIDChanging(string value);
partial void OnTerritoryIDChanged();
#endregion
public EmployeeTerritories()
{
this._Employees = default(EntityRef<Employees>);
OnCreated();
}
/// <summary>
/// There are no comments for EmployeeID in the schema.
/// </summary>
[Column(Storage = "_EmployeeID", CanBeNull = false, DbType = "int NOT NULL", IsPrimaryKey = true)]
public int EmployeeID
{
get
{
return this._EmployeeID;
}
set
{
if (this._EmployeeID != value)
{
if (this._Employees.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnEmployeeIDChanging(value);
this.SendPropertyChanging("EmployeeID");
this._EmployeeID = value;
this.SendPropertyChanged("EmployeeID");
this.OnEmployeeIDChanged();
}
}
}
/// <summary>
/// There are no comments for TerritoryID in the schema.
/// </summary>
[Column(Storage = "_TerritoryID", CanBeNull = false, DbType = "nvarchar(20) NOT NULL", IsPrimaryKey = true)]
public string TerritoryID
{
get
{
return this._TerritoryID;
}
set
{
if (this._TerritoryID != value)
{
this.OnTerritoryIDChanging(value);
this.SendPropertyChanging("TerritoryID");
this._TerritoryID = value;
this.SendPropertyChanged("TerritoryID");
this.OnTerritoryIDChanged();
}
}
}
/// <summary>
/// There are no comments for Employees in the schema.
/// </summary>
[Association(Name="Employees_EmployeeTerritories", Storage="_Employees", ThisKey="EmployeeID", OtherKey="EmployeeID", IsForeignKey=true)]
public Employees Employees
{
get
{
return this._Employees.Entity;
}
set
{
Employees previousValue = this._Employees.Entity;
if ((previousValue != value) || (this._Employees.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Employees");
if (previousValue != null)
{
this._Employees.Entity = null;
previousValue.EmployeeTerritories.Remove(this);
}
this._Employees.Entity = value;
if (value != null)
{
this._EmployeeID = value.EmployeeID;
value.EmployeeTerritories.Add(this);
}
else
{
this._EmployeeID = default(int);
}
this.SendPropertyChanged("Employees");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
/// <summary>
/// There are no comments for DbContext.OrderDetails in the schema.
/// </summary>
[Table(Name = @"dbo.[Order Details]")]
public partial class OrderDetails : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _OrderID;
private int _ProductID;
private decimal _UnitPrice = 0m;
private short _Quantity = 1;
private float _Discount = 0f;
#pragma warning restore 0649
private EntityRef<Orders> _Orders;
private EntityRef<Products> _Products;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnOrderIDChanging(int value);
partial void OnOrderIDChanged();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnUnitPriceChanging(decimal value);
partial void OnUnitPriceChanged();
partial void OnQuantityChanging(short value);
partial void OnQuantityChanged();
partial void OnDiscountChanging(float value);
partial void OnDiscountChanged();
#endregion
public OrderDetails()
{
this._Orders = default(EntityRef<Orders>);
this._Products = default(EntityRef<Products>);
OnCreated();
}
/// <summary>
/// There are no comments for OrderID in the schema.
/// </summary>
[Column(Storage = "_OrderID", CanBeNull = false, DbType = "int NOT NULL", IsPrimaryKey = true)]
public int OrderID
{
get
{
return this._OrderID;
}
set
{
if (this._OrderID != value)
{
if (this._Orders.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnOrderIDChanging(value);
this.SendPropertyChanging("OrderID");
this._OrderID = value;
this.SendPropertyChanged("OrderID");
this.OnOrderIDChanged();
}
}
}
/// <summary>
/// There are no comments for ProductID in the schema.
/// </summary>
[Column(Storage = "_ProductID", CanBeNull = false, DbType = "int NOT NULL", IsPrimaryKey = true)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if (this._ProductID != value)
{
if (this._Products.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductIDChanging(value);
this.SendPropertyChanging("ProductID");
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
}
/// <summary>
/// There are no comments for UnitPrice in the schema.
/// </summary>
[Column(Storage = "_UnitPrice", CanBeNull = false, DbType = "decimal(19,4) NOT NULL")]
public decimal UnitPrice
{
get
{
return this._UnitPrice;
}
set
{
if (this._UnitPrice != value)
{
this.OnUnitPriceChanging(value);
this.SendPropertyChanging("UnitPrice");
this._UnitPrice = value;
this.SendPropertyChanged("UnitPrice");
this.OnUnitPriceChanged();
}
}
}
/// <summary>
/// There are no comments for Quantity in the schema.
/// </summary>
[Column(Storage = "_Quantity", CanBeNull = false, DbType = "smallint NOT NULL")]
public short Quantity
{
get
{
return this._Quantity;
}
set
{
if (this._Quantity != value)
{
this.OnQuantityChanging(value);
this.SendPropertyChanging("Quantity");
this._Quantity = value;
this.SendPropertyChanged("Quantity");
this.OnQuantityChanged();
}
}
}
/// <summary>
/// There are no comments for Discount in the schema.
/// </summary>
[Column(Storage = "_Discount", CanBeNull = false, DbType = "real NOT NULL")]
public float Discount
{
get
{
return this._Discount;
}
set
{
if (this._Discount != value)
{
this.OnDiscountChanging(value);
this.SendPropertyChanging("Discount");
this._Discount = value;
this.SendPropertyChanged("Discount");
this.OnDiscountChanged();
}
}
}
/// <summary>
/// There are no comments for Orders in the schema.
/// </summary>
[Association(Name="Orders_OrderDetails", Storage="_Orders", ThisKey="OrderID", OtherKey="OrderID", IsForeignKey=true)]
public Orders Orders
{
get
{
return this._Orders.Entity;
}
set
{
Orders previousValue = this._Orders.Entity;
if ((previousValue != value) || (this._Orders.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Orders");
if (previousValue != null)
{
this._Orders.Entity = null;
previousValue.OrderDetails.Remove(this);
}
this._Orders.Entity = value;
if (value != null)
{
this._OrderID = value.OrderID;
value.OrderDetails.Add(this);
}
else
{
this._OrderID = default(int);
}
this.SendPropertyChanged("Orders");
}
}
}
/// <summary>
/// There are no comments for Products in the schema.
/// </summary>
[Association(Name="Products_OrderDetails", Storage="_Products", ThisKey="ProductID", OtherKey="ProductID", IsForeignKey=true)]
public Products Products
{
get
{
return this._Products.Entity;
}
set
{
Products previousValue = this._Products.Entity;
if ((previousValue != value) || (this._Products.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Products");
if (previousValue != null)
{
this._Products.Entity = null;
previousValue.OrderDetails.Remove(this);
}
this._Products.Entity = value;
if (value != null)
{
this._ProductID = value.ProductID;
value.OrderDetails.Add(this);
}
else
{
this._ProductID = default(int);
}
this.SendPropertyChanged("Products");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
/// <summary>
/// There are no comments for DbContext.Orders in the schema.
/// </summary>
[Table(Name = @"dbo.Orders")]
public partial class Orders : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _OrderID;
private string _CustomerID;
private System.Nullable<int> _EmployeeID;
private System.Nullable<System.DateTime> _OrderDate;
private System.Nullable<System.DateTime> _RequiredDate;
private System.Nullable<System.DateTime> _ShippedDate;
private System.Nullable<int> _ShipVia;
private System.Nullable<decimal> _Freight = 0m;
private string _ShipName;
private string _ShipAddress;
private string _ShipCity;
private string _ShipRegion;
private string _ShipPostalCode;
private string _ShipCountry;
#pragma warning restore 0649
private EntitySet<OrderDetails> _OrderDetails;
private EntityRef<Customers> _Customers;
private EntityRef<Employees> _Employees;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnOrderIDChanging(int value);
partial void OnOrderIDChanged();
partial void OnCustomerIDChanging(string value);
partial void OnCustomerIDChanged();
partial void OnEmployeeIDChanging(System.Nullable<int> value);
partial void OnEmployeeIDChanged();
partial void OnOrderDateChanging(System.Nullable<System.DateTime> value);
partial void OnOrderDateChanged();
partial void OnRequiredDateChanging(System.Nullable<System.DateTime> value);
partial void OnRequiredDateChanged();
partial void OnShippedDateChanging(System.Nullable<System.DateTime> value);
partial void OnShippedDateChanged();
partial void OnShipViaChanging(System.Nullable<int> value);
partial void OnShipViaChanged();
partial void OnFreightChanging(System.Nullable<decimal> value);
partial void OnFreightChanged();
partial void OnShipNameChanging(string value);
partial void OnShipNameChanged();
partial void OnShipAddressChanging(string value);
partial void OnShipAddressChanged();
partial void OnShipCityChanging(string value);
partial void OnShipCityChanged();
partial void OnShipRegionChanging(string value);
partial void OnShipRegionChanged();
partial void OnShipPostalCodeChanging(string value);
partial void OnShipPostalCodeChanged();
partial void OnShipCountryChanging(string value);
partial void OnShipCountryChanged();
#endregion
public Orders()
{
this._OrderDetails = new EntitySet<OrderDetails>(new Action<OrderDetails>(this.attach_OrderDetails), new Action<OrderDetails>(this.detach_OrderDetails));
this._Customers = default(EntityRef<Customers>);
this._Employees = default(EntityRef<Employees>);
OnCreated();
}
/// <summary>
/// There are no comments for OrderID in the schema.
/// </summary>
[Column(Storage = "_OrderID", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "int NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int OrderID
{
get
{
return this._OrderID;
}
set
{
if (this._OrderID != value)
{
this.OnOrderIDChanging(value);
this.SendPropertyChanging("OrderID");
this._OrderID = value;
this.SendPropertyChanged("OrderID");
this.OnOrderIDChanged();
}
}
}
/// <summary>
/// There are no comments for CustomerID in the schema.
/// </summary>
[Column(Storage = "_CustomerID", DbType = "nchar(5)")]
public string CustomerID
{
get
{
return this._CustomerID;
}
set
{
if (this._CustomerID != value)
{
if (this._Customers.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCustomerIDChanging(value);
this.SendPropertyChanging("CustomerID");
this._CustomerID = value;
this.SendPropertyChanged("CustomerID");
this.OnCustomerIDChanged();
}
}
}
/// <summary>
/// There are no comments for EmployeeID in the schema.
/// </summary>
[Column(Storage = "_EmployeeID", DbType = "int")]
public System.Nullable<int> EmployeeID
{
get
{
return this._EmployeeID;
}
set
{
if (this._EmployeeID != value)
{
if (this._Employees.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnEmployeeIDChanging(value);
this.SendPropertyChanging("EmployeeID");
this._EmployeeID = value;
this.SendPropertyChanged("EmployeeID");
this.OnEmployeeIDChanged();
}
}
}
/// <summary>
/// There are no comments for OrderDate in the schema.
/// </summary>
[Column(Storage = "_OrderDate", DbType = "datetime2")]
public System.Nullable<System.DateTime> OrderDate
{
get
{
return this._OrderDate;
}
set
{
if (this._OrderDate != value)
{
this.OnOrderDateChanging(value);
this.SendPropertyChanging("OrderDate");
this._OrderDate = value;
this.SendPropertyChanged("OrderDate");
this.OnOrderDateChanged();
}
}
}
/// <summary>
/// There are no comments for RequiredDate in the schema.
/// </summary>
[Column(Storage = "_RequiredDate", DbType = "datetime2")]
public System.Nullable<System.DateTime> RequiredDate
{
get
{
return this._RequiredDate;
}
set
{
if (this._RequiredDate != value)
{
this.OnRequiredDateChanging(value);
this.SendPropertyChanging("RequiredDate");
this._RequiredDate = value;
this.SendPropertyChanged("RequiredDate");
this.OnRequiredDateChanged();
}
}
}
/// <summary>
/// There are no comments for ShippedDate in the schema.
/// </summary>
[Column(Storage = "_ShippedDate", DbType = "datetime2")]
public System.Nullable<System.DateTime> ShippedDate
{
get
{
return this._ShippedDate;
}
set
{
if (this._ShippedDate != value)
{
this.OnShippedDateChanging(value);
this.SendPropertyChanging("ShippedDate");
this._ShippedDate = value;
this.SendPropertyChanged("ShippedDate");
this.OnShippedDateChanged();
}
}
}
/// <summary>
/// There are no comments for ShipVia in the schema.
/// </summary>
[Column(Storage = "_ShipVia", DbType = "int")]
public System.Nullable<int> ShipVia
{
get
{
return this._ShipVia;
}
set
{
if (this._ShipVia != value)
{
this.OnShipViaChanging(value);
this.SendPropertyChanging("ShipVia");
this._ShipVia = value;
this.SendPropertyChanged("ShipVia");
this.OnShipViaChanged();
}
}
}
/// <summary>
/// There are no comments for Freight in the schema.
/// </summary>
[Column(Storage = "_Freight", DbType = "decimal(19,4)")]
public System.Nullable<decimal> Freight
{
get
{
return this._Freight;
}
set
{
if (this._Freight != value)
{
this.OnFreightChanging(value);
this.SendPropertyChanging("Freight");
this._Freight = value;
this.SendPropertyChanged("Freight");
this.OnFreightChanged();
}
}
}
/// <summary>
/// There are no comments for ShipName in the schema.
/// </summary>
[Column(Storage = "_ShipName", DbType = "nvarchar(40)")]
public string ShipName
{
get
{
return this._ShipName;
}
set
{
if (this._ShipName != value)
{
this.OnShipNameChanging(value);
this.SendPropertyChanging("ShipName");
this._ShipName = value;
this.SendPropertyChanged("ShipName");
this.OnShipNameChanged();
}
}
}
/// <summary>
/// There are no comments for ShipAddress in the schema.
/// </summary>
[Column(Storage = "_ShipAddress", DbType = "nvarchar(60)")]
public string ShipAddress
{
get
{
return this._ShipAddress;
}
set
{
if (this._ShipAddress != value)
{
this.OnShipAddressChanging(value);
this.SendPropertyChanging("ShipAddress");
this._ShipAddress = value;
this.SendPropertyChanged("ShipAddress");
this.OnShipAddressChanged();
}
}
}
/// <summary>
/// There are no comments for ShipCity in the schema.
/// </summary>
[Column(Storage = "_ShipCity", DbType = "nvarchar(15)")]
public string ShipCity
{
get
{
return this._ShipCity;
}
set
{
if (this._ShipCity != value)
{
this.OnShipCityChanging(value);
this.SendPropertyChanging("ShipCity");
this._ShipCity = value;
this.SendPropertyChanged("ShipCity");
this.OnShipCityChanged();
}
}
}
/// <summary>
/// There are no comments for ShipRegion in the schema.
/// </summary>
[Column(Storage = "_ShipRegion", DbType = "nvarchar(15)")]
public string ShipRegion
{
get
{
return this._ShipRegion;
}
set
{
if (this._ShipRegion != value)
{
this.OnShipRegionChanging(value);
this.SendPropertyChanging("ShipRegion");
this._ShipRegion = value;
this.SendPropertyChanged("ShipRegion");
this.OnShipRegionChanged();
}
}
}
/// <summary>
/// There are no comments for ShipPostalCode in the schema.
/// </summary>
[Column(Storage = "_ShipPostalCode", DbType = "nvarchar(10)")]
public string ShipPostalCode
{
get
{
return this._ShipPostalCode;
}
set
{
if (this._ShipPostalCode != value)
{
this.OnShipPostalCodeChanging(value);
this.SendPropertyChanging("ShipPostalCode");
this._ShipPostalCode = value;
this.SendPropertyChanged("ShipPostalCode");
this.OnShipPostalCodeChanged();
}
}
}
/// <summary>
/// There are no comments for ShipCountry in the schema.
/// </summary>
[Column(Storage = "_ShipCountry", DbType = "nvarchar(15)")]
public string ShipCountry
{
get
{
return this._ShipCountry;
}
set
{
if (this._ShipCountry != value)
{
this.OnShipCountryChanging(value);
this.SendPropertyChanging("ShipCountry");
this._ShipCountry = value;
this.SendPropertyChanged("ShipCountry");
this.OnShipCountryChanged();
}
}
}
/// <summary>
/// There are no comments for OrderDetails in the schema.
/// </summary>
[Association(Name="Orders_OrderDetails", Storage="_OrderDetails", ThisKey="OrderID", OtherKey="OrderID", DeleteRule="NO ACTION")]
public EntitySet<OrderDetails> OrderDetails
{
get
{
return this._OrderDetails;
}
set
{
this._OrderDetails.Assign(value);
}
}
/// <summary>
/// There are no comments for Customers in the schema.
/// </summary>
[Association(Name="Customers_Orders", Storage="_Customers", ThisKey="CustomerID", OtherKey="CustomerID", IsForeignKey=true)]
public Customers Customers
{
get
{
return this._Customers.Entity;
}
set
{
Customers previousValue = this._Customers.Entity;
if ((previousValue != value) || (this._Customers.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Customers");
if (previousValue != null)
{
this._Customers.Entity = null;
previousValue.Orders.Remove(this);
}
this._Customers.Entity = value;
if (value != null)
{
this._CustomerID = value.CustomerID;
value.Orders.Add(this);
}
else
{
this._CustomerID = default(string);
}
this.SendPropertyChanged("Customers");
}
}
}
/// <summary>
/// There are no comments for Employees in the schema.
/// </summary>
[Association(Name="Employees_Orders", Storage="_Employees", ThisKey="EmployeeID", OtherKey="EmployeeID", IsForeignKey=true)]
public Employees Employees
{
get
{
return this._Employees.Entity;
}
set
{
Employees previousValue = this._Employees.Entity;
if ((previousValue != value) || (this._Employees.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Employees");
if (previousValue != null)
{
this._Employees.Entity = null;
previousValue.Orders.Remove(this);
}
this._Employees.Entity = value;
if (value != null)
{
this._EmployeeID = value.EmployeeID;
value.Orders.Add(this);
}
else
{
this._EmployeeID = default(System.Nullable<int>);
}
this.SendPropertyChanged("Employees");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_OrderDetails(OrderDetails entity)
{
this.SendPropertyChanging();
entity.Orders = this;
}
private void detach_OrderDetails(OrderDetails entity)
{
this.SendPropertyChanging();
entity.Orders = null;
}
}
/// <summary>
/// There are no comments for DbContext.Products in the schema.
/// </summary>
[Table(Name = @"dbo.Products")]
public partial class Products : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _ProductID;
private string _ProductName;
private System.Nullable<int> _SupplierID;
private System.Nullable<int> _CategoryID;
private string _QuantityPerUnit;
private System.Nullable<decimal> _UnitPrice = 0m;
private System.Nullable<short> _UnitsInStock = 0;
private System.Nullable<short> _UnitsOnOrder = 0;
private System.Nullable<short> _ReorderLevel = 0;
private bool _Discontinued = false;
#pragma warning restore 0649
private EntitySet<OrderDetails> _OrderDetails;
private EntityRef<Categories> _Categories;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnProductNameChanging(string value);
partial void OnProductNameChanged();
partial void OnSupplierIDChanging(System.Nullable<int> value);
partial void OnSupplierIDChanged();
partial void OnCategoryIDChanging(System.Nullable<int> value);
partial void OnCategoryIDChanged();
partial void OnQuantityPerUnitChanging(string value);
partial void OnQuantityPerUnitChanged();
partial void OnUnitPriceChanging(System.Nullable<decimal> value);
partial void OnUnitPriceChanged();
partial void OnUnitsInStockChanging(System.Nullable<short> value);
partial void OnUnitsInStockChanged();
partial void OnUnitsOnOrderChanging(System.Nullable<short> value);
partial void OnUnitsOnOrderChanged();
partial void OnReorderLevelChanging(System.Nullable<short> value);
partial void OnReorderLevelChanged();
partial void OnDiscontinuedChanging(bool value);
partial void OnDiscontinuedChanged();
#endregion
public Products()
{
this._OrderDetails = new EntitySet<OrderDetails>(new Action<OrderDetails>(this.attach_OrderDetails), new Action<OrderDetails>(this.detach_OrderDetails));
this._Categories = default(EntityRef<Categories>);
OnCreated();
}
/// <summary>
/// There are no comments for ProductID in the schema.
/// </summary>
[Column(Storage = "_ProductID", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "int NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if (this._ProductID != value)
{
this.OnProductIDChanging(value);
this.SendPropertyChanging("ProductID");
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
}
/// <summary>
/// There are no comments for ProductName in the schema.
/// </summary>
[Column(Storage = "_ProductName", CanBeNull = false, DbType = "nvarchar(40) NOT NULL")]
public string ProductName
{
get
{
return this._ProductName;
}
set
{
if (this._ProductName != value)
{
this.OnProductNameChanging(value);
this.SendPropertyChanging("ProductName");
this._ProductName = value;
this.SendPropertyChanged("ProductName");
this.OnProductNameChanged();
}
}
}
/// <summary>
/// There are no comments for SupplierID in the schema.
/// </summary>
[Column(Storage = "_SupplierID", DbType = "int")]
public System.Nullable<int> SupplierID
{
get
{
return this._SupplierID;
}
set
{
if (this._SupplierID != value)
{
this.OnSupplierIDChanging(value);
this.SendPropertyChanging("SupplierID");
this._SupplierID = value;
this.SendPropertyChanged("SupplierID");
this.OnSupplierIDChanged();
}
}
}
/// <summary>
/// There are no comments for CategoryID in the schema.
/// </summary>
[Column(Storage = "_CategoryID", DbType = "int")]
public System.Nullable<int> CategoryID
{
get
{
return this._CategoryID;
}
set
{
if (this._CategoryID != value)
{
if (this._Categories.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCategoryIDChanging(value);
this.SendPropertyChanging("CategoryID");
this._CategoryID = value;
this.SendPropertyChanged("CategoryID");
this.OnCategoryIDChanged();
}
}
}
/// <summary>
/// There are no comments for QuantityPerUnit in the schema.
/// </summary>
[Column(Storage = "_QuantityPerUnit", DbType = "nvarchar(20)")]
public string QuantityPerUnit
{
get
{
return this._QuantityPerUnit;
}
set
{
if (this._QuantityPerUnit != value)
{
this.OnQuantityPerUnitChanging(value);
this.SendPropertyChanging("QuantityPerUnit");
this._QuantityPerUnit = value;
this.SendPropertyChanged("QuantityPerUnit");
this.OnQuantityPerUnitChanged();
}
}
}
/// <summary>
/// There are no comments for UnitPrice in the schema.
/// </summary>
[Column(Storage = "_UnitPrice", DbType = "decimal(19,4)")]
public System.Nullable<decimal> UnitPrice
{
get
{
return this._UnitPrice;
}
set
{
if (this._UnitPrice != value)
{
this.OnUnitPriceChanging(value);
this.SendPropertyChanging("UnitPrice");
this._UnitPrice = value;
this.SendPropertyChanged("UnitPrice");
this.OnUnitPriceChanged();
}
}
}
/// <summary>
/// There are no comments for UnitsInStock in the schema.
/// </summary>
[Column(Storage = "_UnitsInStock", DbType = "smallint")]
public System.Nullable<short> UnitsInStock
{
get
{
return this._UnitsInStock;
}
set
{
if (this._UnitsInStock != value)
{
this.OnUnitsInStockChanging(value);
this.SendPropertyChanging("UnitsInStock");
this._UnitsInStock = value;
this.SendPropertyChanged("UnitsInStock");
this.OnUnitsInStockChanged();
}
}
}
/// <summary>
/// There are no comments for UnitsOnOrder in the schema.
/// </summary>
[Column(Storage = "_UnitsOnOrder", DbType = "smallint")]
public System.Nullable<short> UnitsOnOrder
{
get
{
return this._UnitsOnOrder;
}
set
{
if (this._UnitsOnOrder != value)
{
this.OnUnitsOnOrderChanging(value);
this.SendPropertyChanging("UnitsOnOrder");
this._UnitsOnOrder = value;
this.SendPropertyChanged("UnitsOnOrder");
this.OnUnitsOnOrderChanged();
}
}
}
/// <summary>
/// There are no comments for ReorderLevel in the schema.
/// </summary>
[Column(Storage = "_ReorderLevel", DbType = "smallint")]
public System.Nullable<short> ReorderLevel
{
get
{
return this._ReorderLevel;
}
set
{
if (this._ReorderLevel != value)
{
this.OnReorderLevelChanging(value);
this.SendPropertyChanging("ReorderLevel");
this._ReorderLevel = value;
this.SendPropertyChanged("ReorderLevel");
this.OnReorderLevelChanged();
}
}
}
/// <summary>
/// There are no comments for Discontinued in the schema.
/// </summary>
[Column(Storage = "_Discontinued", CanBeNull = false, DbType = "bit NOT NULL")]
public bool Discontinued
{
get
{
return this._Discontinued;
}
set
{
if (this._Discontinued != value)
{
this.OnDiscontinuedChanging(value);
this.SendPropertyChanging("Discontinued");
this._Discontinued = value;
this.SendPropertyChanged("Discontinued");
this.OnDiscontinuedChanged();
}
}
}
/// <summary>
/// There are no comments for OrderDetails in the schema.
/// </summary>
[Association(Name="Products_OrderDetails", Storage="_OrderDetails", ThisKey="ProductID", OtherKey="ProductID", DeleteRule="NO ACTION")]
public EntitySet<OrderDetails> OrderDetails
{
get
{
return this._OrderDetails;
}
set
{
this._OrderDetails.Assign(value);
}
}
/// <summary>
/// There are no comments for Categories in the schema.
/// </summary>
[Association(Name="Categories_Products", Storage="_Categories", ThisKey="CategoryID", OtherKey="CategoryID", IsForeignKey=true)]
public Categories Categories
{
get
{
return this._Categories.Entity;
}
set
{
Categories previousValue = this._Categories.Entity;
if ((previousValue != value) || (this._Categories.HasLoadedOrAssignedValue == false))
{
this.SendPropertyChanging("Categories");
if (previousValue != null)
{
this._Categories.Entity = null;
previousValue.Products.Remove(this);
}
this._Categories.Entity = value;
if (value != null)
{
this._CategoryID = value.CategoryID;
value.Products.Add(this);
}
else
{
this._CategoryID = default(System.Nullable<int>);
}
this.SendPropertyChanged("Categories");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
private void attach_OrderDetails(OrderDetails entity)
{
this.SendPropertyChanging();
entity.Products = this;
}
private void detach_OrderDetails(OrderDetails entity)
{
this.SendPropertyChanging();
entity.Products = null;
}
}
/// <summary>
/// There are no comments for DbContext.Region in the schema.
/// </summary>
[Table(Name = @"dbo.Regions")]
public partial class Region : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(System.String.Empty);
#pragma warning disable 0649
private int _RegionID;
private string _RegionDescription;
#pragma warning restore 0649
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnRegionIDChanging(int value);
partial void OnRegionIDChanged();
partial void OnRegionDescriptionChanging(string value);
partial void OnRegionDescriptionChanged();
#endregion
public Region()
{
OnCreated();
}
/// <summary>
/// There are no comments for RegionID in the schema.
/// </summary>
[Column(Storage = "_RegionID", CanBeNull = false, DbType = "int NOT NULL", IsPrimaryKey = true)]
public int RegionID
{
get
{
return this._RegionID;
}
set
{
if (this._RegionID != value)
{
this.OnRegionIDChanging(value);
this.SendPropertyChanging("RegionID");
this._RegionID = value;
this.SendPropertyChanged("RegionID");
this.OnRegionIDChanged();
}
}
}
/// <summary>
/// There are no comments for RegionDescription in the schema.
/// </summary>
[Column(Storage = "_RegionDescription", CanBeNull = false, DbType = "nchar(50) NOT NULL")]
public string RegionDescription
{
get
{
return this._RegionDescription;
}
set
{
if (this._RegionDescription != value)
{
this.OnRegionDescriptionChanging(value);
this.SendPropertyChanging("RegionDescription");
this._RegionDescription = value;
this.SendPropertyChanged("RegionDescription");
this.OnRegionDescriptionChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, emptyChangingEventArgs);
}
protected virtual void SendPropertyChanging(System.String propertyName)
{
var handler = this.PropertyChanging;
if (handler != null)
handler(this, new PropertyChangingEventArgs(propertyName));
}
protected virtual void SendPropertyChanged(System.String propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
| 32.750976 | 213 | 0.51628 | [
"Apache-2.0"
] | glenn2223/LambdaExpressionBuilder | ExpressionBuilder.Test/Database/Northwind.cs | 109,030 | C# |
using Assets.UnityFoundation.Code.Common;
using Assets.UnityFoundation.DialogueSystem;
using System;
using UnityEditor;
using UnityEngine;
namespace Assets.UnityFoundation.Systems.DialogueSystem.Editor
{
public class ChangeDialogueNodeAction : IDialogueEditorAction
{
public static ChangeDialogueNodeAction Create(DialogueNode node)
{
return new ChangeDialogueNodeAction(node);
}
private readonly DialogueNode node;
private Optional<string> newText;
private Optional<SpearkerSO> newSpeaker;
private Optional<Vector2> newPosition;
private Optional<Vector2> addPosition;
private DialogueEditor editor;
public ChangeDialogueNodeAction(DialogueNode node)
{
this.node = node;
newText = Optional<string>.None();
newSpeaker = Optional<SpearkerSO>.None();
newPosition = Optional<Vector2>.None();
addPosition = Optional<Vector2>.None();
}
public ChangeDialogueNodeAction AddPosition(Vector2 offset)
{
addPosition = Optional<Vector2>.Some(offset);
return this;
}
public ChangeDialogueNodeAction SetText(string newText)
{
this.newText = Optional<string>.Some(newText);
return this;
}
public ChangeDialogueNodeAction SetSpeaker(SpearkerSO spearker)
{
newSpeaker = Optional<SpearkerSO>.Some(spearker);
return this;
}
public ChangeDialogueNodeAction SetPosition(Vector2 position)
{
newPosition = Optional<Vector2>.Some(position);
return this;
}
public void SetDialogueEditor(DialogueEditor editor)
{
this.editor = editor;
}
public void Handle()
{
Undo.RecordObject(node, "Update dialogue node");
newText.Some(text => node.Text = text);
newSpeaker.Some(speaker => node.Spearker = speaker);
newPosition.Some(position => node.Position = position);
addPosition.Some(offset => node.Position += offset);
EditorUtility.SetDirty(node);
editor.LinkingNodes.Clear();
}
}
} | 29.584416 | 72 | 0.619403 | [
"Apache-2.0"
] | BrunoBiluca/UnityFoundation | Systems/DialogueSystem/Editor/Actions/ChangeDialogueNodeAction.cs | 2,278 | C# |
using System.Threading.Tasks;
using Async_Await_CSharp.Interfaces;
namespace Async_Await_CSharp.Repositories
{
public class FakePersonRepository : TaskBase, IDoTaskAsync
{
private readonly int _delayInMilliseconds;
private readonly IFakePerson _fakePerson;
private readonly int _taskId;
private const string ClassIdentifier = "FakePersonRepository";
public FakePersonRepository(int taskId, int delayInMilliseconds, IFakePerson fakePerson)
{
_taskId = taskId;
_delayInMilliseconds = delayInMilliseconds;
_fakePerson = fakePerson;
}
public async Task<string> RunAsync()
{
return await RunAsyncTask(
ClassIdentifier,
_taskId,
_delayInMilliseconds,
_fakePerson.FullName);
}
}
} | 30.37931 | 96 | 0.641317 | [
"MIT"
] | briang123/Async-Await-CSharp | Async-Await-CSharp/Repositories/FakePersonRepository.cs | 883 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IceCoffee.DbCore.Primitives.Dto;
using TianYiSdtdServerTools.Client.Models.Entitys;
namespace TianYiSdtdServerTools.Client.Models.Dtos
{
public class GoodsDto : DtoBaseStr
{
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName { get; set; }
/// <summary>
/// 购买命令
/// </summary>
public string BuyCmd { get; set; }
/// <summary>
/// 内容 物品/实体ID/指令
/// </summary>
public string Content { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Amount { get; set; }
/// <summary>
/// 品质
/// </summary>
public int Quality { get; set; }
/// <summary>
/// 售价
/// </summary>
public int Price { get; set; }
/// <summary>
/// 商品类型
/// </summary>
public string GoodsType { get; set; }
}
}
| 21.55102 | 50 | 0.511364 | [
"MIT"
] | 1249993110/TianYiSdtdServerTools | Client/Models/Dtos/GoodsDto.cs | 1,110 | C# |
using UnityEngine;
[CreateAssetMenu(fileName = "BuffIconMap", menuName = "Ability System Demo/Buff Icon Map")]
public class BuffIconMap : ScriptableObject {
public int BuffIdentifier;
public Sprite Sprite;
public Color SpriteColor;
} | 30.75 | 91 | 0.760163 | [
"MIT"
] | jackshea/UnityGameplayAbilitySystem | Assets/Scripts/BuffIconMap.cs | 246 | C# |
// Copyright (c) MOSA Project. Licensed under the New BSD License.
using System.Collections.Generic;
using System.Linq;
namespace Mosa.Utility.UnitTests.Numbers
{
public static class I1
{
private static IList<sbyte> series = null;
public static IEnumerable<sbyte> Series
{
get
{
if (series == null) series = GetSeries();
foreach (sbyte value in series)
yield return value;
}
}
public static IList<sbyte> GetSeries()
{
var list = new List<sbyte>
{
0,
1,
2,
sbyte.MinValue,
sbyte.MaxValue,
sbyte.MinValue + 1,
sbyte.MaxValue - 1
};
AddNegatives(list);
list = list.Distinct().ToList();
list.Sort();
return list;
}
private static void AddNegatives(IList<sbyte> list)
{
foreach (var value in list.ToArray())
{
if (value > 0)
list.Add((sbyte)-value);
}
}
}
}
| 16.203704 | 67 | 0.624 | [
"BSD-3-Clause"
] | AnErrupTion/MOSA-Project | Source/Mosa.Utility.UnitTests/Numbers/I1.cs | 877 | C# |
using Chinook.Data;
using EasyLOB.Library;
namespace Chinook.Mvc
{
public class TaskSalesModel
{
public ZOperationResult OperationResult { get; set; }
public InvoiceViewModel Invoice { get; set; }
public InvoiceLineViewModel InvoiceLine { get; set; }
public TaskSalesModel()
{
OperationResult = new ZOperationResult();
Invoice = new InvoiceViewModel();
InvoiceLine = new InvoiceLineViewModel();
}
}
} | 24.809524 | 62 | 0.602687 | [
"MIT"
] | EasyLOB/EasyLOB-Chinook-1 | Chinook.Mvc.AJAX/Models/Chinook/Tasks/TaskSalesModel.cs | 523 | C# |
namespace Spring.Expressions.Parser.antlr
{
/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/license.html
*/
//
// ANTLR C# Code Generator by Micheal Jordan
// Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
// Anthony Oguntimehin
//
/// <summary>
/// This token tracks it's own index 0..n-1 relative to the beginning
/// of the stream. It is designed to work with
/// <see cref="TokenStreamRewriteEngine"/> in TokenStreamRewriteEngine.cs
/// </summary>
public class TokenWithIndex : CommonToken
{
/// <summary>
/// Index into token array indicating position in input stream
/// </summary>
int index;
public TokenWithIndex() : base()
{
}
public TokenWithIndex(int i, string t) : base(i, t)
{
}
public void setIndex(int i)
{
index = i;
}
public int getIndex()
{
return index;
}
public override string ToString()
{
return "["+index+":\"" + getText() + "\",<" + Type + ">,line=" + line + ",col=" + col + "]\n";
}
}
} | 23.816327 | 97 | 0.590403 | [
"Apache-2.0"
] | 18502079446/cusss | Sys.Expression/Expressions/Parser/antlr/TokenWithIndex.cs | 1,167 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using Assets.Sources.Core.Infrastructure;
namespace Assets.Sources.Core.Factory
{
public class PoolObjectFactory : IObjectFactory
{
/// <summary>
/// 封装的PoolData
/// </summary>
private class PoolData
{
public bool InUse { get; set; }
public object Obj { get; set; }
}
private readonly List<PoolData> _pool;
private readonly int _max;
/// <summary>
/// 如果超过了容器大小,是否限制
/// </summary>
private readonly bool _limit;
public PoolObjectFactory(int max, bool limit)
{
_max = max;
_limit = limit;
_pool = new List<PoolData>();
}
private PoolData GetPoolData(object obj)
{
lock (_pool)
{
for (var i = 0; i < _pool.Count; i++)
{
var p = _pool[i];
if (p.Obj == obj)
{
return p;
}
}
}
return null;
}
/// <summary>
/// 获取对象池中的真正对象
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
private object GetObject(Type type)
{
lock (_pool)
{
if (_pool.Count > 0)
{
if (_pool[0].Obj.GetType() != type)
{
throw new Exception(string.Format("the Pool Factory only for Type :{0}", _pool[0].Obj.GetType().Name));
}
}
for (var i = 0; i < _pool.Count; i++)
{
var p = _pool[i];
if (!p.InUse)
{
p.InUse = true;
return p.Obj;
}
}
if (_pool.Count >= _max && _limit)
{
throw new Exception("max limit is arrived.");
}
object obj = Activator.CreateInstance(type, false);
var p1 = new PoolData
{
InUse = true,
Obj = obj
};
_pool.Add(p1);
return obj;
}
}
private void PutObject(object obj)
{
var p = GetPoolData(obj);
if (p != null)
{
p.InUse = false;
}
}
public object AcquireObject(Type type)
{
return GetObject(type);
}
public object AcquireObject(string className)
{
return AcquireObject(TypeFinder.ResolveType(className));
}
public object AcquireObject<TInstance>() where TInstance : class, new()
{
return AcquireObject(typeof(TInstance));
}
public void ReleaseObject(object obj)
{
if (_pool.Count > _max)
{
if (obj is IDisposable)
{
((IDisposable)obj).Dispose();
}
var p = GetPoolData(obj);
lock (_pool)
{
_pool.Remove(p);
}
return;
}
PutObject(obj);
}
}
}
| 26.285714 | 127 | 0.398455 | [
"MIT"
] | MEyes/uMVVM | Assets/Sources/Core/Factory/PoolObjectFactory.cs | 3,554 | 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.AzureNextGen.Management.V20190801.Inputs
{
/// <summary>
/// Entity representing the reference to the deployment parameters.
/// </summary>
public sealed class ParametersLinkArgs : Pulumi.ResourceArgs
{
/// <summary>
/// If included, must match the ContentVersion in the template.
/// </summary>
[Input("contentVersion")]
public Input<string>? ContentVersion { get; set; }
/// <summary>
/// The URI of the parameters file.
/// </summary>
[Input("uri", required: true)]
public Input<string> Uri { get; set; } = null!;
public ParametersLinkArgs()
{
}
}
}
| 28.571429 | 81 | 0.631 | [
"Apache-2.0"
] | test-wiz-sec/pulumi-azure-nextgen | sdk/dotnet/Management/V20190801/Inputs/ParametersLinkArgs.cs | 1,000 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.