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 |
|---|---|---|---|---|---|---|---|---|
/*
Copyright (c) 2019-2020 Integrative Software LLC
Created: 6/2019
Author: Pablo Carbonell
*/
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace Integrative.Lara
{
internal sealed class PublishedItemHandler : BaseHandler
{
private readonly LaraOptions _options;
private readonly Application _app;
public PublishedItemHandler(RequestDelegate next, Application app, LaraOptions options) : base(next)
{
_options = options;
_app = app;
}
internal override async Task<bool> ProcessRequest(HttpContext http)
{
var combined = Published.CombinePathMethod(http.Request.Path, http.Request.Method);
if (!_app.TryGetNode(combined, out var item)) return false;
await item.Run(_app, http, _options);
return true;
}
}
}
| 26.727273
| 108
| 0.657596
|
[
"Apache-2.0"
] |
rChavz/lara
|
src/LaraUI/Middleware/PublishedItemHandler.cs
| 884
|
C#
|
namespace MetroEXControls
{
partial class SettingsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.radioTexAsPNG = new System.Windows.Forms.RadioButton();
this.radioTexAsTGA = new System.Windows.Forms.RadioButton();
this.radioTexAsLegacyDDS = new System.Windows.Forms.RadioButton();
this.radioTexAsDDS = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.chkMdlExportLods = new System.Windows.Forms.CheckBox();
this.chkMdlSaveSurfaceTextures = new System.Windows.Forms.CheckBox();
this.chkMdlExcludeCollision = new System.Windows.Forms.CheckBox();
this.chkMdlSaveWithTextures = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.chkMdlExportAnimsSeparate = new System.Windows.Forms.CheckBox();
this.chkMdlExportAnims = new System.Windows.Forms.CheckBox();
this.radioMdlAsFBX = new System.Windows.Forms.RadioButton();
this.radioMdlAsOBJ = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.radioSndAsWAV = new System.Windows.Forms.RadioButton();
this.radioSndAsOGG = new System.Windows.Forms.RadioButton();
this.chkExportAskEveryTime = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tabPageExport = new System.Windows.Forms.TabPage();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.tabPageExport.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Dock = System.Windows.Forms.DockStyle.Right;
this.btnOK.Location = new System.Drawing.Point(335, 0);
this.btnOK.Margin = new System.Windows.Forms.Padding(3, 3, 5, 3);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 25);
this.btnOK.TabIndex = 1;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Dock = System.Windows.Forms.DockStyle.Right;
this.btnCancel.Location = new System.Drawing.Point(416, 0);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 25);
this.btnCancel.TabIndex = 0;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// panel1
//
this.panel1.Controls.Add(this.btnOK);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 388);
this.panel1.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(491, 25);
this.panel1.TabIndex = 2;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Right;
this.label1.Location = new System.Drawing.Point(410, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(6, 25);
this.label1.TabIndex = 2;
this.label1.Text = "label1";
//
// radioTexAsPNG
//
this.radioTexAsPNG.AutoSize = true;
this.radioTexAsPNG.Location = new System.Drawing.Point(7, 92);
this.radioTexAsPNG.Name = "radioTexAsPNG";
this.radioTexAsPNG.Size = new System.Drawing.Size(95, 17);
this.radioTexAsPNG.TabIndex = 3;
this.radioTexAsPNG.Text = "Export as PNG";
this.radioTexAsPNG.UseVisualStyleBackColor = true;
//
// radioTexAsTGA
//
this.radioTexAsTGA.AutoSize = true;
this.radioTexAsTGA.Location = new System.Drawing.Point(7, 68);
this.radioTexAsTGA.Name = "radioTexAsTGA";
this.radioTexAsTGA.Size = new System.Drawing.Size(94, 17);
this.radioTexAsTGA.TabIndex = 2;
this.radioTexAsTGA.Text = "Export as TGA";
this.radioTexAsTGA.UseVisualStyleBackColor = true;
//
// radioTexAsLegacyDDS
//
this.radioTexAsLegacyDDS.AutoSize = true;
this.radioTexAsLegacyDDS.Location = new System.Drawing.Point(7, 44);
this.radioTexAsLegacyDDS.Name = "radioTexAsLegacyDDS";
this.radioTexAsLegacyDDS.Size = new System.Drawing.Size(129, 17);
this.radioTexAsLegacyDDS.TabIndex = 1;
this.radioTexAsLegacyDDS.Text = "Export as legacy DDS";
this.radioTexAsLegacyDDS.UseVisualStyleBackColor = true;
//
// radioTexAsDDS
//
this.radioTexAsDDS.AutoSize = true;
this.radioTexAsDDS.Checked = true;
this.radioTexAsDDS.Location = new System.Drawing.Point(7, 20);
this.radioTexAsDDS.Name = "radioTexAsDDS";
this.radioTexAsDDS.Size = new System.Drawing.Size(95, 17);
this.radioTexAsDDS.TabIndex = 0;
this.radioTexAsDDS.TabStop = true;
this.radioTexAsDDS.Text = "Export as DDS";
this.radioTexAsDDS.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioTexAsPNG);
this.groupBox1.Controls.Add(this.radioTexAsTGA);
this.groupBox1.Controls.Add(this.radioTexAsLegacyDDS);
this.groupBox1.Controls.Add(this.radioTexAsDDS);
this.groupBox1.Location = new System.Drawing.Point(8, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(468, 117);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Textures options:";
//
// chkMdlExportLods
//
this.chkMdlExportLods.AutoSize = true;
this.chkMdlExportLods.Location = new System.Drawing.Point(242, 91);
this.chkMdlExportLods.Name = "chkMdlExportLods";
this.chkMdlExportLods.Size = new System.Drawing.Size(78, 17);
this.chkMdlExportLods.TabIndex = 8;
this.chkMdlExportLods.Text = "Export lods";
this.chkMdlExportLods.UseVisualStyleBackColor = true;
//
// chkMdlSaveSurfaceTextures
//
this.chkMdlSaveSurfaceTextures.AutoSize = true;
this.chkMdlSaveSurfaceTextures.Location = new System.Drawing.Point(242, 68);
this.chkMdlSaveSurfaceTextures.Name = "chkMdlSaveSurfaceTextures";
this.chkMdlSaveSurfaceTextures.Size = new System.Drawing.Size(142, 17);
this.chkMdlSaveSurfaceTextures.TabIndex = 7;
this.chkMdlSaveSurfaceTextures.Text = "Save all surface textures";
this.chkMdlSaveSurfaceTextures.UseVisualStyleBackColor = true;
//
// chkMdlExcludeCollision
//
this.chkMdlExcludeCollision.AutoSize = true;
this.chkMdlExcludeCollision.Location = new System.Drawing.Point(242, 44);
this.chkMdlExcludeCollision.Name = "chkMdlExcludeCollision";
this.chkMdlExcludeCollision.Size = new System.Drawing.Size(150, 17);
this.chkMdlExcludeCollision.TabIndex = 6;
this.chkMdlExcludeCollision.Text = "Exclude collision geometry";
this.chkMdlExcludeCollision.UseVisualStyleBackColor = true;
//
// chkMdlSaveWithTextures
//
this.chkMdlSaveWithTextures.AutoSize = true;
this.chkMdlSaveWithTextures.Checked = true;
this.chkMdlSaveWithTextures.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkMdlSaveWithTextures.Location = new System.Drawing.Point(242, 20);
this.chkMdlSaveWithTextures.Name = "chkMdlSaveWithTextures";
this.chkMdlSaveWithTextures.Size = new System.Drawing.Size(113, 17);
this.chkMdlSaveWithTextures.TabIndex = 5;
this.chkMdlSaveWithTextures.Text = "Save with textures";
this.chkMdlSaveWithTextures.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label2.Location = new System.Drawing.Point(233, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(2, 106);
this.label2.TabIndex = 4;
//
// chkMdlExportAnimsSeparate
//
this.chkMdlExportAnimsSeparate.AutoSize = true;
this.chkMdlExportAnimsSeparate.Location = new System.Drawing.Point(7, 92);
this.chkMdlExportAnimsSeparate.Name = "chkMdlExportAnimsSeparate";
this.chkMdlExportAnimsSeparate.Size = new System.Drawing.Size(154, 17);
this.chkMdlExportAnimsSeparate.TabIndex = 3;
this.chkMdlExportAnimsSeparate.Text = "Animations to separate files";
this.chkMdlExportAnimsSeparate.UseVisualStyleBackColor = true;
//
// chkMdlExportAnims
//
this.chkMdlExportAnims.AutoSize = true;
this.chkMdlExportAnims.Checked = true;
this.chkMdlExportAnims.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkMdlExportAnims.Location = new System.Drawing.Point(7, 68);
this.chkMdlExportAnims.Name = "chkMdlExportAnims";
this.chkMdlExportAnims.Size = new System.Drawing.Size(109, 17);
this.chkMdlExportAnims.TabIndex = 2;
this.chkMdlExportAnims.Text = "Export animations";
this.chkMdlExportAnims.UseVisualStyleBackColor = true;
//
// radioMdlAsFBX
//
this.radioMdlAsFBX.AutoSize = true;
this.radioMdlAsFBX.Location = new System.Drawing.Point(7, 44);
this.radioMdlAsFBX.Name = "radioMdlAsFBX";
this.radioMdlAsFBX.Size = new System.Drawing.Size(92, 17);
this.radioMdlAsFBX.TabIndex = 1;
this.radioMdlAsFBX.TabStop = true;
this.radioMdlAsFBX.Text = "Export as FBX";
this.radioMdlAsFBX.UseVisualStyleBackColor = true;
//
// radioMdlAsOBJ
//
this.radioMdlAsOBJ.AutoSize = true;
this.radioMdlAsOBJ.Checked = true;
this.radioMdlAsOBJ.Location = new System.Drawing.Point(7, 20);
this.radioMdlAsOBJ.Name = "radioMdlAsOBJ";
this.radioMdlAsOBJ.Size = new System.Drawing.Size(92, 17);
this.radioMdlAsOBJ.TabIndex = 0;
this.radioMdlAsOBJ.TabStop = true;
this.radioMdlAsOBJ.Text = "Export as OBJ";
this.radioMdlAsOBJ.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.chkMdlExportLods);
this.groupBox2.Controls.Add(this.chkMdlSaveSurfaceTextures);
this.groupBox2.Controls.Add(this.chkMdlExcludeCollision);
this.groupBox2.Controls.Add(this.chkMdlSaveWithTextures);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.chkMdlExportAnimsSeparate);
this.groupBox2.Controls.Add(this.chkMdlExportAnims);
this.groupBox2.Controls.Add(this.radioMdlAsFBX);
this.groupBox2.Controls.Add(this.radioMdlAsOBJ);
this.groupBox2.Location = new System.Drawing.Point(9, 130);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(467, 120);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Models options:";
//
// radioSndAsWAV
//
this.radioSndAsWAV.AutoSize = true;
this.radioSndAsWAV.Location = new System.Drawing.Point(7, 44);
this.radioSndAsWAV.Name = "radioSndAsWAV";
this.radioSndAsWAV.Size = new System.Drawing.Size(97, 17);
this.radioSndAsWAV.TabIndex = 1;
this.radioSndAsWAV.TabStop = true;
this.radioSndAsWAV.Text = "Export as WAV";
this.radioSndAsWAV.UseVisualStyleBackColor = true;
//
// radioSndAsOGG
//
this.radioSndAsOGG.AutoSize = true;
this.radioSndAsOGG.Checked = true;
this.radioSndAsOGG.Location = new System.Drawing.Point(7, 20);
this.radioSndAsOGG.Name = "radioSndAsOGG";
this.radioSndAsOGG.Size = new System.Drawing.Size(96, 17);
this.radioSndAsOGG.TabIndex = 0;
this.radioSndAsOGG.TabStop = true;
this.radioSndAsOGG.Text = "Export as OGG";
this.radioSndAsOGG.UseVisualStyleBackColor = true;
//
// chkExportAskEveryTime
//
this.chkExportAskEveryTime.AutoSize = true;
this.chkExportAskEveryTime.Location = new System.Drawing.Point(15, 336);
this.chkExportAskEveryTime.Name = "chkExportAskEveryTime";
this.chkExportAskEveryTime.Size = new System.Drawing.Size(168, 17);
this.chkExportAskEveryTime.TabIndex = 6;
this.chkExportAskEveryTime.Text = "Show this dialog before export";
this.chkExportAskEveryTime.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.radioSndAsWAV);
this.groupBox3.Controls.Add(this.radioSndAsOGG);
this.groupBox3.Location = new System.Drawing.Point(8, 256);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(467, 71);
this.groupBox3.TabIndex = 5;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Sounds options:";
//
// tabPageExport
//
this.tabPageExport.Controls.Add(this.chkExportAskEveryTime);
this.tabPageExport.Controls.Add(this.groupBox3);
this.tabPageExport.Controls.Add(this.groupBox2);
this.tabPageExport.Controls.Add(this.groupBox1);
this.tabPageExport.Location = new System.Drawing.Point(4, 22);
this.tabPageExport.Name = "tabPageExport";
this.tabPageExport.Padding = new System.Windows.Forms.Padding(3);
this.tabPageExport.Size = new System.Drawing.Size(486, 362);
this.tabPageExport.TabIndex = 0;
this.tabPageExport.Text = "Export options";
this.tabPageExport.UseVisualStyleBackColor = true;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPageExport);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(494, 388);
this.tabControl1.TabIndex = 1;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 413);
this.tableLayoutPanel1.TabIndex = 1;
//
// SettingsDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(494, 413);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.Load += new System.EventHandler(this.SettingsDlg_Load);
this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.tabPageExport.ResumeLayout(false);
this.tabPageExport.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
protected System.Windows.Forms.Button btnOK;
protected System.Windows.Forms.Button btnCancel;
protected System.Windows.Forms.Panel panel1;
protected System.Windows.Forms.Label label1;
protected System.Windows.Forms.RadioButton radioTexAsPNG;
protected System.Windows.Forms.RadioButton radioTexAsTGA;
protected System.Windows.Forms.RadioButton radioTexAsLegacyDDS;
protected System.Windows.Forms.RadioButton radioTexAsDDS;
protected System.Windows.Forms.GroupBox groupBox1;
protected System.Windows.Forms.CheckBox chkMdlExportLods;
protected System.Windows.Forms.CheckBox chkMdlSaveSurfaceTextures;
protected System.Windows.Forms.CheckBox chkMdlExcludeCollision;
protected System.Windows.Forms.CheckBox chkMdlSaveWithTextures;
protected System.Windows.Forms.Label label2;
protected System.Windows.Forms.CheckBox chkMdlExportAnimsSeparate;
protected System.Windows.Forms.CheckBox chkMdlExportAnims;
protected System.Windows.Forms.RadioButton radioMdlAsFBX;
protected System.Windows.Forms.RadioButton radioMdlAsOBJ;
protected System.Windows.Forms.GroupBox groupBox2;
protected System.Windows.Forms.RadioButton radioSndAsWAV;
protected System.Windows.Forms.RadioButton radioSndAsOGG;
protected System.Windows.Forms.CheckBox chkExportAskEveryTime;
protected System.Windows.Forms.GroupBox groupBox3;
protected System.Windows.Forms.TabPage tabPageExport;
protected System.Windows.Forms.TabControl tabControl1;
protected System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}
| 51.602871
| 135
| 0.621929
|
[
"MIT"
] |
RolanS/MetroEX
|
libs/MetroEXControls/src/windows/SettingsDlg.Designer.cs
| 21,572
|
C#
|
using System;
namespace FuncSharp
{
/// <summary>
/// Base class and factory of canonical coproduct types.
/// </summary>
public abstract class CoproductBase : ICoproduct
{
public CoproductBase(int arity, int discriminator, object value)
{
CoproductArity = arity;
CoproductDiscriminator = discriminator;
CoproductValue = value;
}
public int CoproductArity { get; }
public int CoproductDiscriminator { get; }
public object CoproductValue { get; }
public override int GetHashCode()
{
return this.CoproductHashCode();
}
public override bool Equals(object obj)
{
return this.CoproductEquals(obj);
}
public override string ToString()
{
return this.CoproductToString();
}
protected T GetCoproductValue<T>()
{
if (CoproductValue is T)
{
return (T)CoproductValue;
}
return default(T);
}
}
/// <summary>
/// A 0-dimensional immutable coproduct.
/// </summary>
public class Coproduct0 : CoproductBase, ICoproduct0
{
protected Coproduct0()
: base(0, 0, null)
{
}
}
/// <summary>
/// Factory for 1-dimensional immutable coproducts.
/// </summary>
public static class Coproduct1
{
/// <summary>
/// Creates a new 1-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct1<T1> CreateFirst<T1>(T1 value)
{
return new Coproduct1<T1>(value);
}
}
/// <summary>
/// A 1-dimensional immutable coproduct.
/// </summary>
public class Coproduct1<T1> : CoproductBase, ICoproduct1<T1>
{
/// <summary>
/// Creates a new 1-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct1(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 1-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct1(ICoproduct1<T1> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 1-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct1(int discriminator, object value)
: base(1, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public R Match<R>(
Func<T1, R> ifFirst)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 2-dimensional immutable coproducts.
/// </summary>
public static class Coproduct2
{
/// <summary>
/// Creates a new 2-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct2<T1, T2> CreateFirst<T1, T2>(T1 value)
{
return new Coproduct2<T1, T2>(value);
}
/// <summary>
/// Creates a new 2-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct2<T1, T2> CreateSecond<T1, T2>(T2 value)
{
return new Coproduct2<T1, T2>(value);
}
}
/// <summary>
/// A 2-dimensional immutable coproduct.
/// </summary>
public class Coproduct2<T1, T2> : CoproductBase, ICoproduct2<T1, T2>
{
/// <summary>
/// Creates a new 2-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct2(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 2-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct2(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 2-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct2(ICoproduct2<T1, T2> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 2-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct2(int discriminator, object value)
: base(2, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 3-dimensional immutable coproducts.
/// </summary>
public static class Coproduct3
{
/// <summary>
/// Creates a new 3-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct3<T1, T2, T3> CreateFirst<T1, T2, T3>(T1 value)
{
return new Coproduct3<T1, T2, T3>(value);
}
/// <summary>
/// Creates a new 3-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct3<T1, T2, T3> CreateSecond<T1, T2, T3>(T2 value)
{
return new Coproduct3<T1, T2, T3>(value);
}
/// <summary>
/// Creates a new 3-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct3<T1, T2, T3> CreateThird<T1, T2, T3>(T3 value)
{
return new Coproduct3<T1, T2, T3>(value);
}
}
/// <summary>
/// A 3-dimensional immutable coproduct.
/// </summary>
public class Coproduct3<T1, T2, T3> : CoproductBase, ICoproduct3<T1, T2, T3>
{
/// <summary>
/// Creates a new 3-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct3(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 3-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct3(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 3-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct3(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 3-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct3(ICoproduct3<T1, T2, T3> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 3-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct3(int discriminator, object value)
: base(3, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 4-dimensional immutable coproducts.
/// </summary>
public static class Coproduct4
{
/// <summary>
/// Creates a new 4-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct4<T1, T2, T3, T4> CreateFirst<T1, T2, T3, T4>(T1 value)
{
return new Coproduct4<T1, T2, T3, T4>(value);
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct4<T1, T2, T3, T4> CreateSecond<T1, T2, T3, T4>(T2 value)
{
return new Coproduct4<T1, T2, T3, T4>(value);
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct4<T1, T2, T3, T4> CreateThird<T1, T2, T3, T4>(T3 value)
{
return new Coproduct4<T1, T2, T3, T4>(value);
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct4<T1, T2, T3, T4> CreateFourth<T1, T2, T3, T4>(T4 value)
{
return new Coproduct4<T1, T2, T3, T4>(value);
}
}
/// <summary>
/// A 4-dimensional immutable coproduct.
/// </summary>
public class Coproduct4<T1, T2, T3, T4> : CoproductBase, ICoproduct4<T1, T2, T3, T4>
{
/// <summary>
/// Creates a new 4-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct4(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct4(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct4(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 4-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct4(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 4-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct4(ICoproduct4<T1, T2, T3, T4> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 4-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct4(int discriminator, object value)
: base(4, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 5-dimensional immutable coproducts.
/// </summary>
public static class Coproduct5
{
/// <summary>
/// Creates a new 5-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct5<T1, T2, T3, T4, T5> CreateFirst<T1, T2, T3, T4, T5>(T1 value)
{
return new Coproduct5<T1, T2, T3, T4, T5>(value);
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct5<T1, T2, T3, T4, T5> CreateSecond<T1, T2, T3, T4, T5>(T2 value)
{
return new Coproduct5<T1, T2, T3, T4, T5>(value);
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct5<T1, T2, T3, T4, T5> CreateThird<T1, T2, T3, T4, T5>(T3 value)
{
return new Coproduct5<T1, T2, T3, T4, T5>(value);
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct5<T1, T2, T3, T4, T5> CreateFourth<T1, T2, T3, T4, T5>(T4 value)
{
return new Coproduct5<T1, T2, T3, T4, T5>(value);
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct5<T1, T2, T3, T4, T5> CreateFifth<T1, T2, T3, T4, T5>(T5 value)
{
return new Coproduct5<T1, T2, T3, T4, T5>(value);
}
}
/// <summary>
/// A 5-dimensional immutable coproduct.
/// </summary>
public class Coproduct5<T1, T2, T3, T4, T5> : CoproductBase, ICoproduct5<T1, T2, T3, T4, T5>
{
/// <summary>
/// Creates a new 5-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct5(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct5(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct5(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct5(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct5(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct5(ICoproduct5<T1, T2, T3, T4, T5> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 5-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct5(int discriminator, object value)
: base(5, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 6-dimensional immutable coproducts.
/// </summary>
public static class Coproduct6
{
/// <summary>
/// Creates a new 6-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateFirst<T1, T2, T3, T4, T5, T6>(T1 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateSecond<T1, T2, T3, T4, T5, T6>(T2 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateThird<T1, T2, T3, T4, T5, T6>(T3 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateFourth<T1, T2, T3, T4, T5, T6>(T4 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateFifth<T1, T2, T3, T4, T5, T6>(T5 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct6<T1, T2, T3, T4, T5, T6> CreateSixth<T1, T2, T3, T4, T5, T6>(T6 value)
{
return new Coproduct6<T1, T2, T3, T4, T5, T6>(value);
}
}
/// <summary>
/// A 6-dimensional immutable coproduct.
/// </summary>
public class Coproduct6<T1, T2, T3, T4, T5, T6> : CoproductBase, ICoproduct6<T1, T2, T3, T4, T5, T6>
{
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct6(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct6(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct6(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct6(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct6(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct6(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct6(ICoproduct6<T1, T2, T3, T4, T5, T6> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 6-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct6(int discriminator, object value)
: base(6, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 7-dimensional immutable coproducts.
/// </summary>
public static class Coproduct7
{
/// <summary>
/// Creates a new 7-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateFirst<T1, T2, T3, T4, T5, T6, T7>(T1 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateSecond<T1, T2, T3, T4, T5, T6, T7>(T2 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateThird<T1, T2, T3, T4, T5, T6, T7>(T3 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateFourth<T1, T2, T3, T4, T5, T6, T7>(T4 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateFifth<T1, T2, T3, T4, T5, T6, T7>(T5 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateSixth<T1, T2, T3, T4, T5, T6, T7>(T6 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct7<T1, T2, T3, T4, T5, T6, T7> CreateSeventh<T1, T2, T3, T4, T5, T6, T7>(T7 value)
{
return new Coproduct7<T1, T2, T3, T4, T5, T6, T7>(value);
}
}
/// <summary>
/// A 7-dimensional immutable coproduct.
/// </summary>
public class Coproduct7<T1, T2, T3, T4, T5, T6, T7> : CoproductBase, ICoproduct7<T1, T2, T3, T4, T5, T6, T7>
{
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct7(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct7(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct7(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct7(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct7(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct7(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct7(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct7(ICoproduct7<T1, T2, T3, T4, T5, T6, T7> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 7-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct7(int discriminator, object value)
: base(7, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 8-dimensional immutable coproducts.
/// </summary>
public static class Coproduct8
{
/// <summary>
/// Creates a new 8-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8>(T2 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8>(T3 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8>(T4 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8>(T5 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8>(T6 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8>(T7 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8>(T8 value)
{
return new Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8>(value);
}
}
/// <summary>
/// A 8-dimensional immutable coproduct.
/// </summary>
public class Coproduct8<T1, T2, T3, T4, T5, T6, T7, T8> : CoproductBase, ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8>
{
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct8(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct8(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct8(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct8(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct8(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct8(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct8(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct8(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct8(ICoproduct8<T1, T2, T3, T4, T5, T6, T7, T8> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 8-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct8(int discriminator, object value)
: base(8, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 9-dimensional immutable coproducts.
/// </summary>
public static class Coproduct9
{
/// <summary>
/// Creates a new 9-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T1 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T2 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T3 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T4 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T5 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T6 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T7 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T8 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T9 value)
{
return new Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(value);
}
}
/// <summary>
/// A 9-dimensional immutable coproduct.
/// </summary>
public class Coproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> : CoproductBase, ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
{
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct9(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct9(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct9(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct9(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct9(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct9(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct9(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct9(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct9(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct9(ICoproduct9<T1, T2, T3, T4, T5, T6, T7, T8, T9> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 9-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct9(int discriminator, object value)
: base(9, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 10-dimensional immutable coproducts.
/// </summary>
public static class Coproduct10
{
/// <summary>
/// Creates a new 10-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T1 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T2 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T3 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T4 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T5 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T6 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T7 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T8 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T9 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T10 value)
{
return new Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(value);
}
}
/// <summary>
/// A 10-dimensional immutable coproduct.
/// </summary>
public class Coproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : CoproductBase, ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
{
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct10(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct10(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct10(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct10(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct10(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct10(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct10(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct10(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct10(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct10(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct10(ICoproduct10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 10-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct10(int discriminator, object value)
: base(10, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 11-dimensional immutable coproducts.
/// </summary>
public static class Coproduct11
{
/// <summary>
/// Creates a new 11-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T1 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T2 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T3 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T4 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T5 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T6 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T7 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T8 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T9 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T10 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(T11 value)
{
return new Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(value);
}
}
/// <summary>
/// A 11-dimensional immutable coproduct.
/// </summary>
public class Coproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : CoproductBase, ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
{
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct11(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct11(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct11(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct11(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct11(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct11(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct11(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct11(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct11(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct11(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct11(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct11(ICoproduct11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 11-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct11(int discriminator, object value)
: base(11, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 12-dimensional immutable coproducts.
/// </summary>
public static class Coproduct12
{
/// <summary>
/// Creates a new 12-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T1 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T2 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T3 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T4 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T5 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T6 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T7 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T8 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T9 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T10 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T11 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(T12 value)
{
return new Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(value);
}
}
/// <summary>
/// A 12-dimensional immutable coproduct.
/// </summary>
public class Coproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : CoproductBase, ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
{
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct12(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct12(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct12(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct12(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct12(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct12(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct12(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct12(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct12(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct12(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct12(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct12(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct12(ICoproduct12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 12-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct12(int discriminator, object value)
: base(12, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 13-dimensional immutable coproducts.
/// </summary>
public static class Coproduct13
{
/// <summary>
/// Creates a new 13-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T1 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T2 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T3 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T4 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T5 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T6 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T7 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T8 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T9 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T10 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T11 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T12 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(T13 value)
{
return new Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(value);
}
}
/// <summary>
/// A 13-dimensional immutable coproduct.
/// </summary>
public class Coproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : CoproductBase, ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
{
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct13(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct13(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct13(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct13(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct13(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct13(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct13(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct13(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct13(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct13(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct13(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct13(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct13(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct13(ICoproduct13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 13-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct13(int discriminator, object value)
: base(13, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 14-dimensional immutable coproducts.
/// </summary>
public static class Coproduct14
{
/// <summary>
/// Creates a new 14-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T1 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T2 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T3 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T4 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T5 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T6 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T7 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T8 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T9 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T10 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T11 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T12 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T13 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(T14 value)
{
return new Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(value);
}
}
/// <summary>
/// A 14-dimensional immutable coproduct.
/// </summary>
public class Coproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : CoproductBase, ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
{
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct14(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct14(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct14(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct14(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct14(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct14(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct14(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct14(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct14(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct14(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct14(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct14(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct14(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct14(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct14(ICoproduct14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 14-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct14(int discriminator, object value)
: base(14, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 15-dimensional immutable coproducts.
/// </summary>
public static class Coproduct15
{
/// <summary>
/// Creates a new 15-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T1 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T2 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T3 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T4 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T5 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T6 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T7 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T8 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T9 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T10 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T11 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T12 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T13 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T14 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(T15 value)
{
return new Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(value);
}
}
/// <summary>
/// A 15-dimensional immutable coproduct.
/// </summary>
public class Coproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : CoproductBase, ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
{
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct15(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct15(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct15(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct15(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct15(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct15(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct15(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct15(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct15(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct15(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct15(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct15(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct15(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct15(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct15(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct15(ICoproduct15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 15-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct15(int discriminator, object value)
: base(15, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 16-dimensional immutable coproducts.
/// </summary>
public static class Coproduct16
{
/// <summary>
/// Creates a new 16-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T1 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T2 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T3 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T4 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T5 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T6 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T7 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T8 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T9 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T10 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T11 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T12 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T13 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T14 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T15 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the sixteenth value.
/// </summary>
public static ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CreateSixteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(T16 value)
{
return new Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(value);
}
}
/// <summary>
/// A 16-dimensional immutable coproduct.
/// </summary>
public class Coproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : CoproductBase, ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
{
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct16(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct16(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct16(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct16(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct16(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct16(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct16(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct16(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct16(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct16(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct16(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct16(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct16(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct16(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct16(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct with the specified value on the sixteenth position.
/// </summary>
public Coproduct16(T16 sixteenthValue)
: this(16, sixteenthValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct16(ICoproduct16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 16-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct16(int discriminator, object value)
: base(16, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public bool IsSixteenth
{
get { return CoproductDiscriminator == 16; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public IOption<T16> Sixteenth
{
get { return IsSixteenth ? Option.Valued((T16)CoproductValue) : Option.Empty<T16>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth,
Func<T16, R> ifSixteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
case 16: return ifSixteenth((T16)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null,
Action<T16> ifSixteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
case 16: ifSixteenth?.Invoke((T16)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 17-dimensional immutable coproducts.
/// </summary>
public static class Coproduct17
{
/// <summary>
/// Creates a new 17-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T1 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T2 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T3 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T4 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T5 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T6 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T7 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T8 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T9 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T10 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T11 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T12 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T13 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T14 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T15 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the sixteenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateSixteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T16 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the seventeenth value.
/// </summary>
public static ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> CreateSeventeenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(T17 value)
{
return new Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(value);
}
}
/// <summary>
/// A 17-dimensional immutable coproduct.
/// </summary>
public class Coproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> : CoproductBase, ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>
{
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct17(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct17(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct17(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct17(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct17(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct17(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct17(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct17(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct17(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct17(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct17(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct17(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct17(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct17(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct17(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the sixteenth position.
/// </summary>
public Coproduct17(T16 sixteenthValue)
: this(16, sixteenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct with the specified value on the seventeenth position.
/// </summary>
public Coproduct17(T17 seventeenthValue)
: this(17, seventeenthValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct17(ICoproduct17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 17-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct17(int discriminator, object value)
: base(17, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public bool IsSixteenth
{
get { return CoproductDiscriminator == 16; }
}
public bool IsSeventeenth
{
get { return CoproductDiscriminator == 17; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public IOption<T16> Sixteenth
{
get { return IsSixteenth ? Option.Valued((T16)CoproductValue) : Option.Empty<T16>(); }
}
public IOption<T17> Seventeenth
{
get { return IsSeventeenth ? Option.Valued((T17)CoproductValue) : Option.Empty<T17>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth,
Func<T16, R> ifSixteenth,
Func<T17, R> ifSeventeenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
case 16: return ifSixteenth((T16)CoproductValue);
case 17: return ifSeventeenth((T17)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null,
Action<T16> ifSixteenth = null,
Action<T17> ifSeventeenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
case 16: ifSixteenth?.Invoke((T16)CoproductValue); break;
case 17: ifSeventeenth?.Invoke((T17)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 18-dimensional immutable coproducts.
/// </summary>
public static class Coproduct18
{
/// <summary>
/// Creates a new 18-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T1 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T2 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T3 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T4 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T5 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T6 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T7 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T8 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T9 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T10 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T11 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T12 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T13 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T14 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T15 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the sixteenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateSixteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T16 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the seventeenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateSeventeenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T17 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the eighteenth value.
/// </summary>
public static ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> CreateEighteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(T18 value)
{
return new Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(value);
}
}
/// <summary>
/// A 18-dimensional immutable coproduct.
/// </summary>
public class Coproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> : CoproductBase, ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>
{
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct18(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct18(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct18(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct18(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct18(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct18(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct18(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct18(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct18(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct18(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct18(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct18(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct18(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct18(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct18(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the sixteenth position.
/// </summary>
public Coproduct18(T16 sixteenthValue)
: this(16, sixteenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the seventeenth position.
/// </summary>
public Coproduct18(T17 seventeenthValue)
: this(17, seventeenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct with the specified value on the eighteenth position.
/// </summary>
public Coproduct18(T18 eighteenthValue)
: this(18, eighteenthValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct18(ICoproduct18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 18-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct18(int discriminator, object value)
: base(18, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public bool IsSixteenth
{
get { return CoproductDiscriminator == 16; }
}
public bool IsSeventeenth
{
get { return CoproductDiscriminator == 17; }
}
public bool IsEighteenth
{
get { return CoproductDiscriminator == 18; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public IOption<T16> Sixteenth
{
get { return IsSixteenth ? Option.Valued((T16)CoproductValue) : Option.Empty<T16>(); }
}
public IOption<T17> Seventeenth
{
get { return IsSeventeenth ? Option.Valued((T17)CoproductValue) : Option.Empty<T17>(); }
}
public IOption<T18> Eighteenth
{
get { return IsEighteenth ? Option.Valued((T18)CoproductValue) : Option.Empty<T18>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth,
Func<T16, R> ifSixteenth,
Func<T17, R> ifSeventeenth,
Func<T18, R> ifEighteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
case 16: return ifSixteenth((T16)CoproductValue);
case 17: return ifSeventeenth((T17)CoproductValue);
case 18: return ifEighteenth((T18)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null,
Action<T16> ifSixteenth = null,
Action<T17> ifSeventeenth = null,
Action<T18> ifEighteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
case 16: ifSixteenth?.Invoke((T16)CoproductValue); break;
case 17: ifSeventeenth?.Invoke((T17)CoproductValue); break;
case 18: ifEighteenth?.Invoke((T18)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 19-dimensional immutable coproducts.
/// </summary>
public static class Coproduct19
{
/// <summary>
/// Creates a new 19-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T1 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T2 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T3 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T4 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T5 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T6 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T7 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T8 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T9 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T10 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T11 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T12 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T13 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T14 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T15 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the sixteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateSixteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T16 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the seventeenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateSeventeenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T17 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the eighteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateEighteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T18 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the nineteenth value.
/// </summary>
public static ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> CreateNineteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(T19 value)
{
return new Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(value);
}
}
/// <summary>
/// A 19-dimensional immutable coproduct.
/// </summary>
public class Coproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> : CoproductBase, ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>
{
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct19(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct19(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct19(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct19(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct19(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct19(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct19(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct19(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct19(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct19(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct19(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct19(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct19(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct19(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct19(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the sixteenth position.
/// </summary>
public Coproduct19(T16 sixteenthValue)
: this(16, sixteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the seventeenth position.
/// </summary>
public Coproduct19(T17 seventeenthValue)
: this(17, seventeenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the eighteenth position.
/// </summary>
public Coproduct19(T18 eighteenthValue)
: this(18, eighteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct with the specified value on the nineteenth position.
/// </summary>
public Coproduct19(T19 nineteenthValue)
: this(19, nineteenthValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct19(ICoproduct19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 19-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct19(int discriminator, object value)
: base(19, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public bool IsSixteenth
{
get { return CoproductDiscriminator == 16; }
}
public bool IsSeventeenth
{
get { return CoproductDiscriminator == 17; }
}
public bool IsEighteenth
{
get { return CoproductDiscriminator == 18; }
}
public bool IsNineteenth
{
get { return CoproductDiscriminator == 19; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public IOption<T16> Sixteenth
{
get { return IsSixteenth ? Option.Valued((T16)CoproductValue) : Option.Empty<T16>(); }
}
public IOption<T17> Seventeenth
{
get { return IsSeventeenth ? Option.Valued((T17)CoproductValue) : Option.Empty<T17>(); }
}
public IOption<T18> Eighteenth
{
get { return IsEighteenth ? Option.Valued((T18)CoproductValue) : Option.Empty<T18>(); }
}
public IOption<T19> Nineteenth
{
get { return IsNineteenth ? Option.Valued((T19)CoproductValue) : Option.Empty<T19>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth,
Func<T16, R> ifSixteenth,
Func<T17, R> ifSeventeenth,
Func<T18, R> ifEighteenth,
Func<T19, R> ifNineteenth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
case 16: return ifSixteenth((T16)CoproductValue);
case 17: return ifSeventeenth((T17)CoproductValue);
case 18: return ifEighteenth((T18)CoproductValue);
case 19: return ifNineteenth((T19)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null,
Action<T16> ifSixteenth = null,
Action<T17> ifSeventeenth = null,
Action<T18> ifEighteenth = null,
Action<T19> ifNineteenth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
case 16: ifSixteenth?.Invoke((T16)CoproductValue); break;
case 17: ifSeventeenth?.Invoke((T17)CoproductValue); break;
case 18: ifEighteenth?.Invoke((T18)CoproductValue); break;
case 19: ifNineteenth?.Invoke((T19)CoproductValue); break;
}
}
}
/// <summary>
/// Factory for 20-dimensional immutable coproducts.
/// </summary>
public static class Coproduct20
{
/// <summary>
/// Creates a new 20-dimensional coproduct with the first value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateFirst<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T1 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the second value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateSecond<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T2 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the third value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateThird<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T3 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the fourth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateFourth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T4 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the fifth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateFifth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T5 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the sixth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateSixth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T6 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the seventh value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateSeventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T7 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the eighth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateEighth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T8 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the ninth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateNinth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T9 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the tenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateTenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T10 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the eleventh value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateEleventh<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T11 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the twelfth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateTwelfth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T12 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the thirteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateThirteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T13 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the fourteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateFourteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T14 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the fifteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateFifteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T15 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the sixteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateSixteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T16 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the seventeenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateSeventeenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T17 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the eighteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateEighteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T18 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the nineteenth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateNineteenth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T19 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the twentieth value.
/// </summary>
public static ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> CreateTwentieth<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(T20 value)
{
return new Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(value);
}
}
/// <summary>
/// A 20-dimensional immutable coproduct.
/// </summary>
public class Coproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> : CoproductBase, ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>
{
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the first position.
/// </summary>
public Coproduct20(T1 firstValue)
: this(1, firstValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the second position.
/// </summary>
public Coproduct20(T2 secondValue)
: this(2, secondValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the third position.
/// </summary>
public Coproduct20(T3 thirdValue)
: this(3, thirdValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the fourth position.
/// </summary>
public Coproduct20(T4 fourthValue)
: this(4, fourthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the fifth position.
/// </summary>
public Coproduct20(T5 fifthValue)
: this(5, fifthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the sixth position.
/// </summary>
public Coproduct20(T6 sixthValue)
: this(6, sixthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the seventh position.
/// </summary>
public Coproduct20(T7 seventhValue)
: this(7, seventhValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the eighth position.
/// </summary>
public Coproduct20(T8 eighthValue)
: this(8, eighthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the ninth position.
/// </summary>
public Coproduct20(T9 ninthValue)
: this(9, ninthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the tenth position.
/// </summary>
public Coproduct20(T10 tenthValue)
: this(10, tenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the eleventh position.
/// </summary>
public Coproduct20(T11 eleventhValue)
: this(11, eleventhValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the twelfth position.
/// </summary>
public Coproduct20(T12 twelfthValue)
: this(12, twelfthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the thirteenth position.
/// </summary>
public Coproduct20(T13 thirteenthValue)
: this(13, thirteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the fourteenth position.
/// </summary>
public Coproduct20(T14 fourteenthValue)
: this(14, fourteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the fifteenth position.
/// </summary>
public Coproduct20(T15 fifteenthValue)
: this(15, fifteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the sixteenth position.
/// </summary>
public Coproduct20(T16 sixteenthValue)
: this(16, sixteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the seventeenth position.
/// </summary>
public Coproduct20(T17 seventeenthValue)
: this(17, seventeenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the eighteenth position.
/// </summary>
public Coproduct20(T18 eighteenthValue)
: this(18, eighteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the nineteenth position.
/// </summary>
public Coproduct20(T19 nineteenthValue)
: this(19, nineteenthValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct with the specified value on the twentieth position.
/// </summary>
public Coproduct20(T20 twentiethValue)
: this(20, twentiethValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct based on the specified source.
/// </summary>
public Coproduct20(ICoproduct20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> source)
: this(source.CoproductDiscriminator, source.CoproductValue)
{
}
/// <summary>
/// Creates a new 20-dimensional coproduct.
/// </summary>
/// <param name="discriminator">Discriminator of the value from interval [1, arity].</param>
/// <param name="value">Value of the coproduct on the position defined by the discriminator.</param>
protected Coproduct20(int discriminator, object value)
: base(20, discriminator, value)
{
}
public bool IsFirst
{
get { return CoproductDiscriminator == 1; }
}
public bool IsSecond
{
get { return CoproductDiscriminator == 2; }
}
public bool IsThird
{
get { return CoproductDiscriminator == 3; }
}
public bool IsFourth
{
get { return CoproductDiscriminator == 4; }
}
public bool IsFifth
{
get { return CoproductDiscriminator == 5; }
}
public bool IsSixth
{
get { return CoproductDiscriminator == 6; }
}
public bool IsSeventh
{
get { return CoproductDiscriminator == 7; }
}
public bool IsEighth
{
get { return CoproductDiscriminator == 8; }
}
public bool IsNinth
{
get { return CoproductDiscriminator == 9; }
}
public bool IsTenth
{
get { return CoproductDiscriminator == 10; }
}
public bool IsEleventh
{
get { return CoproductDiscriminator == 11; }
}
public bool IsTwelfth
{
get { return CoproductDiscriminator == 12; }
}
public bool IsThirteenth
{
get { return CoproductDiscriminator == 13; }
}
public bool IsFourteenth
{
get { return CoproductDiscriminator == 14; }
}
public bool IsFifteenth
{
get { return CoproductDiscriminator == 15; }
}
public bool IsSixteenth
{
get { return CoproductDiscriminator == 16; }
}
public bool IsSeventeenth
{
get { return CoproductDiscriminator == 17; }
}
public bool IsEighteenth
{
get { return CoproductDiscriminator == 18; }
}
public bool IsNineteenth
{
get { return CoproductDiscriminator == 19; }
}
public bool IsTwentieth
{
get { return CoproductDiscriminator == 20; }
}
public IOption<T1> First
{
get { return IsFirst ? Option.Valued((T1)CoproductValue) : Option.Empty<T1>(); }
}
public IOption<T2> Second
{
get { return IsSecond ? Option.Valued((T2)CoproductValue) : Option.Empty<T2>(); }
}
public IOption<T3> Third
{
get { return IsThird ? Option.Valued((T3)CoproductValue) : Option.Empty<T3>(); }
}
public IOption<T4> Fourth
{
get { return IsFourth ? Option.Valued((T4)CoproductValue) : Option.Empty<T4>(); }
}
public IOption<T5> Fifth
{
get { return IsFifth ? Option.Valued((T5)CoproductValue) : Option.Empty<T5>(); }
}
public IOption<T6> Sixth
{
get { return IsSixth ? Option.Valued((T6)CoproductValue) : Option.Empty<T6>(); }
}
public IOption<T7> Seventh
{
get { return IsSeventh ? Option.Valued((T7)CoproductValue) : Option.Empty<T7>(); }
}
public IOption<T8> Eighth
{
get { return IsEighth ? Option.Valued((T8)CoproductValue) : Option.Empty<T8>(); }
}
public IOption<T9> Ninth
{
get { return IsNinth ? Option.Valued((T9)CoproductValue) : Option.Empty<T9>(); }
}
public IOption<T10> Tenth
{
get { return IsTenth ? Option.Valued((T10)CoproductValue) : Option.Empty<T10>(); }
}
public IOption<T11> Eleventh
{
get { return IsEleventh ? Option.Valued((T11)CoproductValue) : Option.Empty<T11>(); }
}
public IOption<T12> Twelfth
{
get { return IsTwelfth ? Option.Valued((T12)CoproductValue) : Option.Empty<T12>(); }
}
public IOption<T13> Thirteenth
{
get { return IsThirteenth ? Option.Valued((T13)CoproductValue) : Option.Empty<T13>(); }
}
public IOption<T14> Fourteenth
{
get { return IsFourteenth ? Option.Valued((T14)CoproductValue) : Option.Empty<T14>(); }
}
public IOption<T15> Fifteenth
{
get { return IsFifteenth ? Option.Valued((T15)CoproductValue) : Option.Empty<T15>(); }
}
public IOption<T16> Sixteenth
{
get { return IsSixteenth ? Option.Valued((T16)CoproductValue) : Option.Empty<T16>(); }
}
public IOption<T17> Seventeenth
{
get { return IsSeventeenth ? Option.Valued((T17)CoproductValue) : Option.Empty<T17>(); }
}
public IOption<T18> Eighteenth
{
get { return IsEighteenth ? Option.Valued((T18)CoproductValue) : Option.Empty<T18>(); }
}
public IOption<T19> Nineteenth
{
get { return IsNineteenth ? Option.Valued((T19)CoproductValue) : Option.Empty<T19>(); }
}
public IOption<T20> Twentieth
{
get { return IsTwentieth ? Option.Valued((T20)CoproductValue) : Option.Empty<T20>(); }
}
public R Match<R>(
Func<T1, R> ifFirst,
Func<T2, R> ifSecond,
Func<T3, R> ifThird,
Func<T4, R> ifFourth,
Func<T5, R> ifFifth,
Func<T6, R> ifSixth,
Func<T7, R> ifSeventh,
Func<T8, R> ifEighth,
Func<T9, R> ifNinth,
Func<T10, R> ifTenth,
Func<T11, R> ifEleventh,
Func<T12, R> ifTwelfth,
Func<T13, R> ifThirteenth,
Func<T14, R> ifFourteenth,
Func<T15, R> ifFifteenth,
Func<T16, R> ifSixteenth,
Func<T17, R> ifSeventeenth,
Func<T18, R> ifEighteenth,
Func<T19, R> ifNineteenth,
Func<T20, R> ifTwentieth)
{
switch (CoproductDiscriminator)
{
case 1: return ifFirst((T1)CoproductValue);
case 2: return ifSecond((T2)CoproductValue);
case 3: return ifThird((T3)CoproductValue);
case 4: return ifFourth((T4)CoproductValue);
case 5: return ifFifth((T5)CoproductValue);
case 6: return ifSixth((T6)CoproductValue);
case 7: return ifSeventh((T7)CoproductValue);
case 8: return ifEighth((T8)CoproductValue);
case 9: return ifNinth((T9)CoproductValue);
case 10: return ifTenth((T10)CoproductValue);
case 11: return ifEleventh((T11)CoproductValue);
case 12: return ifTwelfth((T12)CoproductValue);
case 13: return ifThirteenth((T13)CoproductValue);
case 14: return ifFourteenth((T14)CoproductValue);
case 15: return ifFifteenth((T15)CoproductValue);
case 16: return ifSixteenth((T16)CoproductValue);
case 17: return ifSeventeenth((T17)CoproductValue);
case 18: return ifEighteenth((T18)CoproductValue);
case 19: return ifNineteenth((T19)CoproductValue);
case 20: return ifTwentieth((T20)CoproductValue);
default: return default(R);
}
}
public void Match(
Action<T1> ifFirst = null,
Action<T2> ifSecond = null,
Action<T3> ifThird = null,
Action<T4> ifFourth = null,
Action<T5> ifFifth = null,
Action<T6> ifSixth = null,
Action<T7> ifSeventh = null,
Action<T8> ifEighth = null,
Action<T9> ifNinth = null,
Action<T10> ifTenth = null,
Action<T11> ifEleventh = null,
Action<T12> ifTwelfth = null,
Action<T13> ifThirteenth = null,
Action<T14> ifFourteenth = null,
Action<T15> ifFifteenth = null,
Action<T16> ifSixteenth = null,
Action<T17> ifSeventeenth = null,
Action<T18> ifEighteenth = null,
Action<T19> ifNineteenth = null,
Action<T20> ifTwentieth = null)
{
switch (CoproductDiscriminator)
{
case 1: ifFirst?.Invoke((T1)CoproductValue); break;
case 2: ifSecond?.Invoke((T2)CoproductValue); break;
case 3: ifThird?.Invoke((T3)CoproductValue); break;
case 4: ifFourth?.Invoke((T4)CoproductValue); break;
case 5: ifFifth?.Invoke((T5)CoproductValue); break;
case 6: ifSixth?.Invoke((T6)CoproductValue); break;
case 7: ifSeventh?.Invoke((T7)CoproductValue); break;
case 8: ifEighth?.Invoke((T8)CoproductValue); break;
case 9: ifNinth?.Invoke((T9)CoproductValue); break;
case 10: ifTenth?.Invoke((T10)CoproductValue); break;
case 11: ifEleventh?.Invoke((T11)CoproductValue); break;
case 12: ifTwelfth?.Invoke((T12)CoproductValue); break;
case 13: ifThirteenth?.Invoke((T13)CoproductValue); break;
case 14: ifFourteenth?.Invoke((T14)CoproductValue); break;
case 15: ifFifteenth?.Invoke((T15)CoproductValue); break;
case 16: ifSixteenth?.Invoke((T16)CoproductValue); break;
case 17: ifSeventeenth?.Invoke((T17)CoproductValue); break;
case 18: ifEighteenth?.Invoke((T18)CoproductValue); break;
case 19: ifNineteenth?.Invoke((T19)CoproductValue); break;
case 20: ifTwentieth?.Invoke((T20)CoproductValue); break;
}
}
}
}
| 38.690145
| 245
| 0.540837
|
[
"MIT"
] |
KaliCZ/FuncSharp
|
src/FuncSharp/Coproduct/Coproduct.cs
| 266,964
|
C#
|
using System.Collections.Generic;
using System.Threading.Tasks;
using AspnetRunBasics.Models;
namespace AspnetRunBasics.Services
{
public interface ICatalogService
{
Task<IEnumerable<CatalogModel>> GetCatalog();
Task<IEnumerable<CatalogModel>> GetCatalogByCategory(string category);
Task<CatalogModel> GetCatalog(string id);
Task<CatalogModel> CreateCatalog(CatalogModel model);
}
}
| 30.5
| 78
| 0.749415
|
[
"MIT"
] |
JimmyDi/AspnetMicroservices
|
src/WebApps/AspnetRunBasics/Services/ICatalogService.cs
| 427
|
C#
|
namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using Microsoft.Azure.Cosmos.CosmosElements;
using Microsoft.Azure.Cosmos.Diagnostics;
using Microsoft.Azure.Cosmos.SDK.EmulatorTests;
using Microsoft.Azure.Cosmos.Services.Management.Tests.BaselineTest;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Linq;
using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper;
[VisualStudio.TestTools.UnitTesting.TestClass]
public sealed class EndToEndTraceWriterBaselineTests : BaselineTests<EndToEndTraceWriterBaselineTests.Input, EndToEndTraceWriterBaselineTests.Output>
{
public static CosmosClient client;
public static Database database;
public static Container container;
[ClassInitialize()]
public static async Task ClassInitAsync(TestContext context)
{
client = Microsoft.Azure.Cosmos.SDK.EmulatorTests.TestCommon.CreateCosmosClient(useGateway: false);
EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync(
Guid.NewGuid().ToString(),
cancellationToken: default);
EndToEndTraceWriterBaselineTests.container = await EndToEndTraceWriterBaselineTests.database.CreateContainerAsync(
id: Guid.NewGuid().ToString(),
partitionKeyPath: "/id",
throughput: 20000);
for (int i = 0; i < 100; i++)
{
CosmosObject cosmosObject = CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ "id", CosmosString.Create(i.ToString()) }
});
await container.CreateItemAsync(JToken.Parse(cosmosObject.ToString()));
}
}
[ClassCleanup()]
public static async Task ClassCleanupAsync()
{
if(database != null)
{
await EndToEndTraceWriterBaselineTests.database.DeleteStreamAsync();
}
}
[TestMethod]
public async Task ReadFeedAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// ReadFeed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryStreamIterator(
queryText: null);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ReadFeed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ReadFeed Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIteratorInternal<JToken> feedIterator = (FeedIteratorInternal<JToken>)container
.GetItemQueryIterator<JToken>(queryText: null);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> response = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ReadFeed Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ReadFeed Public API
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIterator feedIterator = container.GetItemQueryStreamIterator(
queryText: null);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ReadFeed Public API", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ReadFeed Public API Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIterator<JToken> feedIterator = container
.GetItemQueryIterator<JToken>(queryText: null);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task ChangeFeedAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// ChangeFeed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ContainerInternal containerInternal = (ContainerInternal)container;
FeedIteratorInternal feedIterator = (FeedIteratorInternal)containerInternal.GetChangeFeedStreamIterator(
ChangeFeedStartFrom.Beginning(),
ChangeFeedMode.Incremental);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NotModified)
{
break;
}
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ChangeFeed Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ContainerInternal containerInternal = (ContainerInternal)container;
FeedIteratorInternal<JToken> feedIterator = (FeedIteratorInternal<JToken>)containerInternal.GetChangeFeedIterator<JToken>(
ChangeFeedStartFrom.Beginning(),
ChangeFeedMode.Incremental);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NotModified)
{
break;
}
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ChangeFeed Public API
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ContainerInternal containerInternal = (ContainerInternal)container;
FeedIterator feedIterator = containerInternal.GetChangeFeedStreamIterator(
ChangeFeedStartFrom.Beginning(),
ChangeFeedMode.Incremental);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NotModified)
{
break;
}
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// ChangeFeed Public API Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ContainerInternal containerInternal = (ContainerInternal)container;
FeedIterator<JToken> feedIterator = containerInternal.GetChangeFeedIterator<JToken>(
ChangeFeedStartFrom.Beginning(),
ChangeFeedMode.Incremental);
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NotModified)
{
break;
}
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task QueryAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Query
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryStreamIterator(
queryText: "SELECT * FROM c");
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Query Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIteratorInternal<JToken> feedIterator = (FeedIteratorInternal<JToken>)container.GetItemQueryIterator<JToken>(
queryText: "SELECT * FROM c");
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> response = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Query Public API
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIterator feedIterator = container.GetItemQueryStreamIterator(
queryText: "SELECT * FROM c");
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
ResponseMessage responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Query Public API Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedIterator<JToken> feedIterator = container.GetItemQueryIterator<JToken>(
queryText: "SELECT * FROM c");
List<ITrace> traces = new List<ITrace>();
while (feedIterator.HasMoreResults)
{
FeedResponse<JToken> responseMessage = await feedIterator.ReadNextAsync(cancellationToken: default);
ITrace trace = ((CosmosTraceDiagnostics)responseMessage.Diagnostics).Value;
traces.Add(trace);
}
ITrace traceForest = TraceJoiner.JoinTraces(traces);
endLineNumber = GetLineNumber();
inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task TypedPointOperationsAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Point Write
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
CosmosObject cosmosObject = CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ "id", CosmosString.Create(9001.ToString()) }
});
ItemResponse<JToken> itemResponse = await container.CreateItemAsync(JToken.Parse(cosmosObject.ToString()));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Read
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ItemResponse<JToken> itemResponse = await container.ReadItemAsync<JToken>(
id: "9001",
partitionKey: new Cosmos.PartitionKey("9001"));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Replace
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
CosmosObject cosmosObject = CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ "id", CosmosString.Create(9001.ToString()) },
{ "someField", CosmosString.Create(9001.ToString()) }
});
ItemResponse<JToken> itemResponse = await container.ReplaceItemAsync(
JToken.Parse(cosmosObject.ToString()),
id: "9001",
partitionKey: new Cosmos.PartitionKey("9001"));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Patch (This test creates a 500 on the backend ...)
//----------------------------------------------------------------
//{
// startLineNumber = GetLineNumber();
// ContainerInternal containerInternal = (ContainerInternal)container;
// List<PatchOperation> patchOperations = new List<PatchOperation>()
// {
// PatchOperation.Replace("/someField", "42")
// };
// ItemResponse<JToken> patchResponse = await containerInternal.PatchItemAsync<JToken>(
// id: "9001",
// partitionKey: new PartitionKey("9001"),
// patchOperations: patchOperations);
// ITrace trace = ((CosmosTraceDiagnostics)patchResponse.Diagnostics).Value;
// endLineNumber = GetLineNumber();
// inputs.Add(new Input("Point Patch", trace, startLineNumber, endLineNumber));
//}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Delete
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ItemRequestOptions requestOptions = new ItemRequestOptions();
ItemResponse<JToken> itemResponse = await container.DeleteItemAsync<JToken>(
id: "9001",
partitionKey: new PartitionKey("9001"),
requestOptions: requestOptions);
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task StreamPointOperationsAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Point Write
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
CosmosObject cosmosObject = CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ "id", CosmosString.Create(9001.ToString()) }
});
ResponseMessage itemResponse = await container.CreateItemStreamAsync(
new MemoryStream(Encoding.UTF8.GetBytes(cosmosObject.ToString())),
new Cosmos.PartitionKey("9001"));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Read
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ResponseMessage itemResponse = await container.ReadItemStreamAsync(
id: "9001",
partitionKey: new Cosmos.PartitionKey("9001"));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Replace
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
CosmosObject cosmosObject = CosmosObject.Create(
new Dictionary<string, CosmosElement>()
{
{ "id", CosmosString.Create(9001.ToString()) },
{ "someField", CosmosString.Create(9001.ToString()) }
});
ResponseMessage itemResponse = await container.ReplaceItemStreamAsync(
new MemoryStream(Encoding.UTF8.GetBytes(cosmosObject.ToString())),
id: "9001",
partitionKey: new Cosmos.PartitionKey("9001"));
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Patch (this one is flaky)
//----------------------------------------------------------------
//{
// startLineNumber = GetLineNumber();
// ItemRequestOptions requestOptions = new ItemRequestOptions();
// ContainerInternal containerInternal = (ContainerInternal)container;
// List<PatchOperation> patch = new List<PatchOperation>()
// {
// PatchOperation.Replace("/someField", "42")
// };
// ResponseMessage patchResponse = await containerInternal.PatchItemStreamAsync(
// id: "9001",
// partitionKey: new PartitionKey("9001"),
// patchOperations: patch,
// requestOptions: requestOptions);
// ITrace trace = ((CosmosTraceDiagnostics)patchResponse.Diagnostics).Value;
// endLineNumber = GetLineNumber();
// inputs.Add(new Input("Point Patch", trace, startLineNumber, endLineNumber));
//}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Delete
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ItemRequestOptions requestOptions = new ItemRequestOptions();
ContainerInternal containerInternal = (ContainerInternal)container;
ResponseMessage itemResponse = await containerInternal.DeleteItemStreamAsync(
id: "9001",
partitionKey: new PartitionKey("9001"),
requestOptions: requestOptions);
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task PointOperationsExceptionsAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Point Operation With Request Timeout
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ItemRequestOptions requestOptions = new ItemRequestOptions();
Guid exceptionActivityId = Guid.NewGuid();
string transportExceptionDescription = "transportExceptionDescription" + Guid.NewGuid();
Container containerWithTransportException = TransportClientHelper.GetContainerWithItemTransportException(
database.Id,
container.Id,
exceptionActivityId,
transportExceptionDescription);
//Checking point operation diagnostics on typed operations
ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity();
ITrace trace = null;
try
{
ItemResponse<ToDoActivity> createResponse = await containerWithTransportException.CreateItemAsync<ToDoActivity>(
item: testItem,
requestOptions: requestOptions);
Assert.Fail("Should have thrown a request timeout exception");
}
catch (CosmosException ce) when (ce.StatusCode == System.Net.HttpStatusCode.RequestTimeout)
{
trace = ((CosmosTraceDiagnostics)ce.Diagnostics).Value;
}
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Operation With Throttle
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
string errorMessage = "Mock throttle exception" + Guid.NewGuid().ToString();
Guid exceptionActivityId = Guid.NewGuid();
// Set a small retry count to reduce test time
CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder =>
builder.WithThrottlingRetryOptions(TimeSpan.FromSeconds(5), 5)
.WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper(
transportClient,
(uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation(
uri,
resourceOperation,
request,
exceptionActivityId,
errorMessage)))
);
ItemRequestOptions requestOptions = new ItemRequestOptions();
Container containerWithThrottleException = throttleClient.GetContainer(
database.Id,
container.Id);
//Checking point operation diagnostics on typed operations
ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity();
ITrace trace = null;
try
{
ItemResponse<ToDoActivity> createResponse = await containerWithThrottleException.CreateItemAsync<ToDoActivity>(
item: testItem,
requestOptions: requestOptions);
Assert.Fail("Should have thrown a request timeout exception");
}
catch (CosmosException ce) when ((int)ce.StatusCode == (int)Documents.StatusCodes.TooManyRequests)
{
trace = ((CosmosTraceDiagnostics)ce.Diagnostics).Value;
}
endLineNumber = GetLineNumber();
inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Point Operation With Forbidden
//----------------------------------------------------------------
{
List<int> stringLength = new List<int>();
foreach (int maxCount in new int[] { 1, 2, 4 })
{
startLineNumber = GetLineNumber();
int count = 0;
List<(string, string)> activityIdAndErrorMessage = new List<(string, string)>(maxCount);
Guid transportExceptionActivityId = Guid.NewGuid();
string transportErrorMessage = $"TransportErrorMessage{Guid.NewGuid()}";
Guid activityIdScope = Guid.Empty;
void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.DocumentServiceRequest request)
{
Assert.AreNotEqual(System.Diagnostics.Trace.CorrelationManager.ActivityId, Guid.Empty, "Activity scope should be set");
if (request.ResourceType == Documents.ResourceType.Document)
{
if (activityIdScope == Guid.Empty)
{
activityIdScope = System.Diagnostics.Trace.CorrelationManager.ActivityId;
}
else
{
Assert.AreEqual(System.Diagnostics.Trace.CorrelationManager.ActivityId, activityIdScope, "Activity scope should match on retries");
}
if (count >= maxCount)
{
TransportClientHelper.ThrowTransportExceptionOnItemOperation(
uri,
operation,
request,
transportExceptionActivityId,
transportErrorMessage);
}
count++;
string activityId = Guid.NewGuid().ToString();
string errorMessage = $"Error{Guid.NewGuid()}";
activityIdAndErrorMessage.Add((activityId, errorMessage));
TransportClientHelper.ThrowForbiddendExceptionOnItemOperation(
uri,
request,
activityId,
errorMessage);
}
}
Container containerWithTransportException = TransportClientHelper.GetContainerWithIntercepter(
database.Id,
container.Id,
interceptor);
//Checking point operation diagnostics on typed operations
ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity();
ITrace trace = null;
try
{
ItemResponse<ToDoActivity> createResponse = await containerWithTransportException.CreateItemAsync<ToDoActivity>(
item: testItem);
Assert.Fail("Should have thrown a request timeout exception");
}
catch (CosmosException ce) when (ce.StatusCode == System.Net.HttpStatusCode.RequestTimeout)
{
trace = ((CosmosTraceDiagnostics)ce.Diagnostics).Value;
stringLength.Add(trace.ToString().Length);
}
endLineNumber = GetLineNumber();
inputs.Add(new Input($"Point Operation With Forbidden + Max Count = {maxCount}", trace, startLineNumber, endLineNumber));
}
// Check if the exception message is not growing exponentially
Assert.IsTrue(stringLength.Count > 2);
for (int i = 0; i < stringLength.Count - 1; i++)
{
int currLength = stringLength[i];
int nextLength = stringLength[i + 1];
Assert.IsTrue(nextLength < currLength * 2,
$"The diagnostic string is growing faster than linear. Length: {currLength}, Next Length: {nextLength}");
}
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task BatchOperationsAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Standard Batch
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
string pkValue = "DiagnosticTestPk";
TransactionalBatch batch = container.CreateTransactionalBatch(new PartitionKey(pkValue));
BatchCore batchCore = (BatchCore)batch;
List<PatchOperation> patch = new List<PatchOperation>()
{
PatchOperation.Remove("/cost")
};
List<ToDoActivity> createItems = new List<ToDoActivity>();
for (int i = 0; i < 50; i++)
{
ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(pk: pkValue);
createItems.Add(item);
batch.CreateItem<ToDoActivity>(item);
}
for (int i = 0; i < 20; i++)
{
batch.ReadItem(createItems[i].id);
batchCore.PatchItem(createItems[i].id, patch);
}
TransactionalBatchRequestOptions requestOptions = null;
TransactionalBatchResponse response = await batch.ExecuteAsync(requestOptions);
Assert.IsNotNull(response);
ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task BulkOperationsAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Standard Bulk
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
string pkValue = "DiagnosticBulkTestPk";
CosmosClient bulkClient = TestCommon.CreateCosmosClient(builder => builder.WithBulkExecution(true));
Container bulkContainer = bulkClient.GetContainer(database.Id, container.Id);
List<Task<ItemResponse<ToDoActivity>>> createItemsTasks = new List<Task<ItemResponse<ToDoActivity>>>();
for (int i = 0; i < 10; i++)
{
ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(pk: pkValue);
createItemsTasks.Add(bulkContainer.CreateItemAsync<ToDoActivity>(item, new PartitionKey(item.id)));
}
await Task.WhenAll(createItemsTasks);
List<ITrace> traces = new List<ITrace>();
foreach (Task<ItemResponse<ToDoActivity>> createTask in createItemsTasks)
{
ItemResponse<ToDoActivity> itemResponse = await createTask;
Assert.IsNotNull(itemResponse);
ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value;
traces.Add(trace);
}
endLineNumber = GetLineNumber();
foreach (ITrace trace in traces)
{
inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber));
}
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Bulk with retry on throttle
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
string errorMessage = "Mock throttle exception" + Guid.NewGuid().ToString();
Guid exceptionActivityId = Guid.NewGuid();
// Set a small retry count to reduce test time
CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder =>
builder.WithThrottlingRetryOptions(TimeSpan.FromSeconds(5), 3)
.WithBulkExecution(true)
.WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper(
transportClient,
(uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation(
uri,
resourceOperation,
request,
exceptionActivityId,
errorMessage)))
);
ItemRequestOptions requestOptions = new ItemRequestOptions();
Container containerWithThrottleException = throttleClient.GetContainer(
database.Id,
container.Id);
ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity();
ITrace trace = null;
try
{
ItemResponse<ToDoActivity> createResponse = await containerWithThrottleException.CreateItemAsync<ToDoActivity>(
item: testItem,
partitionKey: new PartitionKey(testItem.id),
requestOptions: requestOptions);
Assert.Fail("Should have thrown a throttling exception");
}
catch (CosmosException ce) when ((int)ce.StatusCode == (int)Documents.StatusCodes.TooManyRequests)
{
trace = ((CosmosTraceDiagnostics)ce.Diagnostics).Value;
}
endLineNumber = GetLineNumber();
inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber));
}
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task MiscellanousAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
//----------------------------------------------------------------
// Custom Handler
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
TimeSpan delayTime = TimeSpan.FromSeconds(2);
RequestHandler requestHandler = new RequestHandlerSleepHelper(delayTime);
CosmosClient cosmosClient = TestCommon.CreateCosmosClient(builder =>
builder.AddCustomHandlers(requestHandler));
DatabaseResponse databaseResponse = await cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString());
EndToEndTraceWriterBaselineTests.AssertCustomHandlerTime(
databaseResponse.Diagnostics.ToString(),
requestHandler.FullHandlerName,
delayTime);
ITrace trace = ((CosmosTraceDiagnostics)databaseResponse.Diagnostics).Value;
await databaseResponse.Database.DeleteAsync();
endLineNumber = GetLineNumber();
inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Non Data Plane
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
RequestOptions requestOptions = new RequestOptions();
DatabaseResponse databaseResponse = await client.CreateDatabaseAsync(
id: Guid.NewGuid().ToString(),
requestOptions: requestOptions);
ITrace trace = ((CosmosTraceDiagnostics)databaseResponse.Diagnostics).Value;
await databaseResponse.Database.DeleteAsync();
endLineNumber = GetLineNumber();
inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
[TestMethod]
public async Task ReadManyAsync()
{
List<Input> inputs = new List<Input>();
int startLineNumber;
int endLineNumber;
for (int i = 0; i < 5; i++)
{
ToDoActivity item = ToDoActivity.CreateRandomToDoActivity("pk" + i, "id" + i);
await container.CreateItemAsync(item);
}
List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>();
for (int i = 0; i < 5; i++)
{
itemList.Add(("id" + i, new PartitionKey(i.ToString())));
}
//----------------------------------------------------------------
// Read Many Stream
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
ITrace trace;
using (ResponseMessage responseMessage = await container.ReadManyItemsStreamAsync(itemList))
{
trace = responseMessage.Trace;
}
endLineNumber = GetLineNumber();
inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
//----------------------------------------------------------------
// Read Many Typed
//----------------------------------------------------------------
{
startLineNumber = GetLineNumber();
FeedResponse<ToDoActivity> feedResponse = await container.ReadManyItemsAsync<ToDoActivity>(itemList);
ITrace trace = ((CosmosTraceDiagnostics)feedResponse.Diagnostics).Value;
endLineNumber = GetLineNumber();
inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber));
}
//----------------------------------------------------------------
this.ExecuteTestSuite(inputs);
}
public override Output ExecuteTest(Input input)
{
ITrace traceForBaselineTesting = CreateTraceForBaslineTesting(input.Trace, parent: null);
string text = TraceWriter.TraceToText(traceForBaselineTesting);
string json = TraceWriter.TraceToJson(traceForBaselineTesting);
AssertTraceProperites(input.Trace);
Assert.IsTrue(text.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {text}");
Assert.IsTrue(json.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {json}");
Assert.IsTrue(text.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {text}");
Assert.IsTrue(json.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {json}");
return new Output(text, JToken.Parse(json).ToString(Newtonsoft.Json.Formatting.Indented));
}
private static TraceForBaselineTesting CreateTraceForBaslineTesting(ITrace trace, TraceForBaselineTesting parent)
{
TraceForBaselineTesting convertedTrace = new TraceForBaselineTesting(trace.Name, trace.Level, trace.Component, parent);
foreach (ITrace child in trace.Children)
{
TraceForBaselineTesting convertedChild = CreateTraceForBaslineTesting(child, convertedTrace);
convertedTrace.children.Add(convertedChild);
}
foreach (KeyValuePair<string, object> kvp in trace.Data)
{
convertedTrace.AddDatum(kvp.Key, kvp.Value);
}
return convertedTrace;
}
private static void AssertCustomHandlerTime(
string diagnostics,
string handlerName,
TimeSpan delay)
{
JObject jObject = JObject.Parse(diagnostics);
JObject handlerChild = EndToEndTraceWriterBaselineTests.FindChild(
handlerName,
jObject);
Assert.IsNotNull(handlerChild);
JToken delayToken = handlerChild["duration in milliseconds"];
Assert.IsNotNull(delayToken);
double itraceDelay = delayToken.ToObject<double>();
Assert.IsTrue(TimeSpan.FromMilliseconds(itraceDelay) > delay);
}
private static JObject FindChild(
string name,
JObject jObject)
{
if(jObject == null)
{
return null;
}
JToken nameToken = jObject["name"];
if(nameToken != null && nameToken.ToString() == name)
{
return jObject;
}
JArray jArray = jObject["children"]?.ToObject<JArray>();
if(jArray != null)
{
foreach(JObject child in jArray)
{
JObject response = EndToEndTraceWriterBaselineTests.FindChild(name, child);
if(response != null)
{
return response;
}
}
}
return null;
}
private static void AssertTraceProperites(ITrace trace)
{
if (trace.Name == "ReadManyItemsStreamAsync" ||
trace.Name == "ReadManyItemsAsync")
{
return; // skip test for read many as the queries are done in parallel
}
if (trace.Children.Count == 0)
{
// Base case
return;
}
// Trace stopwatch should be greater than the sum of all children's stop watches
TimeSpan rootTimeSpan = trace.Duration;
TimeSpan sumOfChildrenTimeSpan = TimeSpan.Zero;
foreach (ITrace child in trace.Children)
{
sumOfChildrenTimeSpan += child.Duration;
AssertTraceProperites(child);
}
if (rootTimeSpan < sumOfChildrenTimeSpan)
{
Assert.Fail();
}
}
private static int GetLineNumber([CallerLineNumber] int lineNumber = 0)
{
return lineNumber;
}
public sealed class Input : BaselineTestInput
{
private static readonly string[] sourceCode = File.ReadAllLines($"Tracing\\{nameof(EndToEndTraceWriterBaselineTests)}.cs");
internal Input(string description, ITrace trace, int startLineNumber, int endLineNumber)
: base(description)
{
this.Trace = trace ?? throw new ArgumentNullException(nameof(trace));
this.StartLineNumber = startLineNumber;
this.EndLineNumber = endLineNumber;
}
internal ITrace Trace { get; }
public int StartLineNumber { get; }
public int EndLineNumber { get; }
public override void SerializeAsXml(XmlWriter xmlWriter)
{
xmlWriter.WriteElementString(nameof(this.Description), this.Description);
xmlWriter.WriteStartElement("Setup");
ArraySegment<string> codeSnippet = new ArraySegment<string>(
sourceCode,
this.StartLineNumber,
this.EndLineNumber - this.StartLineNumber - 1);
string setup;
try
{
setup =
Environment.NewLine
+ string
.Join(
Environment.NewLine,
codeSnippet
.Select(x => x != string.Empty ? x.Substring(" ".Length) : string.Empty))
+ Environment.NewLine;
}
catch (Exception ex)
{
throw ex;
}
xmlWriter.WriteCData(setup ?? "asdf");
xmlWriter.WriteEndElement();
}
}
public sealed class Output : BaselineTestOutput
{
public Output(string text, string json)
{
this.Text = text ?? throw new ArgumentNullException(nameof(text));
this.Json = json ?? throw new ArgumentNullException(nameof(json));
}
public string Text { get; }
public string Json { get; }
public override void SerializeAsXml(XmlWriter xmlWriter)
{
xmlWriter.WriteStartElement(nameof(this.Text));
xmlWriter.WriteCData(this.Text);
xmlWriter.WriteEndElement();
xmlWriter.WriteStartElement(nameof(this.Json));
xmlWriter.WriteCData(this.Json);
xmlWriter.WriteEndElement();
}
}
private sealed class TraceForBaselineTesting : ITrace
{
public readonly Dictionary<string, object> data;
public readonly List<ITrace> children;
public TraceForBaselineTesting(
string name,
TraceLevel level,
TraceComponent component,
TraceForBaselineTesting parent)
{
this.Name = name ?? throw new ArgumentNullException(nameof(name));
this.Level = level;
this.Component = component;
this.Parent = parent;
this.children = new List<ITrace>();
this.data = new Dictionary<string, object>();
}
public string Name { get; }
public Guid Id => Guid.Empty;
public CallerInfo CallerInfo => new CallerInfo("MemberName", "FilePath", 42);
public DateTime StartTime => DateTime.MinValue;
public TimeSpan Duration => TimeSpan.Zero;
public TraceLevel Level { get; }
public TraceComponent Component { get; }
public ITrace Parent { get; }
public IReadOnlyList<ITrace> Children => this.children;
public IReadOnlyDictionary<string, object> Data => this.data;
public void AddDatum(string key, TraceDatum traceDatum)
{
this.data[key] = traceDatum;
}
public void AddDatum(string key, object value)
{
if (key.Contains("CPU"))
{
// Redacted To Not Change The Baselines From Run To Run
return;
}
this.data[key] = "Redacted To Not Change The Baselines From Run To Run";
}
public void Dispose()
{
}
public ITrace StartChild(string name, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
return this.StartChild(name, TraceComponent.Unknown, TraceLevel.Info, memberName, sourceFilePath, sourceLineNumber);
}
public ITrace StartChild(string name, TraceComponent component, TraceLevel level, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
TraceForBaselineTesting child = new TraceForBaselineTesting(name, level, component, parent: this);
this.AddChild(child);
return child;
}
public void AddChild(ITrace trace)
{
this.children.Add(trace);
}
public static TraceForBaselineTesting GetRootTrace()
{
return new TraceForBaselineTesting("Trace For Baseline Testing", TraceLevel.Info, TraceComponent.Unknown, parent: null);
}
}
private sealed class RequestHandlerSleepHelper : RequestHandler
{
TimeSpan timeToSleep;
public RequestHandlerSleepHelper(TimeSpan timeToSleep)
{
this.timeToSleep = timeToSleep;
}
public override async Task<ResponseMessage> SendAsync(RequestMessage request, CancellationToken cancellationToken)
{
await Task.Delay(this.timeToSleep);
return await base.SendAsync(request, cancellationToken);
}
}
}
}
| 44.150522
| 226
| 0.479072
|
[
"MIT"
] |
Azure/azure-cosmos-dotnet-v3
|
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs
| 59,252
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace HelloAspNetCore
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
//throw new Exception("error");
await context.Response.WriteAsync("Hello World!");
});
});
// the job of this method is to call "Run" or "Use" methods on
// the IApplicationBuilder. each one sets up a "middleware".
// every HTTP request goes through the middleware in order.
app.UseStaticFiles();
app.Run(async context =>
{
// this object has all the details of the request
HttpRequest request = context.Request;
string path = request.Path;
// we can modify this object to set up the response.
HttpResponse response = context.Response;
response.ContentType = "text/html";
await response.WriteAsync(@$"<!DOCTYPE html>
<html>
<head>
</head>
<body>
Hello {path}!
</body>
</html>
");
});
}
}
}
| 30.214286
| 122
| 0.588652
|
[
"MIT"
] |
210726-wvu-net-ext/training-code
|
05MVC/HelloAspNetCore/Startup.cs
| 2,117
|
C#
|
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Prime.Auth;
using Prime.Models.Api;
using Prime.Services;
using Prime.HttpClients;
namespace Prime.Controllers
{
[Produces("application/json")]
[Route("api/document-access")]
[ApiController]
public class DocumentAccessController : ControllerBase
{
private readonly IDocumentAccessTokenService _documentAccessTokenService;
private readonly IDocumentManagerClient _documentManagerClient;
public DocumentAccessController(
IDocumentAccessTokenService documentAccessTokenService,
IDocumentManagerClient documentManagerClient)
{
_documentAccessTokenService = documentAccessTokenService;
_documentManagerClient = documentManagerClient;
}
// GET: api/document-access/{accessTokenId}
/// <summary>
/// Gets the Document for downloading based on the supplied Document Access Token GUID.
/// </summary>
/// <remarks>This endpoint is not authenticated.</remarks>
[HttpGet("{accessTokenId}", Name = nameof(GetDocumentByAccessToken))]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> GetDocumentByAccessToken(Guid accessTokenId)
{
var documentAccessToken = await _documentAccessTokenService.GetDocumentAccessTokenAsync(accessTokenId);
if (documentAccessToken == null)
{
return NotFound();
}
var response = await _documentManagerClient.GetFileResponseAsync(documentAccessToken.DocumentGuid);
if (response == null)
{
return NotFound();
}
Response.Headers.Add("Content-Disposition", response.Content.Headers.ContentDisposition.ToString());
return File(await response.Content.ReadAsStreamAsync(), "application/octet-stream");
}
// DELETE: api/document-access/{accessTokenId}
/// <summary>
/// Delete a Document Access Token.
/// </summary>
[HttpDelete("{accessTokenId}", Name = nameof(DeleteDocumentAccessToken))]
[Authorize(Roles = Roles.PrimeSuperAdmin)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(typeof(ApiMessageResponse), StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public async Task<IActionResult> DeleteDocumentAccessToken(Guid accessTokenId)
{
var documentAccessToken = await _documentAccessTokenService.GetDocumentAccessTokenAsync(accessTokenId);
if (documentAccessToken == null)
{
return NotFound(ApiResponse.Message($"No valid Document Access Token was found with id {accessTokenId}"));
}
await _documentAccessTokenService.DeleteDocumentAccessTokenAsync(accessTokenId);
return NoContent();
}
}
}
| 39.308642
| 122
| 0.684045
|
[
"Apache-2.0"
] |
countable-web/moh-prime
|
prime-dotnet-webapi/Controllers/DocumentAccessController.cs
| 3,184
|
C#
|
using Newtonsoft.Json;
namespace ArgentPonyWarcraftClient
{
/// <summary>
/// A recipe.
/// </summary>
public class Recipe
{
/// <summary>
/// Gets or sets the recipe ID.
/// </summary>
[JsonProperty("id")]
public int Id { get; set; }
/// <summary>
/// Gets or sets the recipe name.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Gets or sets the profession.
/// </summary>
[JsonProperty("profession")]
public string Profession { get; set; }
/// <summary>
/// Gets or sets the icon.
/// </summary>
[JsonProperty("icon")]
public string Icon { get; set; }
}
}
| 22.542857
| 46
| 0.490494
|
[
"MIT"
] |
Alyzandestudent/ArgentPonyWarcraftClient
|
src/ArgentPonyWarcraftClient/Models/Recipe.cs
| 791
|
C#
|
using Aow.Infrastructure.IRepositories;
using System;
using System.Threading.Tasks;
namespace Aow.Services.ProductAttribute
{
[Service]
public class AddProductAttribute
{
private IRepositoryWrapper _repoWrapper;
public AddProductAttribute(IRepositoryWrapper repoWrapper)
{
_repoWrapper = repoWrapper;
}
public class AddProductAttributeRequest
{
public string Name { get; set; }
public Guid CategoryId { get; set; }
}
public class AddProductAttributeResponse
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool Success { get; set; }
}
public async Task<AddProductAttributeResponse> Do(AddProductAttributeRequest request)
{
try
{
Guid ProductId = Guid.NewGuid();
var attribute = new Aow.Infrastructure.Domain.ProductAttribute
{
Id = ProductId,
Name = request.Name,
ProductCategoryId = request.CategoryId,
};
_repoWrapper.ProductAttributeRepo.Create(attribute);
int i = await _repoWrapper.SaveNew();
if (i <= 0)
{
return new AddProductAttributeResponse
{
Name = request.Name,
Success = false
};
}
else
{
return new AddProductAttributeResponse
{
Id = attribute.Id,
Name = request.Name,
Success = true,
Description = "Product Attribute SuccessFully Added"
};
}
}
catch (Exception ex)
{
return new AddProductAttributeResponse
{
Name = request.Name,
Success = false,
Description = ex.Message
};
}
}
}
}
| 31.625
| 93
| 0.463329
|
[
"Apache-2.0"
] |
dpk2789/aow-new-api
|
Aow.Services/ProductAttribute/AddProductAttribute.cs
| 2,279
|
C#
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using EditorBrowsableAttribute = System.ComponentModel.EditorBrowsableAttribute;
using EditorBrowsableState = System.ComponentModel.EditorBrowsableState;
using Internal.Runtime.CompilerServices;
#pragma warning disable 0809 //warning CS0809: Obsolete member 'Span<T>.Equals(object)' overrides non-obsolete member 'object.Equals(object)'
#if BIT64
using nuint = System.UInt64;
#else
using nuint = System.UInt32;
#endif
namespace System
{
/// <summary>
/// Span represents a contiguous region of arbitrary memory. Unlike arrays, it can point to either managed
/// or native memory, or to memory allocated on the stack. It is type- and memory-safe.
/// </summary>
[NonVersionable]
public readonly ref partial struct Span<T>
{
/// <summary>A byref or a native ptr.</summary>
internal readonly ByReference<T> _pointer;
/// <summary>The number of elements this Span contains.</summary>
#if PROJECTN
[Bound]
#endif
private readonly int _length;
/// <summary>
/// Creates a new span over the entirety of the target array.
/// </summary>
/// <param name="array">The target array.</param>
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span(T[] array)
{
if (array == null)
{
this = default;
return; // returns default
}
if (default(T) == null && array.GetType() != typeof(T[]))
ThrowHelper.ThrowArrayTypeMismatchException();
_pointer = new ByReference<T>(ref Unsafe.As<byte, T>(ref array.GetRawSzArrayData()));
_length = array.Length;
}
/// <summary>
/// Creates a new span over the portion of the target array beginning
/// at 'start' index and ending at 'end' index (exclusive).
/// </summary>
/// <param name="array">The target array.</param>
/// <param name="start">The index at which to begin the span.</param>
/// <param name="length">The number of items in the span.</param>
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (<0 or >=Length).
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span(T[] array, int start, int length)
{
if (array == null)
{
if (start != 0 || length != 0)
ThrowHelper.ThrowArgumentOutOfRangeException();
this = default;
return; // returns default
}
if (default(T) == null && array.GetType() != typeof(T[]))
ThrowHelper.ThrowArrayTypeMismatchException();
#if BIT64
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
ThrowHelper.ThrowArgumentOutOfRangeException();
#else
if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
ThrowHelper.ThrowArgumentOutOfRangeException();
#endif
_pointer = new ByReference<T>(ref Unsafe.Add(ref Unsafe.As<byte, T>(ref array.GetRawSzArrayData()), start));
_length = length;
}
/// <summary>
/// Creates a new span over the target unmanaged buffer. Clearly this
/// is quite dangerous, because we are creating arbitrarily typed T's
/// out of a void*-typed block of memory. And the length is not checked.
/// But if this creation is correct, then all subsequent uses are correct.
/// </summary>
/// <param name="pointer">An unmanaged pointer to memory.</param>
/// <param name="length">The number of <typeparamref name="T"/> elements the memory contains.</param>
/// <exception cref="System.ArgumentException">
/// Thrown when <typeparamref name="T"/> is reference type or contains pointers and hence cannot be stored in unmanaged memory.
/// </exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// Thrown when the specified <paramref name="length"/> is negative.
/// </exception>
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe Span(void* pointer, int length)
{
if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
if (length < 0)
ThrowHelper.ThrowArgumentOutOfRangeException();
_pointer = new ByReference<T>(ref Unsafe.As<byte, T>(ref *(byte*)pointer));
_length = length;
}
// Constructor for internal use only.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal Span(ref T ptr, int length)
{
Debug.Assert(length >= 0);
_pointer = new ByReference<T>(ref ptr);
_length = length;
}
/// <summary>
/// Returns a reference to specified element of the Span.
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
/// <exception cref="System.IndexOutOfRangeException">
/// Thrown when index less than 0 or index greater than or equal to Length
/// </exception>
public ref T this[int index]
{
#if PROJECTN
[BoundsChecking]
get
{
return ref Unsafe.Add(ref _pointer.Value, index);
}
#else
[Intrinsic]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[NonVersionable]
get
{
if ((uint)index >= (uint)_length)
ThrowHelper.ThrowIndexOutOfRangeException();
return ref Unsafe.Add(ref _pointer.Value, index);
}
#endif
}
public ref T this[Index index]
{
get
{
// Evaluate the actual index first because it helps performance
int actualIndex = index.FromEnd ? _length - index.Value : index.Value;
return ref this [actualIndex];
}
}
public Span<T> this[Range range]
{
get
{
int start = range.Start.FromEnd ? _length - range.Start.Value : range.Start.Value;
int end = range.End.FromEnd ? _length - range.End.Value : range.End.Value;
return Slice(start, end - start);
}
}
/// <summary>
/// Returns a reference to the 0th element of the Span. If the Span is empty, returns null reference.
/// It can be used for pinning and is required to support the use of span within a fixed statement.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public unsafe ref T GetPinnableReference()
{
// Ensure that the native code has just one forward branch that is predicted-not-taken.
ref T ret = ref Unsafe.AsRef<T>(null);
if (_length != 0) ret = ref _pointer.Value;
return ref ret;
}
/// <summary>
/// Clears the contents of this span.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
{
if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
{
SpanHelpers.ClearWithReferences(ref Unsafe.As<T, IntPtr>(ref _pointer.Value), (nuint)_length * (nuint)(Unsafe.SizeOf<T>() / sizeof(nuint)));
}
else
{
SpanHelpers.ClearWithoutReferences(ref Unsafe.As<T, byte>(ref _pointer.Value), (nuint)_length * (nuint)Unsafe.SizeOf<T>());
}
}
/// <summary>
/// Fills the contents of this span with the given value.
/// </summary>
public void Fill(T value)
{
if (Unsafe.SizeOf<T>() == 1)
{
uint length = (uint)_length;
if (length == 0)
return;
T tmp = value; // Avoid taking address of the "value" argument. It would regress performance of the loop below.
Unsafe.InitBlockUnaligned(ref Unsafe.As<T, byte>(ref _pointer.Value), Unsafe.As<T, byte>(ref tmp), length);
}
else
{
// Do all math as nuint to avoid unnecessary 64->32->64 bit integer truncations
nuint length = (uint)_length;
if (length == 0)
return;
ref T r = ref _pointer.Value;
// TODO: Create block fill for value types of power of two sizes e.g. 2,4,8,16
nuint elementSize = (uint)Unsafe.SizeOf<T>();
nuint i = 0;
for (; i < (length & ~(nuint)7); i += 8)
{
Unsafe.AddByteOffset<T>(ref r, (i + 0) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 1) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 2) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 3) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 4) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 5) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 6) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 7) * elementSize) = value;
}
if (i < (length & ~(nuint)3))
{
Unsafe.AddByteOffset<T>(ref r, (i + 0) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 1) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 2) * elementSize) = value;
Unsafe.AddByteOffset<T>(ref r, (i + 3) * elementSize) = value;
i += 4;
}
for (; i < length; i++)
{
Unsafe.AddByteOffset<T>(ref r, i * elementSize) = value;
}
}
}
/// <summary>
/// Copies the contents of this span into destination span. If the source
/// and destinations overlap, this method behaves as if the original values in
/// a temporary location before the destination is overwritten.
/// </summary>
/// <param name="destination">The span to copy items into.</param>
/// <exception cref="System.ArgumentException">
/// Thrown when the destination Span is shorter than the source Span.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void CopyTo(Span<T> destination)
{
// Using "if (!TryCopyTo(...))" results in two branches: one for the length
// check, and one for the result of TryCopyTo. Since these checks are equivalent,
// we can optimize by performing the check once ourselves then calling Memmove directly.
if ((uint)_length <= (uint)destination.Length)
{
Buffer.Memmove(ref destination._pointer.Value, ref _pointer.Value, (nuint)_length);
}
else
{
ThrowHelper.ThrowArgumentException_DestinationTooShort();
}
}
/// <summary>
/// Copies the contents of this span into destination span. If the source
/// and destinations overlap, this method behaves as if the original values in
/// a temporary location before the destination is overwritten.
/// </summary>
/// <param name="destination">The span to copy items into.</param>
/// <returns>If the destination span is shorter than the source span, this method
/// return false and no data is written to the destination.</returns>
public bool TryCopyTo(Span<T> destination)
{
bool retVal = false;
if ((uint)_length <= (uint)destination.Length)
{
Buffer.Memmove(ref destination._pointer.Value, ref _pointer.Value, (nuint)_length);
retVal = true;
}
return retVal;
}
/// <summary>
/// Returns true if left and right point at the same memory and have the same length. Note that
/// this does *not* check to see if the *contents* are equal.
/// </summary>
public static bool operator ==(Span<T> left, Span<T> right)
{
return left._length == right._length && Unsafe.AreSame<T>(ref left._pointer.Value, ref right._pointer.Value);
}
/// <summary>
/// Defines an implicit conversion of a <see cref="Span{T}"/> to a <see cref="ReadOnlySpan{T}"/>
/// </summary>
public static implicit operator ReadOnlySpan<T>(Span<T> span) => new ReadOnlySpan<T>(ref span._pointer.Value, span._length);
/// <summary>
/// For <see cref="Span{Char}"/>, returns a new instance of string that represents the characters pointed to by the span.
/// Otherwise, returns a <see cref="string"/> with the name of the type and the number of elements.
/// </summary>
public override string ToString()
{
if (typeof(T) == typeof(char))
{
unsafe
{
fixed (char* src = &Unsafe.As<T, char>(ref _pointer.Value))
return new string(src, 0, _length);
}
}
return string.Format("System.Span<{0}>[{1}]", typeof(T).Name, _length);
}
/// <summary>
/// Forms a slice out of the given span, beginning at 'start'.
/// </summary>
/// <param name="start">The index at which to begin this slice.</param>
/// <exception cref="System.ArgumentOutOfRangeException">
/// Thrown when the specified <paramref name="start"/> index is not in range (<0 or >=Length).
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> Slice(int start)
{
if ((uint)start > (uint)_length)
ThrowHelper.ThrowArgumentOutOfRangeException();
return new Span<T>(ref Unsafe.Add(ref _pointer.Value, start), _length - start);
}
/// <summary>
/// Forms a slice out of the given span, beginning at 'start', of given length
/// </summary>
/// <param name="start">The index at which to begin this slice.</param>
/// <param name="length">The desired length for the slice (exclusive).</param>
/// <exception cref="System.ArgumentOutOfRangeException">
/// Thrown when the specified <paramref name="start"/> or end index is not in range (<0 or >=Length).
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> Slice(int start, int length)
{
#if BIT64
// Since start and length are both 32-bit, their sum can be computed across a 64-bit domain
// without loss of fidelity. The cast to uint before the cast to ulong ensures that the
// extension from 32- to 64-bit is zero-extending rather than sign-extending. The end result
// of this is that if either input is negative or if the input sum overflows past Int32.MaxValue,
// that information is captured correctly in the comparison against the backing _length field.
// We don't use this same mechanism in a 32-bit process due to the overhead of 64-bit arithmetic.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)_length)
ThrowHelper.ThrowArgumentOutOfRangeException();
#else
if ((uint)start > (uint)_length || (uint)length > (uint)(_length - start))
ThrowHelper.ThrowArgumentOutOfRangeException();
#endif
return new Span<T>(ref Unsafe.Add(ref _pointer.Value, start), length);
}
/// <summary>
/// Copies the contents of this span into a new array. This heap
/// allocates, so should generally be avoided, however it is sometimes
/// necessary to bridge the gap with APIs written in terms of arrays.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public T[] ToArray()
{
if (_length == 0)
return Array.Empty<T>();
var destination = new T[_length];
Buffer.Memmove(ref Unsafe.As<byte, T>(ref destination.GetRawSzArrayData()), ref _pointer.Value, (nuint)_length);
return destination;
}
}
}
| 44.4925
| 162
| 0.577457
|
[
"MIT"
] |
2E0PGS/corefx
|
src/Common/src/CoreLib/System/Span.Fast.cs
| 17,797
|
C#
|
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ChilliSource.Cloud.Core.LinqMapper
{
/// <summary>
/// Auto applies an after map action on a query result. The action needs to be registered using Materializer.RegisterAfterMap() .
/// </summary>
public static class MaterializerExtensions
{
/// <summary>
/// <para>Auto applies an after map action on a query result when materializing objects. </para>
/// <para>The context MUST must be set via .Context() if required by the registered action.</para>
/// <para>Registered actions on interfaces and base classes are also automaticaly applied in this order: Interface actions, Base Class (top to bottom) actions, Target type action.</para>
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="query">A source query</param>
/// <returns>A materializer wrapper for the result</returns>
public static IQueryMaterializer<TSource, TDest> Materialize<TSource, TDest>(this IQueryable<TSource> query)
where TSource : class
where TDest : class, new()
{
return new QueryMaterializer<TSource, TDest>(query);
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.FirstOrDefault() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection instance</returns>
public static TDest FirstOrDefault<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.FirstOrDefault());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.FirstOrDefault() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection instance</returns>
public static Task<TDest> FirstOrDefaultAsync<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.FirstOrDefaultAsync());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToArray() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection array</returns>
public static TDest[] ToArray<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.ToArray());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToArray() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection array</returns>
public static Task<TDest[]> ToArrayAsync<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.ToArrayAsync());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToList() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection list</returns>
public static List<TDest> ToList<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.ToList());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToList() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection list</returns>
public static Task<List<TDest>> ToListAsync<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer)
{
return materializer.To(q => q.ToListAsync());
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToPagedList() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection paged list</returns>
public static PagedList<TDest> ToPagedList<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer, int page = 1, int pageSize = 10, bool previousPageIfEmpty = false)
{
return materializer.To(q => q.ToPagedList(page, pageSize, previousPageIfEmpty));
}
/// <summary>
/// Exexutes the registered mapping on a query, applies any registered after map actions, and runs query.ToPagedList() on the result
/// </summary>
/// <typeparam name="TSource">The source type</typeparam>
/// <typeparam name="TDest">The projection type</typeparam>
/// <param name="materializer">A materializer wrapper</param>
/// <returns>A projection paged list</returns>
public static Task<PagedList<TDest>> ToPagedListAsync<TSource, TDest>(this IQueryMaterializer<TSource, TDest> materializer, int page = 1, int pageSize = 10, bool previousPageIfEmpty = false)
{
return materializer.To(q => q.ToPagedListAsync(page, pageSize, previousPageIfEmpty));
}
}
}
| 53.53125
| 199
| 0.637332
|
[
"MIT"
] |
BlueChilli/ChilliSource.Cloud.Core
|
src/ChilliSource.Cloud.Core/Infrastructure/LinqMapper/MaterializerExtensions.cs
| 6,854
|
C#
|
using System;
using System.Xml.Serialization;
namespace Aop.Api.Domain
{
/// <summary>
/// MiniAppSecondCategoryInfo Data Structure.
/// </summary>
[Serializable]
public class MiniAppSecondCategoryInfo : AopObject
{
/// <summary>
/// 小程序类目Id
/// </summary>
[XmlElement("category_id")]
public string CategoryId { get; set; }
/// <summary>
/// 度假用别墅服务
/// </summary>
[XmlElement("category_name")]
public string CategoryName { get; set; }
}
}
| 22
| 54
| 0.567273
|
[
"Apache-2.0"
] |
Varorbc/alipay-sdk-net-all
|
AlipaySDKNet/Domain/MiniAppSecondCategoryInfo.cs
| 574
|
C#
|
using FluentAssertions;
using Xunit;
namespace ValueObjects.Tests
{
public class MoneyTests
{
[Theory]
[InlineData(1.0, 2.0, 3.0)]
[InlineData(1.15, 2.20, 3.35)]
[InlineData(1.99, 2.99, 4.98)]
[InlineData(0, 0, 0)]
public void Should_Add(decimal v1, decimal v2, decimal expectedValue)
{
var pln = Currency.PLN;
var money1 = new Money(v1, pln);
var money2 = new Money(v2, pln);
var added = money1 + money2;
added
.Amount
.Should()
.Be(expectedValue);
}
[Theory]
[InlineData(2.0, 1.0, 1.0)]
[InlineData(1.0, 2.0, -1.0)]
[InlineData(2.99, 1.99, 1.0)]
[InlineData(0, 0, 0)]
public void Should_Subtract(decimal v1, decimal v2, decimal expectedValue)
{
var pln = Currency.PLN;
var money1 = new Money(v1, pln);
var money2 = new Money(v2, pln);
var added = money1 - money2;
added
.Amount
.Should()
.Be(expectedValue);
}
[Fact]
public void Should_FailToAdd_When_CurrenciesAreDifferent()
{
var usd = new Money(2.0, Currency.USD);
var pln = new Money(1.0, Currency.PLN);
Assert.Throws<CurrenciesAreDifferentException>(() => pln + usd);
}
[Fact]
public void Should_FailToSubstract_When_CurrenciesAreDifferent()
{
var usd = new Money(2.0, Currency.USD);
var pln = new Money(1.0, Currency.PLN);
Assert.Throws<CurrenciesAreDifferentException>(() => usd - pln);
}
[Fact]
public void Should_FailToCompare_When_CurrenciesAreDifferent()
{
var usd = new Money(2.0, Currency.USD);
var pln = new Money(1.0, Currency.PLN);
Assert.Throws<CurrenciesAreDifferentException>(() => usd > pln);
Assert.Throws<CurrenciesAreDifferentException>(() => usd >= pln);
Assert.Throws<CurrenciesAreDifferentException>(() => usd < pln);
Assert.Throws<CurrenciesAreDifferentException>(() => usd <= pln);
}
[Fact]
public void Should_Compare()
{
var usd = new Money(2.0, Currency.USD);
var pln = new Money(2.0, Currency.PLN);
var isEqual = usd == pln;
isEqual.Should().BeFalse();
isEqual = usd != pln;
isEqual.Should().BeTrue();
}
}
}
| 27.21875
| 82
| 0.519326
|
[
"MIT"
] |
DawidMierzejewski/Useful-Value-Objects
|
Tests/ValueObjects.Tests/Money/MoneyTests.cs
| 2,615
|
C#
|
using System;
namespace TaskCar
{
class Program
{
static void Main(string[] args)
{
Car carAuto1 = new Car();
carAuto1.AskData();
carAuto1.ShowCarInfo();
Console.WriteLine("Car speed after 30+:");
carAuto1.Accelerate(30);
carAuto1.ShowCarInfo();
Console.WriteLine("Car speed after 10% slowdown:");
carAuto1.Brake(90);
carAuto1.ShowCarInfo();
Car carAuto2 = new Car();
carAuto2.AskData();
carAuto2.ShowCarInfo();
Console.WriteLine("Car speed after 30+.");
carAuto2.Accelerate(30);
carAuto2.ShowCarInfo();
Console.WriteLine("Car speed after 10% slowdown.");
carAuto2.Brake(90);
carAuto2.ShowCarInfo();
Console.ReadKey();
}
}
}
| 27.787879
| 63
| 0.507088
|
[
"MIT"
] |
amanndajosefiina/object-oriented-programming
|
object-method/TaskCar/TaskCar/Program.cs
| 919
|
C#
|
// ******------------------------------------------------------******
// ProductManagerEditor.cs
//
// Author:
// K.Sinan Acar <ksa@puzzledwizard.com>
//
// Copyright (c) 2019 PuzzledWizard
//
// ******------------------------------------------------------******
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace PW
{
[CustomEditor(typeof(ProductManager))]
[CanEditMultipleObjects]
public class ProductManagerEditor : Editor
{
SerializedProperty Products;
SerializedProperty ProductScreenshotsPath;
SerializedProperty placeHolderPrefab;
///Variables GUI to handle for foldout and scrollViewPosition reference
///
bool foldOutArray;
Vector2 scrollViewPos;
///
///
private void OnEnable()
{
Products = serializedObject.FindProperty("Products");
ProductScreenshotsPath = serializedObject.FindProperty("ProductScreenshotsPath");
placeHolderPrefab = serializedObject.FindProperty("placeholderPrefab");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
//We start drawing vertically with a scrollview
EditorGUILayout.BeginVertical();
scrollViewPos = EditorGUILayout.BeginScrollView(scrollViewPos);
//Custom method to handle drawing of array of Products
DrawPropertyArray(Products, ref foldOutArray);
//Ending scrollview and vertical group
EditorGUILayout.EndScrollView();
EditorGUILayout.EndVertical();
serializedObject.ApplyModifiedProperties();
}
private void DrawPropertyArray(SerializedProperty property, ref bool fold)
{
//Because we use size of the array several times we get a reference to it.
SerializedProperty arraySizeProp = property.FindPropertyRelative("Array.size");
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(placeHolderPrefab);
//Handling foldout of the editor
fold = EditorGUILayout.Foldout(fold, property.displayName);
if (fold)
{
EditorGUILayout.PropertyField(arraySizeProp);
EditorGUI.indentLevel++;
//Draw invidual properties, products in our case.
for (int i = 0; i < arraySizeProp.intValue; i++)
{
EditorGUILayout.PropertyField(property.GetArrayElementAtIndex(i));
}
//Button to add a new product.
if (GUILayout.Button("Add Product"))
{
int curIndex = property.arraySize;
property.InsertArrayElementAtIndex(curIndex);
var entry = property.GetArrayElementAtIndex(curIndex);
//set the element orderID as the current ID we got.
if (entry != null)
{
var orderID = entry.FindPropertyRelative("orderID");
if (orderID != null) orderID.intValue = curIndex+1;
}
Debug.Log("Adding product");
}
EditorGUI.indentLevel--;
}
EditorGUI.indentLevel--;
EditorGUILayout.HelpBox("Gameplay prefabs are created depending on ProductTypes, these created prefabs will contain scripts and helpers depending on their gameplay.", MessageType.Info);
//Button to create gameplay prefabs.
if (GUILayout.Button("Generate Gameplay Prefabs"))
{
GenerateGameplayPrefabs(property, arraySizeProp);
}
//Because we didn't want to pollute the UI folder,
//we have set a different test folder on ScreenShotHelper.
//But to make your process automatical, you should use the same
//screenshot path you set in ScreenShotHelper component here;
//If you set your screenshot path to somewwhere else, you need to point to
//that folder instead.
EditorGUILayout.HelpBox("This path should be the same path where you saved your screenshots with the ScreenShotHelper component in the ScreenshotScene. Whenever you add, or change a new product, you should assign screenshots below.", MessageType.Info);
ProductScreenshotsPath.stringValue = EditorGUILayout.TextField("ScreenshotsPath", ProductScreenshotsPath.stringValue);
EditorGUI.indentLevel++;
//Button to find and assign screenshots to products we have.
//OrderGenerator then, uses these screenshots to manage UI thumbnails in game.
//ProductScreenshotspath should be same with the ScreenShotHelper class to
//make that work. Or it should point to another folder that has your screenshots.
if (GUILayout.Button(new GUIContent("AssignScreenShots", "This button assigns the screenshots to the products using the prefab name of products, if you changed the prefab in your screenshot, you neeed to generate screenshots again,before doing that.")))
{
AssignScreenShotsToOrders(serializedObject, property, arraySizeProp.intValue, ProductScreenshotsPath.stringValue);
}
EditorGUI.indentLevel--;
}
static void AssignScreenShotsToOrders(SerializedObject serializedObject, SerializedProperty property, int totalSize, string ScreenShotPath)
{
var orderGen = FindObjectOfType<OrderGenerator>();
if (orderGen == null)
{
Debug.LogError("There is no OrderGenerator in the scnee. To assign screenshots to orders, you need to add OrderGenerator component to a gameObject in the scene.");
return;
}
//Get the count of products that are included in this scene
int countIncluded = 0;
var pm = serializedObject.targetObject as ProductManager;
var query = from x in pm.Products where x.dontIncludeInThisScene == false select x;
if (query != null)
countIncluded = query.Count();
orderGen.orderSprites = new Sprite[countIncluded];
//holds the orderIDs for products
orderGen.orderedProducts = new int[countIncluded];
int includedIndex = 0;
for (int i = 0; i < totalSize; i++)
{
var curProduct = property.GetArrayElementAtIndex(i);
if (curProduct.FindPropertyRelative("dontIncludeInThisScene").boolValue)
{
continue;
}
//We get the screenshot name from the prefab name
var propPrefab = curProduct.FindPropertyRelative("productPrefab");
var propName = propPrefab.objectReferenceValue.name;
//If object is served as a different object at the end
//It would have a servedAsDifferentGameObject prefab assigned to it.
//We should get it as the screenshot so, we get this prefab name here.
var serveAsDifferent = curProduct.FindPropertyRelative("servedAsDifferentGameObject").objectReferenceValue;
if (serveAsDifferent != null)
propName = serveAsDifferent.name;
var fileName = ScreenShotPath + propName + ".png";
if (!System.IO.File.Exists(fileName))
{
Debug.LogErrorFormat("This file is not found : {0}", fileName);
continue;
}
//If everything goes well, we found the screenshot at the path,
//We load the sprite here.
var screenshot = AssetDatabase.LoadAssetAtPath<Sprite>(fileName);
orderGen.orderSprites[includedIndex] = screenshot;
//We get the orderID from the product and assign it to the array
int orderID = curProduct.FindPropertyRelative("orderID").intValue;
orderGen.orderedProducts[includedIndex] = orderID;
//we first add the order and increment the index
//so check if we are not on the last one here
if (includedIndex < countIncluded - 1 && includedIndex < totalSize)
includedIndex++;
}
Debug.Log("Assigned the screenshots successfully.");
}
static void GenerateGameplayPrefabs(SerializedProperty property, SerializedProperty arraySizeProp)
{
string PrefabPath = "Assets/CoffeeShopStarterPack/Prefabs/Gameplay/Products/";
if (arraySizeProp == null || arraySizeProp.intValue == 0)
return;
for (int i = 0; i < arraySizeProp.intValue; i++)
{
//Get the product from the array
var product = property.GetArrayElementAtIndex(i);
//Get the enum value of productType
var serializedProductType = product.FindPropertyRelative("productType");
int enumIndex = serializedProductType.enumValueIndex;
ProductType pType = (ProductType)enumIndex;
int pOrderID = product.FindPropertyRelative("orderID").intValue;
//Get the prefab from the product
GameObject prefab = product.FindPropertyRelative("productPrefab").objectReferenceValue as GameObject;
if (prefab == null)
{
var prodName = property.FindPropertyRelative("productName");
Debug.LogError(prodName + " doesn't have a prefab assigned)");
continue;
}
//Get the plate prefab to assign to the products;
GameObject platePrefab = AssetDatabase.LoadAssetAtPath("Assets/CoffeeShopStarterPack/Prefabs/PW_plate01.prefab", typeof(GameObject)) as GameObject;
if (platePrefab == null)
Debug.LogError("Plate prefab couldn't be found please check the path assigned");
string longPrefabName = PrefabPath + prefab.name + "_type" + enumIndex + ".prefab";
bool prefabExists = false;
//we'll use this go to create a prefab or replace the existed one
GameObject newPrefabGo = null;
GameObject existedPrefab = null;
if (!System.IO.File.Exists(longPrefabName))
{
//If prefab doesnt exist we instantiate the prefab that product references.
newPrefabGo = Instantiate(prefab);
}
else
{
prefabExists = true;
existedPrefab = AssetDatabase.LoadAssetAtPath(longPrefabName, typeof(GameObject)) as GameObject;
newPrefabGo = Instantiate(existedPrefab);
Debug.LogWarning("this prefab already exists we created an instance of it");
}
var boolProp = product.FindPropertyRelative("addToPlateBeforeServed");
var serveAsDifferentProp = product.FindPropertyRelative("servedAsDifferentGameObject");
var regenBool = product.FindPropertyRelative("RegenerateProduct");
var plateOffset = product.FindPropertyRelative("plateOffset");
//These gameObjects has a hierarchy of multiple meshes
//So we just try to generate a boxcollider for this object at the root.
//This collider will enable MouseDown events for the object.
FindBoundsOfPrefabAndAddABoxCollider(newPrefabGo);
//Set values specific for productTypes
switch (pType)
{
case ProductType.Cookable:
//Add a cookable monobehaviour to object and set it.
var cookable = newPrefabGo.GetComponent<CookableProduct>();
if (cookable==null)
cookable = newPrefabGo.AddComponent<CookableProduct>();
cookable.cookingTimeForProduct = 1f;
break;
case ProductType.Heatable:
//Add a heatable monobehaviour to object and set it.
var heatable = newPrefabGo.GetComponent<HeatableProduct>();
if(heatable==null)
heatable = newPrefabGo.AddComponent<HeatableProduct>();
heatable.heatingTimeForProduct = 1f;
break;
case ProductType.Drinkable:
var drinkable = newPrefabGo.GetComponent<DrinkableProduct>();
if(drinkable==null)
drinkable = newPrefabGo.AddComponent<DrinkableProduct>();
//Drinkable objects have a fillHelper for animating the filling state
//So lets add it .
var fillHelper = newPrefabGo.GetComponent<FillCupHelper>();
if(fillHelper==null)
fillHelper = newPrefabGo.AddComponent<FillCupHelper>();
//Every drinkable product should have an object tagged fluid.
//If we can find one, we use this transform to animate filling
for (int j = 0; j < newPrefabGo.transform.childCount; j++)
{
var child = newPrefabGo.transform.GetChild(j);
if (child.CompareTag("Fluid"))
{
fillHelper.fluid = child;
//When we found a fluid object
//we should scale it to make it look empty
//on some objects we also transform it on -Y manually
child.transform.localScale = new Vector3(0, 0, 0);
break;
}
}
break;
case ProductType.ReadyToServe:
//Add a readyToServe monobehaviour to object and set it.
var readyToServe = newPrefabGo.GetComponent<ReadyToServe>();
if(readyToServe==null)
readyToServe = newPrefabGo.AddComponent<ReadyToServe>();
break;
case ProductType.None:
break;
}
//We're not doing this at the start
//because we add the inherited ProductGameObject by the type of the product above
//Set common values for base class of ProductTypes which is ProductGameObject
ProductGameObject productMonoBehaviour = newPrefabGo.GetComponent<ProductGameObject>();
productMonoBehaviour.orderID= pOrderID;
productMonoBehaviour.RegenerateProduct = regenBool!=null?regenBool.boolValue:false;
productMonoBehaviour.AddToPlateBeforeServed = boolProp != null ? boolProp.boolValue : false;
productMonoBehaviour.plateOffset = plateOffset.vector3Value;
productMonoBehaviour.serveAsDifferentGameObject = serveAsDifferentProp != null ? (GameObject)serveAsDifferentProp.objectReferenceValue as GameObject : null;
if (!prefabExists)
{
//Create a new prefab for gameplay purpose at the PrefabPath:
#if UNITY_2018_4_OR_NEWER
PrefabUtility.SaveAsPrefabAsset(newPrefabGo, longPrefabName);
#else
PrefabUtility.CreatePrefab(longPrefabName, newPrefabGo);
#endif
}
else
{
#if UNITY_2018_4_OR_NEWER
PrefabUtility.SaveAsPrefabAssetAndConnect(newPrefabGo, longPrefabName, InteractionMode.AutomatedAction);
#else
PrefabUtility.ReplacePrefab(newPrefabGo, existedPrefab, ReplacePrefabOptions.ReplaceNameBased);
#endif
}
DestroyImmediate(newPrefabGo);
}
}
static void FindBoundsOfPrefabAndAddABoxCollider(GameObject prefab)
{
Bounds prefab_bounds = prefab.transform.EncapsulateBounds();
var coll = prefab.GetComponent<Collider>();
if (coll == null)
{
var boxColl = prefab.AddComponent<BoxCollider>();
boxColl.size = prefab_bounds.size;
boxColl.center = prefab_bounds.center;
}
}
}
}
| 43.847938
| 265
| 0.5775
|
[
"Unlicense"
] |
HouseIsKing/Summer2021CoffeeShop
|
Summer2021B/Assets/CoffeeShopStarterPack/Scripts/Editor/ProductManagerEditor.cs
| 17,015
|
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 OZWDotNet.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.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;
}
}
}
}
| 39.407407
| 151
| 0.580827
|
[
"Apache-2.0"
] |
developersthinksmartbox/openzwave-dotnet-uwp
|
Samples/DotNet/OZWDotNet/Properties/Settings.Designer.cs
| 1,066
|
C#
|
// Copyright (c) 2017 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
// Licensed under MIT licence. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using DataLayer.BookApp;
using DataLayer.EfCode.BookApp;
using TestSupport.EfHelpers;
using Xunit;
using Xunit.Abstractions;
using Xunit.Extensions.AssertExtensions;
namespace Test.UnitTests.TestDataLayer
{
public class ExampleTest
{
private readonly ITestOutputHelper _output;
public ExampleTest(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void TestExample()
{
//SETUP
var logs = new List<LogOutput>();
var options = this.CreateUniqueClassOptionsWithLogging<BookContext>(log => logs.Add(log));
using (var context = new BookContext(options))
{
context.CreateEmptyViaWipe();
//ATTEMPT
context.Add(new Book {Title = "New Book"});
context.SaveChanges();
//VERIFY
context.Books.Count().ShouldEqual(1);
foreach (var log in logs)
{
_output.WriteLine(log.ToString());
}
}
}
}
}
| 29.916667
| 102
| 0.557799
|
[
"MIT"
] |
JeanCollas/EfCore.TestSupport
|
Test/UnitTests/TestDataLayer/ExampleTest.cs
| 1,438
|
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 sms-2016-10-24.normal.json service model.
*/
using System;
using Amazon.Runtime;
using Amazon.Util.Internal;
namespace Amazon.ServerMigrationService
{
/// <summary>
/// Configuration for accessing Amazon ServerMigrationService service
/// </summary>
public partial class AmazonServerMigrationServiceConfig : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("3.3.0.25");
private string _userAgent = UserAgentString;
/// <summary>
/// Default constructor
/// </summary>
public AmazonServerMigrationServiceConfig()
{
this.AuthenticationServiceName = "sms";
}
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return "sms";
}
}
/// <summary>
/// Gets the ServiceVersion property.
/// </summary>
public override string ServiceVersion
{
get
{
return "2016-10-24";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
}
}
| 26.6125
| 101
| 0.594645
|
[
"Apache-2.0"
] |
HaiNguyenMediaStep/aws-sdk-net
|
sdk/src/Services/ServerMigrationService/Generated/AmazonServerMigrationServiceConfig.cs
| 2,129
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MercadoPago.DataStructures.Payment
{
public struct Item
{
#region Properties
private string _id;
private string _title;
private string _description;
private string _picture_url;
private string _category_id;
private int? _quantity;
private decimal? _unit_price;
#endregion
#region Accessors
/// <summary>
/// Item code
/// </summary>
public string Id {
get { return _id; }
set { _id = value; }
}
/// <summary>
/// Item name
/// </summary>
public string Title {
get { return _title; }
set { _title = value; }
}
/// <summary>
/// Long item description
/// </summary>
public string Description {
get { return _description; }
set { _description = value; }
}
/// <summary>
/// Image URL
/// </summary>
public string PictureUrl {
get { return _picture_url; }
set { _picture_url = value; }
}
/// <summary>
/// Category of the item
/// </summary>
public string CategoryId {
get { return _category_id; }
set { _category_id = value; }
}
/// <summary>
/// Item's quantity
/// </summary>
public int? Quantity {
get { return _quantity; }
set { _quantity = value; }
}
/// <summary>
/// Unit price
/// </summary>
public decimal? UnitPrice {
get { return _unit_price; }
set { _unit_price = value; }
}
#endregion
}
}
| 26.575342
| 45
| 0.461856
|
[
"MIT"
] |
EngrKhizarIqbal/dx-dotnet
|
px-dotnet/DataStructures/Payment/Item.cs
| 1,942
|
C#
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
namespace Microsoft.Data.Entity.Design.Model.Validation
{
using System;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Xml.Linq;
using Microsoft.Data.Tools.XmlDesignerBase.Model;
internal class XNodeReaderLineNumberService : XObjectLineNumberService, IXmlLineInfo
{
private readonly XmlReader _xmlReader;
private readonly Uri _uri;
private static readonly FieldInfo _sourceFieldInfo;
private static readonly FieldInfo _parentFieldInfo;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
static XNodeReaderLineNumberService()
{
var xnodeReaderType = Assembly.GetAssembly(typeof(XObject)).GetType("System.Xml.Linq.XNodeReader");
_sourceFieldInfo = xnodeReaderType.GetField(
"source", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
_parentFieldInfo = xnodeReaderType.GetField(
"parent", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
}
internal XNodeReaderLineNumberService(XmlModelProvider xmlModelProvider, XmlReader xmlReader, Uri uri)
: base(xmlModelProvider)
{
Debug.Assert(xmlReader != null, "xmlReader != null");
Debug.Assert(uri != null, "uri != null");
Debug.Assert(
xmlReader.GetType().Name == "XNodeReader",
"Unexpected type for XmlReader. Expected reader to be System.Xml.Linq.XNodeReader");
Debug.Assert(_sourceFieldInfo != null, "_sourceFieldInfo != null");
Debug.Assert(_parentFieldInfo != null, "_parentFieldInfo != null");
_xmlReader = xmlReader;
_uri = uri;
}
public int LineNumber
{
get
{
var xobject = GetSourceFieldValue();
return GetLineNumber(xobject, _uri);
}
}
public int LinePosition
{
get
{
var xobject = GetSourceFieldValue();
return GetColumnNumber(xobject, _uri);
}
}
// We have to get this via reflection since there is no other way to
// access the XNode behind the XNodeReader used by XLinq.
private XObject GetSourceFieldValue()
{
XObject xobject = null;
// in theory this should never happen but since we are using reflection to get these
// fields it's safer to return false if we could not find any of these fileds
if (_sourceFieldInfo != null
&& _parentFieldInfo != null)
{
var source = _sourceFieldInfo.GetValue(_xmlReader);
Debug.Assert(source != null, "Unexpected null value for source field on specified reader");
xobject = source as XObject;
if (xobject == null)
{
if (source is string)
{
// this is a text element, so the source field is of type string. We can access the
// parent fields LastObject and get the XObject associated with the xml text. Again,
// we have to do this via reflection.
var parent = _parentFieldInfo.GetValue(_xmlReader);
Debug.Assert(parent != null, "Unexpected null value for parent field on specified reader");
var xe = parent as XElement;
Debug.Assert(xe != null, "parent value is not an XElement");
if (xe != null)
{
xobject = xe.LastNode;
}
}
}
}
Debug.Assert(xobject != null, "Unexpected type for source value. It is not an XObject");
return xobject;
}
public bool HasLineInfo()
{
// in theory this should never happen but since we are using reflection to get these
// fields it's safer to return false if we could not find any of these fileds
return _sourceFieldInfo != null && _parentFieldInfo != null;
}
}
}
| 41.381818
| 145
| 0.579745
|
[
"MIT"
] |
dotnet/ef6tools
|
src/EFTools/XmlCore/Model/Validation/XNodeReaderLineNumberService.cs
| 4,554
|
C#
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemySpawner : MonoBehaviour
{
public Vector2 spawnRange = new Vector2(10f, 20f);
public int spawnCap = 30;
[HideInInspector]
public int enemyCount;
private GameObject[] enemies;
private PlayerController controller;
private void Start()
{
enemies = Resources.LoadAll<GameObject>("Enemies");
controller = GetComponent<PlayerController>();
}
private void FixedUpdate()
{
if (!controller.hasDied && enemyCount < spawnCap)
{
int temp = Random.Range(0, 50);
if (temp == 0)
{
float direction = Random.Range(spawnRange.x, spawnRange.y);
if (direction > 1 || direction < -1)
{
spawnEnemy(direction);
}
}
}
}
private void spawnEnemy(float direction)
{
GameObject newEnemy = Instantiate(enemies[Random.Range(0, enemies.Length)], transform.position + (Vector3.right * direction), Quaternion.identity);
newEnemy.transform.parent = null;
enemyCount++;
}
}
| 25
| 155
| 0.591667
|
[
"MIT"
] |
Owmacohe/Vehementia
|
Assets/Scripts/Enemies/EnemySpawner.cs
| 1,200
|
C#
|
using Athena.Exceptions;
using System.Net;
namespace Athena.Extensions
{
public static class RepositoryExtensions
{
public static T NotFoundIfNull<T>(this T obj)
{
if (obj == null)
{
throw new ApiException(HttpStatusCode.NotFound, "The specified Object was not found");
}
return obj;
}
}
}
| 20.684211
| 102
| 0.564885
|
[
"MIT"
] |
athena-scheduler/athena
|
src/Athena/Extensions/RepositoryExtensions.cs
| 395
|
C#
|
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using DSharpPlus.Entities;
namespace DSharpPlus.CommandsNext.Converters
{
public class DateTimeConverter : IArgumentConverter<DateTime>
{
Task<Optional<DateTime>> IArgumentConverter<DateTime>.ConvertAsync(string value, CommandContext ctx)
{
if (DateTime.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.None, out var result))
return Task.FromResult(new Optional<DateTime>(result));
return Task.FromResult(Optional.FromNoValue<DateTime>());
}
}
public class DateTimeOffsetConverter : IArgumentConverter<DateTimeOffset>
{
Task<Optional<DateTimeOffset>> IArgumentConverter<DateTimeOffset>.ConvertAsync(string value, CommandContext ctx)
{
if (DateTimeOffset.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.None, out var result))
return Task.FromResult(Optional.FromValue(result));
return Task.FromResult(Optional.FromNoValue<DateTimeOffset>());
}
}
public class TimeSpanConverter : IArgumentConverter<TimeSpan>
{
private static Regex TimeSpanRegex { get; set; }
static TimeSpanConverter()
{
#if NETSTANDARD1_3
TimeSpanRegex = new Regex(@"^(?<days>\d+d\s*)?(?<hours>\d{1,2}h\s*)?(?<minutes>\d{1,2}m\s*)?(?<seconds>\d{1,2}s\s*)?$", RegexOptions.ECMAScript);
#else
TimeSpanRegex = new Regex(@"^(?<days>\d+d\s*)?(?<hours>\d{1,2}h\s*)?(?<minutes>\d{1,2}m\s*)?(?<seconds>\d{1,2}s\s*)?$", RegexOptions.ECMAScript | RegexOptions.Compiled);
#endif
}
Task<Optional<TimeSpan>> IArgumentConverter<TimeSpan>.ConvertAsync(string value, CommandContext ctx)
{
if (value == "0")
return Task.FromResult(Optional.FromValue(TimeSpan.Zero));
if (int.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out _))
return Task.FromResult(Optional.FromNoValue<TimeSpan>());
if (!ctx.Config.CaseSensitive)
value = value.ToLowerInvariant();
if (TimeSpan.TryParse(value, CultureInfo.InvariantCulture, out var result))
return Task.FromResult(Optional.FromValue(result));
var gps = new string[] { "days", "hours", "minutes", "seconds" };
var mtc = TimeSpanRegex.Match(value);
if (!mtc.Success)
return Task.FromResult(Optional.FromNoValue<TimeSpan>());
var d = 0;
var h = 0;
var m = 0;
var s = 0;
foreach (var gp in gps)
{
var gpc = mtc.Groups[gp].Value;
if (string.IsNullOrWhiteSpace(gpc))
continue;
var gpt = gpc[gpc.Length - 1];
int.TryParse(gpc.Substring(0, gpc.Length - 1), NumberStyles.Integer, CultureInfo.InvariantCulture, out var val);
switch (gpt)
{
case 'd':
d = val;
break;
case 'h':
h = val;
break;
case 'm':
m = val;
break;
case 's':
s = val;
break;
}
}
result = new TimeSpan(d, h, m, s);
return Task.FromResult(Optional.FromValue(result));
}
}
}
| 36.474747
| 181
| 0.557463
|
[
"MIT"
] |
13xforever/DSharpPlus
|
DSharpPlus.CommandsNext/Converters/TimeConverters.cs
| 3,613
|
C#
|
using Anemonis.RandomOrg;
namespace CardGame_Heroes.Network
{
public class RandomOrg
{
public RandomOrgClient randomOrgClient;
public readonly bool isConnectingToGoogle;
public RandomOrg()
{
if (!new InternetChecker().PingGoogleDotCom())
throw new Exception("Нету соединения с интерентом");
else randomOrgClient = new RandomOrgClient(NetconfigReader.ReadConfig().randomOrg.apiKey);
}
}
}
| 26.833333
| 102
| 0.656315
|
[
"MIT"
] |
DAcKeyy/CardGame-Heroes-Karnel
|
CardGame_Heroes.Network/RandomOrg.cs
| 510
|
C#
|
using System;
namespace SisVac.Framework.Domain
{
public class ClinicLocation : BaseEntity
{
public string Name { get; set; }
public string Latitude { get; set; }
public string Longitude { get; set; }
}
}
| 22
| 45
| 0.623967
|
[
"MIT"
] |
opticrd/sisvac-mobile-vacunacion
|
src/Vacunacion/SisVac/Framework/Domain/Entity/ClinicLocation.cs
| 244
|
C#
|
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MQTT.Chat.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MQTT.Chat.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找类似 显示帮助 的本地化字符串。
/// </summary>
public static string ShowHelp {
get {
return ResourceManager.GetString("ShowHelp", resourceCulture);
}
}
/// <summary>
/// 查找类似 The certificate is installed 的本地化字符串。
/// </summary>
public static string TheCertificateIsInstalled {
get {
return ResourceManager.GetString("TheCertificateIsInstalled", resourceCulture);
}
}
}
}
| 36.634146
| 175
| 0.570905
|
[
"MIT"
] |
IoTSharp/IoTSharp-MqqtBroker
|
MQTT.Chat/Properties/Resources.Designer.cs
| 3,394
|
C#
|
using Core.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Entities.Concrete
{
public class Brand:IEntity
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
}
}
| 18.8125
| 44
| 0.671096
|
[
"MIT"
] |
barisertugrul/CarRentalFullProject
|
CarRental_Backend/Entities/Concrete/Brand.cs
| 303
|
C#
|
using System.Collections.Generic;
namespace NetModular.Lib.Module.Abstractions
{
/// <summary>
/// 模块集合
/// </summary>
public interface IModuleCollection : IList<IModuleDescriptor>
{
/// <summary>
/// 加载
/// </summary>
void Load();
}
}
| 19.533333
| 65
| 0.56314
|
[
"MIT"
] |
380138129/NetModular
|
src/Framework/Module/Module.Abstractions/IModuleCollection.cs
| 307
|
C#
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace ParrelSyncEditor
{
[InitializeOnLoad]
public class EditorQuit
{
/// <summary>
/// Is editor being closed
/// </summary>
static public bool IsQuiting { get; private set; }
static void Quit()
{
IsQuiting = true;
}
static EditorQuit()
{
IsQuiting = false;
EditorApplication.quitting += Quit;
}
}
}
| 21.44
| 58
| 0.563433
|
[
"MIT"
] |
kamyker/ParrelSync
|
ParrelSync/Editor/AssetModBlock/EditorQuit.cs
| 538
|
C#
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.ResourceManager.Storage.Models
{
public partial class StorageAccountUpdateParameters : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
if (Optional.IsDefined(Sku))
{
writer.WritePropertyName("sku");
writer.WriteObjectValue(Sku);
}
if (Optional.IsCollectionDefined(Tags))
{
writer.WritePropertyName("tags");
writer.WriteStartObject();
foreach (var item in Tags)
{
writer.WritePropertyName(item.Key);
writer.WriteStringValue(item.Value);
}
writer.WriteEndObject();
}
if (Optional.IsDefined(Identity))
{
writer.WritePropertyName("identity");
writer.WriteObjectValue(Identity);
}
if (Optional.IsDefined(Kind))
{
writer.WritePropertyName("kind");
writer.WriteStringValue(Kind.Value.ToString());
}
writer.WritePropertyName("properties");
writer.WriteStartObject();
if (Optional.IsDefined(CustomDomain))
{
writer.WritePropertyName("customDomain");
writer.WriteObjectValue(CustomDomain);
}
if (Optional.IsDefined(Encryption))
{
writer.WritePropertyName("encryption");
writer.WriteObjectValue(Encryption);
}
if (Optional.IsDefined(SasPolicy))
{
writer.WritePropertyName("sasPolicy");
writer.WriteObjectValue(SasPolicy);
}
if (Optional.IsDefined(KeyPolicy))
{
writer.WritePropertyName("keyPolicy");
writer.WriteObjectValue(KeyPolicy);
}
if (Optional.IsDefined(AccessTier))
{
writer.WritePropertyName("accessTier");
writer.WriteStringValue(AccessTier.Value.ToSerialString());
}
if (Optional.IsDefined(AzureFilesIdentityBasedAuthentication))
{
writer.WritePropertyName("azureFilesIdentityBasedAuthentication");
writer.WriteObjectValue(AzureFilesIdentityBasedAuthentication);
}
if (Optional.IsDefined(EnableHttpsTrafficOnly))
{
writer.WritePropertyName("supportsHttpsTrafficOnly");
writer.WriteBooleanValue(EnableHttpsTrafficOnly.Value);
}
if (Optional.IsDefined(NetworkRuleSet))
{
writer.WritePropertyName("networkAcls");
writer.WriteObjectValue(NetworkRuleSet);
}
if (Optional.IsDefined(LargeFileSharesState))
{
writer.WritePropertyName("largeFileSharesState");
writer.WriteStringValue(LargeFileSharesState.Value.ToString());
}
if (Optional.IsDefined(RoutingPreference))
{
writer.WritePropertyName("routingPreference");
writer.WriteObjectValue(RoutingPreference);
}
if (Optional.IsDefined(AllowBlobPublicAccess))
{
writer.WritePropertyName("allowBlobPublicAccess");
writer.WriteBooleanValue(AllowBlobPublicAccess.Value);
}
if (Optional.IsDefined(MinimumTlsVersion))
{
writer.WritePropertyName("minimumTlsVersion");
writer.WriteStringValue(MinimumTlsVersion.Value.ToString());
}
if (Optional.IsDefined(AllowSharedKeyAccess))
{
writer.WritePropertyName("allowSharedKeyAccess");
writer.WriteBooleanValue(AllowSharedKeyAccess.Value);
}
if (Optional.IsDefined(AllowCrossTenantReplication))
{
writer.WritePropertyName("allowCrossTenantReplication");
writer.WriteBooleanValue(AllowCrossTenantReplication.Value);
}
writer.WriteEndObject();
writer.WriteEndObject();
}
}
}
| 37.471074
| 82
| 0.561094
|
[
"MIT"
] |
93mishra/azure-sdk-for-net
|
sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/StorageAccountUpdateParameters.Serialization.cs
| 4,534
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace strategy
{
class Program
{
public class People
{
private string name;
private string lastname;
public virtual string Name
{
get { return name; }
set { this.name = value; }
}
public virtual string LastName
{
get { return lastname; }
set { this.lastname = value; }
}
}
public class Book
{
private string title;
private string status;
public virtual string Status
{
get { return status; }
set { this.status = value; }
}
public virtual string Title
{
get { return title; }
set { this.title = value; }
}
}
public class Student : People
{
private double grade;
public virtual double Grade
{
get { return grade; }
set { this.grade = value; }
}
}
public class Teacher : People
{
private string folder;
public virtual string Folder
{
get { return folder; }
set { this.folder = value; }
}
}
public class Member : People
{
private double fee;
public virtual double Fee
{
get { return fee; }
set { this.fee = value; }
}
}
public class Library
{
private static List<Book> books;
public Library()
{
books = new List<Book>();
}
public void AddBook(Book book)
{
books.Add(book);
}
public List<Book> GetBooks()
{
return books;
}
}
public interface IBookStrategy
{
Book FindBook(string title);
}
public class NewGoodRegularStrategy : IBookStrategy
{
public virtual Book FindBook(string title)
{
return new Book
{
Title = title,
Status = "New"
};
}
}
public class GoodNewRegularStrategy : IBookStrategy
{
public virtual Book FindBook(string title)
{
return new Book
{
Title = title,
Status = "Good"
};
}
}
public class RegularGoodNewStrategy : IBookStrategy
{
public virtual Book FindBook(string title)
{
return new Book
{
Title = title,
Status = "Regular"
};
}
}
public class BookFinder
{
public virtual Book FindBook(People people, string title)
{
IBookStrategy strategy = null;
if (people is Member)
{
strategy = new NewGoodRegularStrategy();
}
else if (people is Teacher)
{
strategy = new GoodNewRegularStrategy();
}
else if (people is Student)
{
strategy = new RegularGoodNewStrategy();
}
return strategy.FindBook(title);
}
}
static void Main(string[] args)
{
Member member = new Member();
Teacher teacher = new Teacher();
Student student = new Student();
Book bookM = (new BookFinder()).FindBook(member, "Book title");
Console.WriteLine("Book " + "<" + bookM.Title + ">" + "\nCondition: <" + bookM.Status + ">\nFor: <Member>");
Console.Write("\n");
Book bookT = (new BookFinder()).FindBook(member, "Book title");
Console.WriteLine("Book " + "<" + bookT.Title + ">" + "\nCondition: <" + bookT.Status + ">\nFor: <Teacher>");
Console.Write("\n");
Book bookS = (new BookFinder()).FindBook(member, "Book title");
Console.WriteLine("Book " + "<" + bookS.Title + ">" + "\nCondition: <" + bookS.Status + ">\nFor: <Student>");
Console.Write("\n");
Console.ReadKey();
}
}
}
| 18.666667
| 112
| 0.604464
|
[
"MIT"
] |
pabloaguiars/8vo
|
patrones-diseno/practicas/strategy/strategy/Program.cs
| 3,362
|
C#
|
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Controllers;
using JsonApiDotNetCore.Services;
using Microsoft.Extensions.Logging;
namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Archiving
{
public sealed class TelevisionStationsController : JsonApiController<TelevisionStation>
{
public TelevisionStationsController(IJsonApiOptions options, ILoggerFactory loggerFactory, IResourceService<TelevisionStation> resourceService)
: base(options, loggerFactory, resourceService)
{
}
}
}
| 34.625
| 151
| 0.796029
|
[
"MIT"
] |
Degreed-jdw/JsonApiDotNetCore
|
test/JsonApiDotNetCoreExampleTests/IntegrationTests/Archiving/TelevisionStationsController.cs
| 554
|
C#
|
using Microsoft.AspNetCore.Authorization;
namespace ProcurementTracker.Shared.Auth.Requirements.Bid
{
public class ReadBidRequirement : BaseRequirement, IAuthorizationRequirement
{
public ReadBidRequirement(bool isAuthorized)
{
IsAuthorized = isAuthorized;
}
}
}
| 24.076923
| 80
| 0.709265
|
[
"MIT"
] |
joeseggie/procurements-tracker
|
ProcurementTracker/Shared/Auth/Requirements/Bid/ReadBidRequirement.cs
| 315
|
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("IconPreviewHandler")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IconPreviewHandler")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[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("9b3ac119-7d93-4d34-a609-6ac79b11e9aa")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.081081
| 84
| 0.747339
|
[
"MIT"
] |
0x4a616e/sharpshell
|
SharpShell/Samples/PreviewHandler/IconPreviewHandler/Properties/AssemblyInfo.cs
| 1,412
|
C#
|
using System.Collections.Generic;
namespace GitOut.Features.Git
{
public class AddOptions
{
private AddOptions(bool intentToAdd) => IntentToAdd = intentToAdd;
public bool IntentToAdd { get; }
public IEnumerable<string> BuildArguments()
{
if (IntentToAdd)
{
yield return "--intent-to-add";
}
}
public static IAddOptionsBuilder Builder() => new AddOptionsBuilder();
public static AddOptions None => new(false);
private class AddOptionsBuilder : IAddOptionsBuilder
{
private bool intentToAdd;
public AddOptions Build() => new(intentToAdd);
public IAddOptionsBuilder WithIntent()
{
intentToAdd = true;
return this;
}
}
}
}
| 24.6
| 78
| 0.557491
|
[
"MIT"
] |
calahatras/gitout
|
GitOut/Features/Git/AddOptions.cs
| 861
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static COOLgrammarParser;
using static CmpProject.TypeCool;
namespace CmpProject
{
public class FeatureBuilderVisitor : IVisitor<ProgramContext>, IVisitor<ClassContext>, IVisitor<FeatureContext>,
IVisitor<MethodContext>, IVisitor<AttributeContext>, IVisitor<FormalContext,Formal>, IVisitor<DeclarationContext>
{
public IGlobalContext globalContext;
private IType type;
public IErrorLogger errorLogger;
public BasicTypes basicTypes;
public FeatureBuilderVisitor(TypeBuilderVisitor typeBuilder)
{
basicTypes = typeBuilder.basicTypes;
globalContext = typeBuilder.globalContext;
errorLogger = typeBuilder.errorLogger;
}
public void Visit(ProgramContext parserRule)
{
parserRule._classes = Preprocecing(parserRule._classes);
foreach (var _class in parserRule._classes) {
Visit(_class);
}
}
public void Visit(ClassContext parserRule)
{
type = globalContext.GetType(parserRule.type.Text);
if (parserRule.inherits != null)
{
if (!globalContext.IfDefineType(parserRule.inherits.Text))
errorLogger.LogError($"El tipo con nombre {parserRule.inherits.Text} no ha sido encontrado");
if (globalContext.Int.Name== parserRule.inherits.Text)
errorLogger.LogError($"El tipo {parserRule.type.Text} no puede heredar de Int");
if (globalContext.String.Name == parserRule.inherits.Text)
errorLogger.LogError($"El tipo {parserRule.type.Text} no puede heredar de String");
if (globalContext.Bool.Name == parserRule.inherits.Text)
errorLogger.LogError($"El tipo {parserRule.type.Text} no puede heredar de Bool");
var inherits= globalContext.GetType(parserRule.inherits.Text);
type.Inherits = inherits;
if (inherits.Conform(type))
{
errorLogger.LogError("No se permite la herencia cíclica");
}
}
foreach (var item in parserRule._features)
{
Visit(item);
}
//Verifico si la clase Main tiene el metodo main y si este no tiene parametros
if (parserRule.type.Text=="Main")
{
if (type.IsDefineMethod("main"))
{
var main = type.GetMethod("main");
if (main.Formals.Length>0)
errorLogger.LogError("El metodo main no tiene parametros");
}
else
errorLogger.LogError("El metodo main no esta definido en la clase Main");
}
}
//Este tipo de visitor siempre retorna algo
public Formal Visit(FormalContext parserRule)
{
return new Formal(parserRule.idText, globalContext.GetType(parserRule.typeText));
}
public void Visit(FeatureContext parserRule)
{
switch (parserRule)
{
case AttributeContext attribute:
Visit(attribute);
break;
case MethodContext method:
Visit(method);
break;
default:
break;
}
}
public void Visit(AttributeContext parserRule)
{
Visit(parserRule.decl);
}
public void Visit(MethodContext parserRule)
{
var methodName = parserRule.methodName.Text;
var typeReturn = globalContext.GetType(parserRule.TypeReturn.Text);
var formals = (from f in parserRule._formals select Visit(f)).ToArray();
if (!type.IfDefineInTheCurrentType(methodName))
{ //Si no esta definida en la clase actual hay que verificar si se puede refinir de un ancestro
if (!type.Define(methodName,typeReturn,formals))
errorLogger.LogError($"No se puede redefinir el metodo con nombre {parserRule.idText}, linea {parserRule.methodName.Line} y la columna {parserRule.methodName.Column}");
}
else
errorLogger.LogError($"El tipo {type.Name} ya tiene un metodo con nombre {parserRule.idText}, linea {parserRule.methodName.Line} y la columna {parserRule.methodName.Column}");
//if ( !type.Define(methodName, type, formals))
// errorLogger.LogError($"El tipo {type.Name} ya tiene un metodo con nombre {parserRule.idText}, linea {parserRule.methodName.Line} y la columna {parserRule.methodName.Column}");
}
public void Visit(DeclarationContext parserRule)
{
if( !type.Define(parserRule.idText, globalContext.GetType(parserRule.typeText),parserRule.expression))
errorLogger.LogError($"El tipo {type.Name} ya tiene un atributo con nombre {parserRule.idText}, linea {parserRule.id.Line} y la columns {parserRule.id.Column}");
}
//Esta funcion clacula el orden topologico de las clases
public ClassContext[] Preprocecing(IList<ClassContext> classes)
{
var stack = new Stack<ClassContext>();
for (int i = 0; i < classes.Count; i++)
DFS_Visit(stack, classes[i],classes.Count,0);
return stack.Reverse().ToArray();
}
private void DFS_Visit(Stack<ClassContext>stack,ClassContext @class,int max, int current)
{
if (current > max)
{
errorLogger.LogError("No se permite la herencia cíclica");
return;
}
if (@class == null || stack.Contains(@class))
return;
DFS_Visit(stack, @class.father,max,current+1);
stack.Push(@class);
}
}
}
| 44.459854
| 194
| 0.590051
|
[
"MIT"
] |
matcom-compilers-2019/cool-compiler-durakotocool
|
src/Cool/FeatureBuilderVisitor.cs
| 6,093
|
C#
|
using System.Data.Entity;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
namespace adminlte.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("BancaVirtual", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}
}
| 36.363636
| 175
| 0.705
|
[
"MIT"
] |
lgyaguapaz/ProyectoBancaVirtual
|
adminlte/Models/IdentityModels.cs
| 1,202
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnamelDesktop_Injector
{
public enum LVM
{
FIRST = 0x1000,
SETUNICODEFORMAT = 0x2005, // CCM_SETUNICODEFORMAT,
GETUNICODEFORMAT = 0x2006, // CCM_GETUNICODEFORMAT,
GETBKCOLOR = (FIRST + 0),
SETBKCOLOR = (FIRST + 1),
GETIMAGELIST = (FIRST + 2),
SETIMAGELIST = (FIRST + 3),
GETITEMCOUNT = (FIRST + 4),
GETITEMA = (FIRST + 5),
GETITEMW = (FIRST + 75),
GETITEM = GETITEMW,
//GETITEM = GETITEMA,
SETITEMA = (FIRST + 6),
SETITEMW = (FIRST + 76),
SETITEM = SETITEMW,
//SETITEM = SETITEMA,
INSERTITEMA = (FIRST + 7),
INSERTITEMW = (FIRST + 77),
INSERTITEM = INSERTITEMW,
//INSERTITEM = INSERTITEMA,
DELETEITEM = (FIRST + 8),
DELETEALLITEMS = (FIRST + 9),
GETCALLBACKMASK = (FIRST + 10),
SETCALLBACKMASK = (FIRST + 11),
GETNEXTITEM = (FIRST + 12),
FINDITEMA = (FIRST + 13),
FINDITEMW = (FIRST + 83),
GETITEMRECT = (FIRST + 14),
SETITEMPOSITION = (FIRST + 15),
GETITEMPOSITION = (FIRST + 16),
GETSTRINGWIDTHA = (FIRST + 17),
GETSTRINGWIDTHW = (FIRST + 87),
HITTEST = (FIRST + 18),
ENSUREVISIBLE = (FIRST + 19),
SCROLL = (FIRST + 20),
REDRAWITEMS = (FIRST + 21),
ARRANGE = (FIRST + 22),
EDITLABELA = (FIRST + 23),
EDITLABELW = (FIRST + 118),
EDITLABEL = EDITLABELW,
//EDITLABEL = EDITLABELA,
GETEDITCONTROL = (FIRST + 24),
GETCOLUMNA = (FIRST + 25),
GETCOLUMNW = (FIRST + 95),
SETCOLUMNA = (FIRST + 26),
SETCOLUMNW = (FIRST + 96),
INSERTCOLUMNA = (FIRST + 27),
INSERTCOLUMNW = (FIRST + 97),
DELETECOLUMN = (FIRST + 28),
GETCOLUMNWIDTH = (FIRST + 29),
SETCOLUMNWIDTH = (FIRST + 30),
GETHEADER = (FIRST + 31),
CREATEDRAGIMAGE = (FIRST + 33),
GETVIEWRECT = (FIRST + 34),
GETTEXTCOLOR = (FIRST + 35),
SETTEXTCOLOR = (FIRST + 36),
GETTEXTBKCOLOR = (FIRST + 37),
SETTEXTBKCOLOR = (FIRST + 38),
GETTOPINDEX = (FIRST + 39),
GETCOUNTPERPAGE = (FIRST + 40),
GETORIGIN = (FIRST + 41),
UPDATE = (FIRST + 42),
SETITEMSTATE = (FIRST + 43),
GETITEMSTATE = (FIRST + 44),
GETITEMTEXTA = (FIRST + 45),
GETITEMTEXTW = (FIRST + 115),
SETITEMTEXTA = (FIRST + 46),
SETITEMTEXTW = (FIRST + 116),
SETITEMCOUNT = (FIRST + 47),
SORTITEMS = (FIRST + 48),
SETITEMPOSITION32 = (FIRST + 49),
GETSELECTEDCOUNT = (FIRST + 50),
GETITEMSPACING = (FIRST + 51),
GETISEARCHSTRINGA = (FIRST + 52),
GETISEARCHSTRINGW = (FIRST + 117),
GETISEARCHSTRING = GETISEARCHSTRINGW,
//GETISEARCHSTRING = GETISEARCHSTRINGA,
SETICONSPACING = (FIRST + 53),
SETEXTENDEDLISTVIEWSTYLE = (FIRST + 54), // optional wParam == mask
GETEXTENDEDLISTVIEWSTYLE = (FIRST + 55),
GETSUBITEMRECT = (FIRST + 56),
SUBITEMHITTEST = (FIRST + 57),
SETCOLUMNORDERARRAY = (FIRST + 58),
GETCOLUMNORDERARRAY = (FIRST + 59),
SETHOTITEM = (FIRST + 60),
GETHOTITEM = (FIRST + 61),
SETHOTCURSOR = (FIRST + 62),
GETHOTCURSOR = (FIRST + 63),
APPROXIMATEVIEWRECT = (FIRST + 64),
SETWORKAREAS = (FIRST + 65),
GETWORKAREAS = (FIRST + 70),
GETNUMBEROFWORKAREAS = (FIRST + 73),
GETSELECTIONMARK = (FIRST + 66),
SETSELECTIONMARK = (FIRST + 67),
SETHOVERTIME = (FIRST + 71),
GETHOVERTIME = (FIRST + 72),
SETTOOLTIPS = (FIRST + 74),
GETTOOLTIPS = (FIRST + 78),
SORTITEMSEX = (FIRST + 81),
SETBKIMAGEA = (FIRST + 68),
SETBKIMAGEW = (FIRST + 138),
GETBKIMAGEA = (FIRST + 69),
GETBKIMAGEW = (FIRST + 139),
SETSELECTEDCOLUMN = (FIRST + 140),
SETVIEW = (FIRST + 142),
GETVIEW = (FIRST + 143),
INSERTGROUP = (FIRST + 145),
SETGROUPINFO = (FIRST + 147),
GETGROUPINFO = (FIRST + 149),
REMOVEGROUP = (FIRST + 150),
MOVEGROUP = (FIRST + 151),
GETGROUPCOUNT = (FIRST + 152),
GETGROUPINFOBYINDEX = (FIRST + 153),
MOVEITEMTOGROUP = (FIRST + 154),
GETGROUPRECT = (FIRST + 98),
SETGROUPMETRICS = (FIRST + 155),
GETGROUPMETRICS = (FIRST + 156),
ENABLEGROUPVIEW = (FIRST + 157),
SORTGROUPS = (FIRST + 158),
INSERTGROUPSORTED = (FIRST + 159),
REMOVEALLGROUPS = (FIRST + 160),
HASGROUP = (FIRST + 161),
GETGROUPSTATE = (FIRST + 92),
GETFOCUSEDGROUP = (FIRST + 93),
SETTILEVIEWINFO = (FIRST + 162),
GETTILEVIEWINFO = (FIRST + 163),
SETTILEINFO = (FIRST + 164),
GETTILEINFO = (FIRST + 165),
SETINSERTMARK = (FIRST + 166),
GETINSERTMARK = (FIRST + 167),
INSERTMARKHITTEST = (FIRST + 168),
GETINSERTMARKRECT = (FIRST + 169),
SETINSERTMARKCOLOR = (FIRST + 170),
GETINSERTMARKCOLOR = (FIRST + 171),
GETSELECTEDCOLUMN = (FIRST + 174),
ISGROUPVIEWENABLED = (FIRST + 175),
GETOUTLINECOLOR = (FIRST + 176),
SETOUTLINECOLOR = (FIRST + 177),
CANCELEDITLABEL = (FIRST + 179),
MAPINDEXTOID = (FIRST + 180),
MAPIDTOINDEX = (FIRST + 181),
ISITEMVISIBLE = (FIRST + 182),
GETACCVERSION = (FIRST + 193),
GETEMPTYTEXT = (FIRST + 204),
GETFOOTERRECT = (FIRST + 205),
GETFOOTERINFO = (FIRST + 206),
GETFOOTERITEMRECT = (FIRST + 207),
GETFOOTERITEM = (FIRST + 208),
GETITEMINDEXRECT = (FIRST + 209),
SETITEMINDEXSTATE = (FIRST + 210),
GETNEXTITEMINDEX = (FIRST + 211),
SETPRESERVEALPHA = (FIRST + 212),
SETBKIMAGE = SETBKIMAGEW,
GETBKIMAGE = GETBKIMAGEW,
//SETBKIMAGE = SETBKIMAGEA,
//GETBKIMAGE = GETBKIMAGEA,
}
}
| 38.08284
| 87
| 0.521131
|
[
"MIT"
] |
7UKECREAT0R/EnamelDesktop
|
MSGEnums.cs
| 6,438
|
C#
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class TileEntity {
public MapPositionComponent mapPosition { get { return (MapPositionComponent)GetComponent(TileComponentsLookup.MapPosition); } }
public bool hasMapPosition { get { return HasComponent(TileComponentsLookup.MapPosition); } }
public void AddMapPosition(Position newValue) {
var index = TileComponentsLookup.MapPosition;
var component = CreateComponent<MapPositionComponent>(index);
component.Value = newValue;
AddComponent(index, component);
}
public void ReplaceMapPosition(Position newValue) {
var index = TileComponentsLookup.MapPosition;
var component = CreateComponent<MapPositionComponent>(index);
component.Value = newValue;
ReplaceComponent(index, component);
}
public void RemoveMapPosition() {
RemoveComponent(TileComponentsLookup.MapPosition);
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public sealed partial class TileMatcher {
static Entitas.IMatcher<TileEntity> _matcherMapPosition;
public static Entitas.IMatcher<TileEntity> MapPosition {
get {
if(_matcherMapPosition == null) {
var matcher = (Entitas.Matcher<TileEntity>)Entitas.Matcher<TileEntity>.AllOf(TileComponentsLookup.MapPosition);
matcher.componentNames = TileComponentsLookup.componentNames;
_matcherMapPosition = matcher;
}
return _matcherMapPosition;
}
}
}
| 40.701754
| 133
| 0.589655
|
[
"MIT"
] |
Arpple/projectend
|
Assets/Scripts/Generated/Tile/Components/TileMapPositionComponent.cs
| 2,320
|
C#
|
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNative.Network.V20180601.Inputs
{
/// <summary>
/// Frontend IP configuration of an application gateway.
/// </summary>
public sealed class ApplicationGatewayFrontendIPConfigurationArgs : Pulumi.ResourceArgs
{
/// <summary>
/// A unique read-only string that changes whenever the resource is updated.
/// </summary>
[Input("etag")]
public Input<string>? Etag { get; set; }
/// <summary>
/// Resource ID.
/// </summary>
[Input("id")]
public Input<string>? Id { get; set; }
/// <summary>
/// Name of the frontend IP configuration that is unique within an Application Gateway.
/// </summary>
[Input("name")]
public Input<string>? Name { get; set; }
/// <summary>
/// PrivateIPAddress of the network interface IP Configuration.
/// </summary>
[Input("privateIPAddress")]
public Input<string>? PrivateIPAddress { get; set; }
/// <summary>
/// PrivateIP allocation method.
/// </summary>
[Input("privateIPAllocationMethod")]
public InputUnion<string, Pulumi.AzureNative.Network.V20180601.IPAllocationMethod>? PrivateIPAllocationMethod { get; set; }
/// <summary>
/// Provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
/// </summary>
[Input("provisioningState")]
public Input<string>? ProvisioningState { get; set; }
/// <summary>
/// Reference of the PublicIP resource.
/// </summary>
[Input("publicIPAddress")]
public Input<Inputs.SubResourceArgs>? PublicIPAddress { get; set; }
/// <summary>
/// Reference of the subnet resource.
/// </summary>
[Input("subnet")]
public Input<Inputs.SubResourceArgs>? Subnet { get; set; }
/// <summary>
/// Type of the resource.
/// </summary>
[Input("type")]
public Input<string>? Type { get; set; }
public ApplicationGatewayFrontendIPConfigurationArgs()
{
}
}
}
| 32.285714
| 131
| 0.597345
|
[
"Apache-2.0"
] |
polivbr/pulumi-azure-native
|
sdk/dotnet/Network/V20180601/Inputs/ApplicationGatewayFrontendIPConfigurationArgs.cs
| 2,486
|
C#
|
using System.ComponentModel.DataAnnotations;
namespace Schruted.Configuration.Dto
{
public class ChangeUiThemeInput
{
[Required]
[StringLength(32)]
public string Theme { get; set; }
}
}
| 18.666667
| 45
| 0.65625
|
[
"MIT"
] |
KaanYilmazz/Schruted
|
aspnet-core/src/Schruted.Application/Configuration/Dto/ChangeUiThemeInput.cs
| 226
|
C#
|
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Layers;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.Tasks.Query;
using System;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
namespace ArcGISRuntimeSDKDotNet_StoreSamples.Samples
{
/// <summary>
///
/// </summary>
/// <category>Query Tasks</category>
public sealed partial class AttributeQuery : Page
{
public AttributeQuery()
{
this.InitializeComponent();
mapView1.Map.InitialExtent = new Envelope(-15000000, 2000000, -7000000, 8000000);
InitializeComboBox().ContinueWith((_) => { }, TaskScheduler.FromCurrentSynchronizationContext());
}
private async Task InitializeComboBox()
{
QueryTask queryTask = new QueryTask(new Uri("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"));
Query query = new Query("1=1")
{
ReturnGeometry = false,
};
query.OutFields.Add("STATE_NAME");
try
{
var result = await queryTask.ExecuteAsync(query);
QueryComboBox.ItemsSource = result.FeatureSet.Features.OrderBy(x => x.Attributes["STATE_NAME"]);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
private async void QueryComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
await GetAttributes();
}
private async Task GetAttributes()
{
QueryTask queryTask = new QueryTask(new Uri("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"));
var qryText = (string)(QueryComboBox.SelectedItem as Graphic).Attributes["STATE_NAME"];
Query query = new Query(qryText)
{
OutFields = OutFields.All,
ReturnGeometry = true,
OutSpatialReference = mapView1.SpatialReference
};
try
{
ResultsGrid.ItemsSource = null;
progress.IsActive = true;
var result = await queryTask.ExecuteAsync(query);
var featureSet = result.FeatureSet;
// If an item has been selected
GraphicsLayer graphicsLayer = mapView1.Map.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.Graphics.Clear();
if (featureSet != null && featureSet.Features.Count > 0)
{
var symbol = LayoutRoot.Resources["DefaultFillSymbol"] as Esri.ArcGISRuntime.Symbology.Symbol;
var g = featureSet.Features[0];
graphicsLayer.Graphics.Add(g);
var selectedFeatureExtent = g.Geometry.Extent;
Envelope displayExtent = selectedFeatureExtent.Expand(1.3);
mapView1.SetView(displayExtent);
ResultsGrid.ItemsSource = g.Attributes;
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
finally
{
progress.IsActive = false;
}
}
private void KeyLoaded(object sender, object e)
{
TextBlock textBlock = (TextBlock)sender;
dynamic dyn = textBlock.DataContext;
textBlock.Text = dyn.Key;
}
private void ValueLoaded(object sender, object e)
{
TextBlock textBlock = (TextBlock)sender;
dynamic dyn = textBlock.DataContext;
textBlock.Text = Convert.ToString(dyn.Value, CultureInfo.InvariantCulture);
}
}
}
| 35.648649
| 160
| 0.580743
|
[
"Apache-2.0"
] |
boonyachengdu/arcgis-runtime-samples-dotnet
|
src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/QueryTasks/AttributeQuery.xaml.cs
| 3,959
|
C#
|
//-----------------------------------------------------------------------
// <copyright file="LazyRecordingFolderItemViewModel.cs" company="James Chaldecott">
// Copyright (c) 2012-2013 James Chaldecott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Caliburn.Micro;
using Tivo.Connect.Entities;
using TivoAhoy.Common.Events;
using TivoAhoy.Common.Services;
namespace TivoAhoy.Common.ViewModels
{
public class LazyRecordingFolderItemViewModel : PropertyChangedBase
{
private readonly IProgressService progressService;
private readonly ITivoConnectionService connectionService;
private readonly Func<IndividualShowViewModel> showViewModelFactory;
private readonly Func<ShowContainerViewModel> showContainerViewModelFactory;
private long objectId;
private Task itemTask;
private IRecordingFolderItemViewModel item;
public LazyRecordingFolderItemViewModel(
IProgressService progressService,
ITivoConnectionService connectionService,
Func<IndividualShowViewModel> showViewModelFactory,
Func<ShowContainerViewModel> showContainerViewModelFactory)
{
this.progressService = progressService;
this.connectionService = connectionService;
this.showViewModelFactory = showViewModelFactory;
this.showContainerViewModelFactory = showContainerViewModelFactory;
}
/// <summary>
/// Design mode constructor
/// </summary>
public LazyRecordingFolderItemViewModel(RecordingFolderItem item)
{
this.showViewModelFactory = () => new IndividualShowViewModel();
this.showContainerViewModelFactory = () => new ShowContainerViewModel();
this.Item = CreateItemViewModel(item);
}
public void Initialise(long objectId)
{
this.objectId = objectId;
}
public IRecordingFolderItemViewModel Item
{
get
{
if (this.item != null)
{
return this.item;
}
if (this.itemTask == null)
{
this.itemTask = UpdateItemAsync();
}
return null;
}
private set
{
this.item = value;
this.NotifyOfPropertyChange(() => this.Item);
}
}
private async Task UpdateItemAsync()
{
try
{
var connection = await this.connectionService.GetConnectionAsync();
using (progressService.Show())
{
var results = await connection.GetRecordingFolderItems(new[] { this.objectId });
var source = results.FirstOrDefault();
this.Item = CreateItemViewModel(source);
}
}
catch (Exception ex)
{
Debug.WriteLine("Error fetching recording folder item details for item {0} : {1}", this.objectId, ex);
}
}
private IRecordingFolderItemViewModel CreateItemViewModel(RecordingFolderItem recordingFolderItem)
{
var showContainer = recordingFolderItem as Container;
if (showContainer != null)
{
var result = this.showContainerViewModelFactory();
result.Source = showContainer;
return result;
}
var show = recordingFolderItem as IndividualShow;
if (show != null)
{
var result = this.showViewModelFactory();
result.Source = show;
return result;
}
return null;
}
}
}
| 32.223077
| 119
| 0.547625
|
[
"MIT"
] |
swythan/showlist-tivo
|
Src/TivoAhoy.Common/ViewModels/LazyRecordingFolderItemViewModel.cs
| 4,191
|
C#
|
using DevnotMentor.Api.Entities;
using DevnotMentor.Api.Repositories.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DevnotMentor.Api.Repositories
{
public class BaseRepository<TEntity> : IRepository<TEntity>
where TEntity : class, new()
{
protected MentorDBContext DbContext;
public BaseRepository(MentorDBContext dbContext)
{
DbContext = dbContext;
}
public TEntity Create(TEntity entity)
{
var newEntry = DbContext.Set<TEntity>().Add(entity);
DbContext.SaveChanges();
return newEntry.Entity;
}
public void Delete(TEntity entity)
{
DbContext.Set<TEntity>().Remove(entity);
DbContext.SaveChanges();
}
public List<TEntity> GetList()
{
return DbContext.Set<TEntity>().ToList();
}
public TEntity Update(TEntity entity)
{
var newEntry = DbContext.Set<TEntity>().Update(entity);
DbContext.SaveChanges();
return newEntry.Entity;
}
}
}
| 24.541667
| 67
| 0.603565
|
[
"MIT"
] |
enisn/devnot-mentor-back-end
|
Devnot.Mentor.Api/Repositories/BaseRepository.cs
| 1,180
|
C#
|
using EventStore.Common.Utils;
using EventStore.Core.Messages;
using EventStore.Core.Messaging;
using EventStore.Core.Services.Monitoring.Stats;
namespace EventStore.Core.Services.Monitoring {
public class StatsCollectorEnvelope : IEnvelope {
private readonly StatsContainer _statsContainer;
public StatsCollectorEnvelope(StatsContainer statsContainer) {
_statsContainer = statsContainer;
Ensure.NotNull(statsContainer, "statsContainer");
}
public void ReplyWith<T>(T message) where T : Message {
var msg = message as MonitoringMessage.InternalStatsRequestResponse;
if (msg != null)
_statsContainer.Add(msg.Stats);
}
}
}
| 29.636364
| 71
| 0.785276
|
[
"Apache-2.0",
"CC0-1.0"
] |
01100010011001010110010101110000/EventStore
|
src/EventStore.Core/Services/Monitoring/StatsCollectorEnvelope.cs
| 652
|
C#
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Batch.Protocol.Models
{
using System.Linq;
/// <summary>
/// Additional parameters for the ListNext operation.
/// </summary>
public partial class ApplicationListNextOptions
{
/// <summary>
/// Initializes a new instance of the ApplicationListNextOptions class.
/// </summary>
public ApplicationListNextOptions() { }
/// <summary>
/// Initializes a new instance of the ApplicationListNextOptions class.
/// </summary>
/// <param name="clientRequestId">The caller-generated request
/// identity, in the form of a GUID with no decoration such as curly
/// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.</param>
/// <param name="returnClientRequestId">Whether the server should
/// return the client-request-id in the response.</param>
/// <param name="ocpDate">The time the request was issued. Client
/// libraries typically set this to the current system clock time; set
/// it explicitly if you are calling the REST API directly.</param>
public ApplicationListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?))
{
ClientRequestId = clientRequestId;
ReturnClientRequestId = returnClientRequestId;
OcpDate = ocpDate;
}
/// <summary>
/// Gets or sets the caller-generated request identity, in the form of
/// a GUID with no decoration such as curly braces, e.g.
/// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "")]
public System.Guid? ClientRequestId { get; set; }
/// <summary>
/// Gets or sets whether the server should return the client-request-id
/// in the response.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "")]
public bool? ReturnClientRequestId { get; set; }
/// <summary>
/// Gets or sets the time the request was issued. Client libraries
/// typically set this to the current system clock time; set it
/// explicitly if you are calling the REST API directly.
/// </summary>
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.Rest.Serialization.DateTimeRfc1123JsonConverter))]
[Newtonsoft.Json.JsonProperty(PropertyName = "")]
public System.DateTime? OcpDate { get; set; }
}
}
| 43.149254
| 195
| 0.653407
|
[
"MIT"
] |
DiogenesPolanco/azure-sdk-for-net
|
src/Batch/Client/Src/Azure.Batch/GeneratedProtocol/Models/ApplicationListNextOptions.cs
| 2,891
|
C#
|
using System;
namespace BTCPayServer.Events
{
public class BitPayInvoiceIPNEvent
{
public BitPayInvoiceIPNEvent(string invoiceId, int? eventCode, string name)
{
InvoiceId = invoiceId;
EventCode = eventCode;
Name = name;
Timestamp= DateTimeOffset.UtcNow;;
}
public DateTimeOffset Timestamp { get; set; }
public int? EventCode { get; set; }
public string Name { get; set; }
public string InvoiceId { get; set; }
public string Error { get; set; }
public override string ToString()
{
string ipnType = "IPN";
if (EventCode.HasValue)
{
ipnType = $"IPN ({EventCode.Value} {Name})";
}
if (Error == null)
return $"{ipnType} sent for invoice {InvoiceId}";
return $"Error while sending {ipnType}: {Error}";
}
}
}
| 26.638889
| 83
| 0.532847
|
[
"MIT"
] |
queilawithaQ/btcpayserver
|
BTCPayServer/Events/BitPayInvoiceIPNEvent.cs
| 959
|
C#
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
namespace System
{
public abstract partial class Type : MemberInfo, IReflect
{
protected Type() { }
public override MemberTypes MemberType => MemberTypes.TypeInfo;
public new Type GetType() => base.GetType();
public abstract string? Namespace { get; }
public abstract string? AssemblyQualifiedName { get; }
public abstract string? FullName { get; }
public abstract Assembly Assembly { get; }
public new abstract Module Module { get; }
public bool IsNested => DeclaringType != null;
public override Type? DeclaringType => null;
public virtual MethodBase? DeclaringMethod => null;
public override Type? ReflectedType => null;
public abstract Type UnderlyingSystemType { get; }
public virtual bool IsTypeDefinition => throw NotImplemented.ByDesign;
public bool IsArray => IsArrayImpl();
protected abstract bool IsArrayImpl();
public bool IsByRef => IsByRefImpl();
protected abstract bool IsByRefImpl();
public bool IsPointer => IsPointerImpl();
protected abstract bool IsPointerImpl();
public virtual bool IsConstructedGenericType => throw NotImplemented.ByDesign;
public virtual bool IsGenericParameter => false;
public virtual bool IsGenericTypeParameter => IsGenericParameter && DeclaringMethod is null;
public virtual bool IsGenericMethodParameter => IsGenericParameter && DeclaringMethod != null;
public virtual bool IsGenericType => false;
public virtual bool IsGenericTypeDefinition => false;
public virtual bool IsSZArray => throw NotImplemented.ByDesign;
public virtual bool IsVariableBoundArray => IsArray && !IsSZArray;
public virtual bool IsByRefLike { [Intrinsic] get => throw new NotSupportedException(SR.NotSupported_SubclassOverride); }
public bool HasElementType => HasElementTypeImpl();
protected abstract bool HasElementTypeImpl();
public abstract Type? GetElementType();
public virtual int GetArrayRank() => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
public virtual Type GetGenericTypeDefinition() => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
public virtual Type[] GenericTypeArguments => (IsGenericType && !IsGenericTypeDefinition) ? GetGenericArguments() : Type.EmptyTypes;
public virtual Type[] GetGenericArguments() => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
public virtual int GenericParameterPosition => throw new InvalidOperationException(SR.Arg_NotGenericParameter);
public virtual GenericParameterAttributes GenericParameterAttributes => throw new NotSupportedException();
public virtual Type[] GetGenericParameterConstraints()
{
if (!IsGenericParameter)
throw new InvalidOperationException(SR.Arg_NotGenericParameter);
throw new InvalidOperationException();
}
public TypeAttributes Attributes => GetAttributeFlagsImpl();
protected abstract TypeAttributes GetAttributeFlagsImpl();
public bool IsAbstract => (GetAttributeFlagsImpl() & TypeAttributes.Abstract) != 0;
public bool IsImport => (GetAttributeFlagsImpl() & TypeAttributes.Import) != 0;
public bool IsSealed => (GetAttributeFlagsImpl() & TypeAttributes.Sealed) != 0;
public bool IsSpecialName => (GetAttributeFlagsImpl() & TypeAttributes.SpecialName) != 0;
public bool IsClass => (GetAttributeFlagsImpl() & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Class && !IsValueType;
public bool IsNestedAssembly => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedAssembly;
public bool IsNestedFamANDAssem => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamANDAssem;
public bool IsNestedFamily => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamily;
public bool IsNestedFamORAssem => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamORAssem;
public bool IsNestedPrivate => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate;
public bool IsNestedPublic => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic;
public bool IsNotPublic => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic;
public bool IsPublic => (GetAttributeFlagsImpl() & TypeAttributes.VisibilityMask) == TypeAttributes.Public;
public bool IsAutoLayout => (GetAttributeFlagsImpl() & TypeAttributes.LayoutMask) == TypeAttributes.AutoLayout;
public bool IsExplicitLayout => (GetAttributeFlagsImpl() & TypeAttributes.LayoutMask) == TypeAttributes.ExplicitLayout;
public bool IsLayoutSequential => (GetAttributeFlagsImpl() & TypeAttributes.LayoutMask) == TypeAttributes.SequentialLayout;
public bool IsAnsiClass => (GetAttributeFlagsImpl() & TypeAttributes.StringFormatMask) == TypeAttributes.AnsiClass;
public bool IsAutoClass => (GetAttributeFlagsImpl() & TypeAttributes.StringFormatMask) == TypeAttributes.AutoClass;
public bool IsUnicodeClass => (GetAttributeFlagsImpl() & TypeAttributes.StringFormatMask) == TypeAttributes.UnicodeClass;
public bool IsCOMObject => IsCOMObjectImpl();
protected abstract bool IsCOMObjectImpl();
public bool IsContextful => IsContextfulImpl();
protected virtual bool IsContextfulImpl() => false;
public virtual bool IsEnum => IsSubclassOf(typeof(Enum));
public bool IsMarshalByRef => IsMarshalByRefImpl();
protected virtual bool IsMarshalByRefImpl() => false;
public bool IsPrimitive => IsPrimitiveImpl();
protected abstract bool IsPrimitiveImpl();
public bool IsValueType { [Intrinsic] get => IsValueTypeImpl(); }
protected virtual bool IsValueTypeImpl() => IsSubclassOf(typeof(ValueType));
[Intrinsic]
public bool IsAssignableTo([NotNullWhen(true)] Type? targetType) => targetType?.IsAssignableFrom(this) ?? false;
public virtual bool IsSignatureType => false;
public virtual bool IsSecurityCritical => throw NotImplemented.ByDesign;
public virtual bool IsSecuritySafeCritical => throw NotImplemented.ByDesign;
public virtual bool IsSecurityTransparent => throw NotImplemented.ByDesign;
public virtual StructLayoutAttribute? StructLayoutAttribute => throw new NotSupportedException();
public ConstructorInfo? TypeInitializer
{
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
get => GetConstructorImpl(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, CallingConventions.Any, Type.EmptyTypes, null);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
public ConstructorInfo? GetConstructor(Type[] types) => GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, types, null);
/// <summary>
/// Searches for a constructor whose parameters match the specified argument types, using the specified binding constraints.
/// </summary>
/// <param name="bindingAttr">
/// A bitwise combination of the enumeration values that specify how the search is conducted.
/// -or-
/// Default to return null.
/// </param>
/// <param name="types">
/// An array of Type objects representing the number, order, and type of the parameters for the constructor to get.
/// -or-
/// An empty array of the type <see cref="Type"/> (that is, Type[] types = Array.Empty{Type}()) to get a constructor that takes no parameters.
/// -or-
/// <see cref="EmptyTypes"/>.
/// </param>
/// <returns>
/// A <see cref="ConstructorInfo"/> object representing the constructor that matches the specified requirements, if found; otherwise, null.
/// </returns>
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Type[] types) => GetConstructor(bindingAttr, binder: null, types, modifiers: null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetConstructor(bindingAttr, binder, CallingConventions.Any, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers)
{
ArgumentNullException.ThrowIfNull(types);
for (int i = 0; i < types.Length; i++)
{
ArgumentNullException.ThrowIfNull(types[i], nameof(types));
}
return GetConstructorImpl(bindingAttr, binder, callConvention, types, modifiers);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
protected abstract ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
public ConstructorInfo[] GetConstructors() => GetConstructors(BindingFlags.Public | BindingFlags.Instance);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public abstract ConstructorInfo[] GetConstructors(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)]
public EventInfo? GetEvent(string name) => GetEvent(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public abstract EventInfo? GetEvent(string name, BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)]
public virtual EventInfo[] GetEvents() => GetEvents(Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public abstract EventInfo[] GetEvents(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)]
public FieldInfo? GetField(string name) => GetField(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public abstract FieldInfo? GetField(string name, BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)]
public FieldInfo[] GetFields() => GetFields(Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public abstract FieldInfo[] GetFields(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(
DynamicallyAccessedMemberTypes.PublicFields |
DynamicallyAccessedMemberTypes.PublicMethods |
DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties |
DynamicallyAccessedMemberTypes.PublicConstructors |
DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public MemberInfo[] GetMember(string name) => GetMember(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(GetAllMembers)]
public virtual MemberInfo[] GetMember(string name, BindingFlags bindingAttr) => GetMember(name, MemberTypes.All, bindingAttr);
[DynamicallyAccessedMembers(GetAllMembers)]
public virtual MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
[DynamicallyAccessedMembers(
DynamicallyAccessedMemberTypes.PublicFields |
DynamicallyAccessedMemberTypes.PublicMethods |
DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties |
DynamicallyAccessedMemberTypes.PublicConstructors |
DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public MemberInfo[] GetMembers() => GetMembers(Type.DefaultLookup);
/// <summary>
/// Searches for the <see cref="MemberInfo"/> on the current <see cref="Type"/> that matches the specified <see cref="MemberInfo"/>.
/// </summary>
/// <param name="member">
/// The <see cref="MemberInfo"/> to find on the current <see cref="Type"/>.
/// </param>
/// <returns>An object representing the member on the current <see cref="Type"/> that matches the specified member.</returns>
/// <remarks>This method can be used to find a constructed generic member given a member from a generic type definition.</remarks>
/// <exception cref="ArgumentNullException"><paramref name="member"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException"><paramref name="member"/> does not match a member on the current <see cref="Type"/>.</exception>
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern",
Justification = "This is finding the MemberInfo with the same MetadataToken as specified MemberInfo. If the specified MemberInfo " +
"exists and wasn't trimmed, then the current Type's MemberInfo couldn't have been trimmed.")]
public virtual MemberInfo GetMemberWithSameMetadataDefinitionAs(MemberInfo member)
{
ArgumentNullException.ThrowIfNull(member);
const BindingFlags all = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
foreach (MemberInfo myMemberInfo in GetMembers(all))
{
if (myMemberInfo.HasSameMetadataDefinitionAs(member))
{
return myMemberInfo;
}
}
throw CreateGetMemberWithSameMetadataDefinitionAsNotFoundException(member);
}
private protected static ArgumentException CreateGetMemberWithSameMetadataDefinitionAsNotFoundException(MemberInfo member) =>
new ArgumentException(SR.Format(SR.Arg_MemberInfoNotFound, member.Name), nameof(member));
[DynamicallyAccessedMembers(GetAllMembers)]
public abstract MemberInfo[] GetMembers(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo? GetMethod(string name) => GetMethod(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, BindingFlags bindingAttr)
{
ArgumentNullException.ThrowIfNull(name);
return GetMethodImpl(name, bindingAttr, null, CallingConventions.Any, null, null);
}
/// <summary>
/// Searches for the specified method whose parameters match the specified argument types, using the specified binding constraints.
/// </summary>
/// <param name="name">The string containing the name of the method to get.</param>
/// <param name="bindingAttr">
/// A bitwise combination of the enumeration values that specify how the search is conducted.
/// -or-
/// Default to return null.
/// </param>
/// <param name="types">
/// An array of <see cref="Type"/> objects representing the number, order, and type of the parameters for the method to get.
/// -or-
/// An empty array of <see cref="Type"/> objects (as provided by the <see cref="EmptyTypes"/> field) to get a method that takes no parameters.
/// </param>
/// <returns>An object representing the method that matches the specified requirements, if found; otherwise, null.</returns>
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Type[] types) => GetMethod(name, bindingAttr, binder: null, types, modifiers: null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo? GetMethod(string name, Type[] types) => GetMethod(name, types, null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo? GetMethod(string name, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, Type.DefaultLookup, null, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, bindingAttr, binder, CallingConventions.Any, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers)
{
ArgumentNullException.ThrowIfNull(name);
ArgumentNullException.ThrowIfNull(types);
for (int i = 0; i < types.Length; i++)
{
ArgumentNullException.ThrowIfNull(types[i], nameof(types));
}
return GetMethodImpl(name, bindingAttr, binder, callConvention, types, modifiers);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
protected abstract MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo? GetMethod(string name, int genericParameterCount, Type[] types) => GetMethod(name, genericParameterCount, types, null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo? GetMethod(string name, int genericParameterCount, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, genericParameterCount, Type.DefaultLookup, null, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, genericParameterCount, bindingAttr, binder, CallingConventions.Any, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public MethodInfo? GetMethod(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers)
{
ArgumentNullException.ThrowIfNull(name);
if (genericParameterCount < 0)
throw new ArgumentException(SR.ArgumentOutOfRange_NeedNonNegNum, nameof(genericParameterCount));
ArgumentNullException.ThrowIfNull(types);
for (int i = 0; i < types.Length; i++)
{
ArgumentNullException.ThrowIfNull(types[i], nameof(types));
}
return GetMethodImpl(name, genericParameterCount, bindingAttr, binder, callConvention, types, modifiers);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
protected virtual MethodInfo? GetMethodImpl(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException();
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
public MethodInfo[] GetMethods() => GetMethods(Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public abstract MethodInfo[] GetMethods(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public Type? GetNestedType(string name) => GetNestedType(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public abstract Type? GetNestedType(string name, BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public Type[] GetNestedTypes() => GetNestedTypes(Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public abstract Type[] GetNestedTypes(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public PropertyInfo? GetProperty(string name) => GetProperty(name, Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
public PropertyInfo? GetProperty(string name, BindingFlags bindingAttr)
{
ArgumentNullException.ThrowIfNull(name);
return GetPropertyImpl(name, bindingAttr, null, null, null, null);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern",
Justification = "Linker doesn't recognize GetPropertyImpl(BindingFlags.Public) but this is what the body is doing")]
public PropertyInfo? GetProperty(string name, Type? returnType)
{
ArgumentNullException.ThrowIfNull(name);
return GetPropertyImpl(name, Type.DefaultLookup, null, returnType, null, null);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public PropertyInfo? GetProperty(string name, Type[] types) => GetProperty(name, null, types);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public PropertyInfo? GetProperty(string name, Type? returnType, Type[] types) => GetProperty(name, returnType, types, null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public PropertyInfo? GetProperty(string name, Type? returnType, Type[] types, ParameterModifier[]? modifiers) => GetProperty(name, Type.DefaultLookup, null, returnType, types, modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
public PropertyInfo? GetProperty(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[] types, ParameterModifier[]? modifiers)
{
ArgumentNullException.ThrowIfNull(name);
ArgumentNullException.ThrowIfNull(types);
return GetPropertyImpl(name, bindingAttr, binder, returnType, types, modifiers);
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
protected abstract PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public PropertyInfo[] GetProperties() => GetProperties(Type.DefaultLookup);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
public abstract PropertyInfo[] GetProperties(BindingFlags bindingAttr);
[DynamicallyAccessedMembers(
DynamicallyAccessedMemberTypes.PublicFields
| DynamicallyAccessedMemberTypes.PublicMethods
| DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties
| DynamicallyAccessedMemberTypes.PublicConstructors
| DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public virtual MemberInfo[] GetDefaultMembers() => throw NotImplemented.ByDesign;
public virtual RuntimeTypeHandle TypeHandle => throw new NotSupportedException();
public static RuntimeTypeHandle GetTypeHandle(object o)
{
ArgumentNullException.ThrowIfNull(o);
return o.GetType().TypeHandle;
}
public static Type[] GetTypeArray(object[] args)
{
ArgumentNullException.ThrowIfNull(args);
Type[] cls = new Type[args.Length];
for (int i = 0; i < cls.Length; i++)
{
if (args[i] == null)
throw new ArgumentException(SR.ArgumentNull_ArrayValue, nameof(args));
cls[i] = args[i].GetType();
}
return cls;
}
public static TypeCode GetTypeCode(Type? type)
{
return type?.GetTypeCodeImpl() ?? TypeCode.Empty;
}
protected virtual TypeCode GetTypeCodeImpl()
{
Type systemType = UnderlyingSystemType;
if (!ReferenceEquals(this, systemType) && systemType is not null)
return GetTypeCode(systemType);
return TypeCode.Object;
}
public abstract Guid GUID { get; }
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromCLSID(Guid clsid) => GetTypeFromCLSID(clsid, null, throwOnError: false);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromCLSID(Guid clsid, bool throwOnError) => GetTypeFromCLSID(clsid, null, throwOnError: throwOnError);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromCLSID(Guid clsid, string? server) => GetTypeFromCLSID(clsid, server, throwOnError: false);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) => Marshal.GetTypeFromCLSID(clsid, server, throwOnError);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromProgID(string progID) => GetTypeFromProgID(progID, null, throwOnError: false);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromProgID(string progID, bool throwOnError) => GetTypeFromProgID(progID, null, throwOnError: throwOnError);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromProgID(string progID, string? server) => GetTypeFromProgID(progID, server, throwOnError: false);
[SupportedOSPlatform("windows")]
public static Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) => Marshal.GetTypeFromProgID(progID, server, throwOnError);
public abstract Type? BaseType { get; }
[DebuggerHidden]
[DebuggerStepThrough]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args) => InvokeMember(name, invokeAttr, binder, target, args, null, null, null);
[DebuggerHidden]
[DebuggerStepThrough]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, CultureInfo? culture) => InvokeMember(name, invokeAttr, binder, target, args, null, culture, null);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public abstract object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? namedParameters);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public Type? GetInterface(string name) => GetInterface(name, ignoreCase: false);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public abstract Type? GetInterface(string name, bool ignoreCase);
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public abstract Type[] GetInterfaces();
public virtual InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
public virtual bool IsInstanceOfType([NotNullWhen(true)] object? o) => o == null ? false : IsAssignableFrom(o.GetType());
public virtual bool IsEquivalentTo([NotNullWhen(true)] Type? other) => this == other;
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern",
Justification = "The single instance field on enum types is never trimmed")]
public virtual Type GetEnumUnderlyingType()
{
if (!IsEnum)
throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
FieldInfo[] fields = GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
if (fields == null || fields.Length != 1)
throw new ArgumentException(SR.Argument_InvalidEnum, "enumType");
return fields[0].FieldType;
}
[RequiresDynamicCode("It might not be possible to create an array of the enum type at runtime. Use Enum.GetValues<TEnum> instead.")]
public virtual Array GetEnumValues()
{
if (!IsEnum)
throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
// We don't support GetEnumValues in the default implementation because we cannot create an array of
// a non-runtime type. If there is strong need we can consider returning an object or int64 array.
throw NotImplemented.ByDesign;
}
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual Type MakeArrayType() => throw new NotSupportedException();
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual Type MakeArrayType(int rank) => throw new NotSupportedException();
public virtual Type MakeByRefType() => throw new NotSupportedException();
[RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
[RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public virtual Type MakeGenericType(params Type[] typeArguments) => throw new NotSupportedException(SR.NotSupported_SubclassOverride);
public virtual Type MakePointerType() => throw new NotSupportedException();
public static Type MakeGenericSignatureType(Type genericTypeDefinition, params Type[] typeArguments) => new SignatureConstructedGenericType(genericTypeDefinition, typeArguments);
public static Type MakeGenericMethodParameter(int position)
{
if (position < 0)
throw new ArgumentException(SR.ArgumentOutOfRange_NeedNonNegNum, nameof(position));
return new SignatureGenericMethodParameterType(position);
}
// This is used by the ToString() overrides of all reflection types. The legacy behavior has the following problems:
// 1. Use only Name for nested types, which can be confused with global types and generic parameters of the same name.
// 2. Use only Name for generic parameters, which can be confused with nested types and global types of the same name.
// 3. Use only Name for all primitive types, void and TypedReference
// 4. MethodBase.ToString() use "ByRef" for byref parameters which is different than Type.ToString().
// 5. ConstructorInfo.ToString() outputs "Void" as the return type. Why Void?
internal string FormatTypeName()
{
Type elementType = GetRootElementType();
if (elementType.IsPrimitive ||
elementType.IsNested ||
elementType == typeof(void) ||
elementType == typeof(TypedReference))
return Name;
return ToString();
}
public override string ToString() => "Type: " + Name; // Why do we add the "Type: " prefix?
public override bool Equals(object? o) => o == null ? false : Equals(o as Type);
public override int GetHashCode()
{
Type systemType = UnderlyingSystemType;
if (!object.ReferenceEquals(systemType, this))
return systemType.GetHashCode();
return base.GetHashCode();
}
public virtual bool Equals(Type? o) => o == null ? false : object.ReferenceEquals(this.UnderlyingSystemType, o.UnderlyingSystemType);
[Intrinsic]
public static bool operator ==(Type? left, Type? right)
{
if (object.ReferenceEquals(left, right))
return true;
// Runtime types are never equal to non-runtime types
// If `left` is a non-runtime type with a weird Equals implementation
// this is where operator `==` would differ from `Equals` call.
if (left is null || right is null || left is RuntimeType || right is RuntimeType)
return false;
return left.Equals(right);
}
[Intrinsic]
public static bool operator !=(Type? left, Type? right)
{
return !(left == right);
}
[Obsolete(Obsoletions.ReflectionOnlyLoadingMessage, DiagnosticId = Obsoletions.ReflectionOnlyLoadingDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
public static Type? ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ReflectionOnly);
public static Binder DefaultBinder
{
get
{
if (s_defaultBinder == null)
{
DefaultBinder binder = new DefaultBinder();
Interlocked.CompareExchange<Binder?>(ref s_defaultBinder, binder, null);
}
return s_defaultBinder!;
}
}
private static volatile Binder? s_defaultBinder;
public static readonly char Delimiter = '.';
public static readonly Type[] EmptyTypes = Array.Empty<Type>();
public static readonly object Missing = System.Reflection.Missing.Value;
public static readonly MemberFilter FilterAttribute = FilterAttributeImpl!;
public static readonly MemberFilter FilterName = (m, c) => FilterNameImpl(m, c!, StringComparison.Ordinal);
public static readonly MemberFilter FilterNameIgnoreCase = (m, c) => FilterNameImpl(m, c!, StringComparison.OrdinalIgnoreCase);
private const BindingFlags DefaultLookup = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
// DynamicallyAccessedMemberTypes.All keeps more data than what a member can use:
// - Keeps info about interfaces
// - Complete Nested types (nested type body and all its members including other nested types)
// - Public and private base type information
// Instead, the GetAllMembers constant will keep:
// - The nested types body but not the members
// - Base type public information but not private information. This information should not
// be visible via the derived type and is ignored by reflection
internal const DynamicallyAccessedMemberTypes GetAllMembers = DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields |
DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods |
DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties |
DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors |
DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes;
}
}
| 60.406202
| 270
| 0.720574
|
[
"MIT"
] |
Ali-YousefiTelori/runtime
|
src/libraries/System.Private.CoreLib/src/System/Type.cs
| 38,962
|
C#
|
/*MIT License
Copyright (c) 2020 - 2021 Sergiy Tolkachov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
using System;
using System.Collections.Generic;
using System.Text;
namespace SymOntoClay.UnityAsset.Core.Internal.EndPoints.MainThread
{
public interface IInvocableInMainThread
{
void Invoke();
}
}
| 38.352941
| 78
| 0.791411
|
[
"MIT"
] |
Symontoclay/SymOntoClay
|
SymOntoClayUnityAssetCore/Internal/EndPoints/MainThread/IInvocableInMainThread.cs
| 1,304
|
C#
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18034
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WcfClient.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WcfClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 38.541667
| 175
| 0.602523
|
[
"MIT"
] |
Mohammed95m/ADP_HomeWork
|
DXApplication1/WcfClient/Properties/Resources.Designer.cs
| 2,777
|
C#
|
using System;
using Cysharp.Threading.Tasks;
using UniRx;
namespace Domain
{
public class FadeModel
{
public IReadOnlyReactiveProperty<bool> IsOut => isOut;
private ReactiveProperty<bool> isOut = new ReactiveProperty<bool>(false);
public IObservable<float> OnFadeOut => onFadeOut;
private readonly Subject<float> onFadeOut = new Subject<float>();
public IObservable<float> OnFadeIn => onFadeIn;
private readonly Subject<float> onFadeIn = new Subject<float>();
public async UniTask FadeOut(float duration = 1f)
{
onFadeOut.OnNext(duration);
await UniTask.WaitUntil(() => isOut.Value);
}
public async UniTask FadeIn(float duration = 1f)
{
onFadeIn.OnNext(duration);
await UniTask.WaitUntil(() => !isOut.Value);
}
public void SetState(bool isOut)
{
this.isOut.Value = isOut;
}
}
}
| 28.114286
| 81
| 0.607724
|
[
"Unlicense"
] |
kameffee/unity1week-202102-code
|
Scripts/Domain/FadeModel.cs
| 986
|
C#
|
using UnityEngine;
using System.Collections;
public class FaceToCamera : MonoBehaviour {
public int rotY;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
this.transform.rotation = Quaternion.Euler(0, rotY, 0);
}
}
| 14.35
| 57
| 0.689895
|
[
"MIT"
] |
106820017/VRController
|
Assets/PQAssets/Query-Chan-SD/Scripts/GUIController/FaceToCamera.cs
| 289
|
C#
|
using NJection.LambdaConverter.Visitors;
using NJection.Scope;
using NRefactory = ICSharpCode.NRefactory.CSharp;
namespace NJection.LambdaConverter.Expressions
{
public abstract partial class AstExpression
{
public static While While(NRefactory.WhileStatement whileStatement, IScope scope, INRefcatoryExpressionVisitor visitor) {
return new While(whileStatement, scope, visitor);
}
}
}
| 33.769231
| 130
| 0.738041
|
[
"MIT"
] |
sagifogel/NJection.LambdaConverter
|
NJection.LambdaConverter/Ast/Expressions/While/AstExpression.cs
| 441
|
C#
|
using System.ComponentModel;
using Terraria.ID;
using Terraria.ModLoader.Config;
namespace YABSSM
{
public class YABSSMConfig : ModConfig
{
public enum PossibleNPCs : short
{
Clothier = NPCID.Clothier,
Dryad = NPCID.Dryad,
Merchant = NPCID.Merchant,
Demolitionist = NPCID.Demolitionist,
DyeTrader = NPCID.DyeTrader,
ArmsDealer = NPCID.ArmsDealer,
Stylist = NPCID.Stylist,
Painter = NPCID.Painter,
GoblinTinkerer = NPCID.GoblinTinkerer,
WitchDoctor = NPCID.WitchDoctor,
Mechanic = NPCID.Mechanic,
PartyGirl = NPCID.PartyGirl
}
public override ConfigScope Mode => ConfigScope.ServerSide;
[Label("Vendor NPC")]
[Tooltip("Dictates which town NPC sells boss summon items.")]
[DefaultValue(PossibleNPCs.Clothier)]
public PossibleNPCs vendorNPC;
}
}
| 25
| 63
| 0.7375
|
[
"MIT"
] |
Ilysen/YABSSM
|
YABSSMConfig.cs
| 800
|
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 WaveMeter.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WaveMeter.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 38.541667
| 175
| 0.602523
|
[
"MIT"
] |
ColdMatter/EDMSuite
|
WaveMeter/Properties/Resources.Designer.cs
| 2,777
|
C#
|
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace Biztory.EnterpriseToolkit.TableauServerUnifiedApi.Rest.Model {
/// <summary>
///
/// </summary>
[DataContract]
public class UpdateProjectRequest {
/// <summary>
/// Gets or Sets Project
/// </summary>
[DataMember(Name="project", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "project")]
public UpdateProjectRequestProject Project { get; set; }
/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString() {
var sb = new StringBuilder();
sb.Append("class UpdateProjectRequest {\n");
sb.Append(" Project: ").Append(Project).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson() {
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
}
| 27.044444
| 72
| 0.662284
|
[
"Apache-2.0"
] |
biztory/tableau-performance-accelerator
|
tableau-server-api-unified/Rest/Model/UpdateProjectRequest.cs
| 1,219
|
C#
|
/*
// <copyright>
// dotNetRDF is free and open source software licensed under the MIT License
// -------------------------------------------------------------------------
//
// Copyright (c) 2009-2017 dotNetRDF Project (http://dotnetrdf.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
*/
using System;
using System.Collections.Generic;
using System.Linq;
namespace VDS.RDF.Ontology
{
/// <summary>
/// Represents an Individual i.e. an instance of some class in an ontology
/// </summary>
/// <remarks>
/// <para>
/// See <a href="http://www.dotnetrdf.org/content.asp?pageID=Ontology%20API">Using the Ontology API</a> for some informal documentation on the use of the Ontology namespace
/// </para>
/// </remarks>
public class Individual : OntologyResource
{
private List<OntologyClass> _classes = new List<OntologyClass>();
/// <summary>
/// Gets an Individual from the Graph
/// </summary>
/// <param name="resource">Resource that represents the Individual</param>
/// <param name="graph">Graph the Individual is in</param>
/// <remarks>
/// Requires that an individual (a resource which is the subject of at least one triple where the predicate is <strong>rdf:type</strong>) is already present in the Graph
/// </remarks>
public Individual(INode resource, IGraph graph)
: base(resource, graph)
{
IntialiseClasses();
if (_classes.Count == 0) throw new RdfOntologyException("Cannot create an individual when the given resource has no types associated with it");
}
/// <summary>
/// Gets/Creates an Individual from the Graph
/// </summary>
/// <param name="resource">Resource that represents the Individual</param>
/// <param name="resourceClass">Class to create/add the Individual to</param>
/// <param name="graph">Graph the Individual is in</param>
/// <remarks>
/// Allows for creating new Individuals in the Graph or adding existing resources to another Class. If the resource for the Individual or the given Class are new then they will be added to the Graph
/// </remarks>
public Individual(INode resource, INode resourceClass, IGraph graph)
: base(resource, graph)
{
AddResourceProperty(OntologyHelper.PropertyType, resourceClass, true);
IntialiseClasses();
if (_classes.Count == 0) throw new RdfOntologyException("Failed to create a new individual");
}
/// <summary>
/// Helper method which finds all the Types given for this Resource
/// </summary>
private void IntialiseClasses()
{
IUriNode rdfType = _graph.CreateUriNode(UriFactory.Create(OntologyHelper.PropertyType));
foreach (Triple t in _graph.GetTriplesWithSubjectPredicate(_resource, rdfType))
{
OntologyClass c = new OntologyClass(t.Object, _graph);
_classes.Add(c);
}
}
/// <summary>
/// Gets all the Classes that this resource belongs to
/// </summary>
public IEnumerable<OntologyClass> Classes
{
get
{
return _classes;
}
}
/// <summary>
/// Gets whether the Individual belongs to a specific class
/// </summary>
/// <param name="class">Class</param>
/// <returns></returns>
public bool HasClass(OntologyClass @class)
{
return _classes.Any(c => c.Equals(@class));
}
/// <summary>
/// Gets whether the Individual belongs to a class identified by the given resource
/// </summary>
/// <param name="class">Class</param>
/// <returns></returns>
public bool HasClass(INode @class)
{
return _classes.Any(c => c.Resource.Equals(@class));
}
/// <summary>
/// Gets whether the Individual belongs to a class identified by the given URI
/// </summary>
/// <param name="class">Class URI</param>
/// <returns></returns>
public bool HasClass(Uri @class)
{
return HasClass(_graph.CreateUriNode(@class));
}
}
}
| 40.654135
| 207
| 0.621417
|
[
"MIT"
] |
DFihnn/dotnetrdf
|
Libraries/dotNetRDF/Ontology/Individual.cs
| 5,407
|
C#
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
namespace System.Runtime.InteropServices.ComTypes
{
[Guid("00000010-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface IRunningObjectTable
{
int Register(int grfFlags, [MarshalAs(UnmanagedType.Interface)] object punkObject, IMoniker pmkObjectName);
void Revoke(int dwRegister);
[PreserveSig]
int IsRunning(IMoniker pmkObjectName);
[PreserveSig]
int GetObject(IMoniker pmkObjectName, [MarshalAs(UnmanagedType.Interface)] out object ppunkObject);
void NoteChangeTime(int dwRegister, ref FILETIME pfiletime);
[PreserveSig]
int GetTimeOfLastChange(IMoniker pmkObjectName, out FILETIME pfiletime);
void EnumRunning(out IEnumMoniker ppenumMoniker);
}
}
| 41.4
| 115
| 0.736232
|
[
"MIT"
] |
AfsanehR-zz/corefx
|
src/Common/src/CoreLib/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs
| 1,035
|
C#
|
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;
public class AccountCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// An <a href="https://stripe.com/docs/api#create_account_token">account token</a>, used to
/// securely provide details to the account.
/// </summary>
[JsonProperty("account_token")]
public string AccountToken { get; set; }
/// <summary>
/// Business information about the account.
/// </summary>
[JsonProperty("business_profile")]
public AccountBusinessProfileOptions BusinessProfile { get; set; }
/// <summary>
/// The business type.
/// One of: <c>company</c>, <c>government_entity</c>, <c>individual</c>, or
/// <c>non_profit</c>.
/// </summary>
[JsonProperty("business_type")]
public string BusinessType { get; set; }
/// <summary>
/// Each key of the dictionary represents a capability, and each capability maps to its
/// settings (e.g. whether it has been requested or not). Each capability will be inactive
/// until you have provided its specific requirements and Stripe has verified them. An
/// account may have some of its requested capabilities be active and some be inactive.
/// </summary>
[JsonProperty("capabilities")]
public AccountCapabilitiesOptions Capabilities { get; set; }
/// <summary>
/// Information about the company or business. This field is available for any
/// <c>business_type</c>.
/// </summary>
[JsonProperty("company")]
public AccountCompanyOptions Company { get; set; }
/// <summary>
/// The country in which the account holder resides, or in which the business is legally
/// established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are
/// in the United States and the business for which you're creating an account is legally
/// represented in Canada, you would use <c>CA</c> as the country for the account being
/// created.
/// </summary>
[JsonProperty("country")]
public string Country { get; set; }
/// <summary>
/// Three-letter ISO currency code representing the default currency for the account. This
/// must be a currency that <a href="https://stripe.com/docs/payouts">Stripe supports in the
/// account's country</a>.
/// </summary>
[JsonProperty("default_currency")]
public string DefaultCurrency { get; set; }
/// <summary>
/// The email address of the account holder. This is only to make the account easier to
/// identify to you. Stripe will never directly email Custom accounts.
/// </summary>
[JsonProperty("email")]
public string Email { get; set; }
[JsonProperty("external_account")]
[JsonConverter(typeof(AnyOfConverter))]
public AnyOf<string, AccountBankAccountOptions, AccountCardOptions> ExternalAccount { get; set; }
/// <summary>
/// Information about the person represented by the account. This field is null unless
/// <c>business_type</c> is set to <c>individual</c>.
/// </summary>
[JsonProperty("individual")]
public AccountIndividualOptions Individual { get; set; }
/// <summary>
/// Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
/// attach to an object. This can be useful for storing additional information about the
/// object in a structured format. Individual keys can be unset by posting an empty value to
/// them. All keys can be unset by posting an empty value to <c>metadata</c>.
/// </summary>
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
/// <summary>
/// Options for customizing how the account functions within Stripe.
/// </summary>
[JsonProperty("settings")]
public AccountSettingsOptions Settings { get; set; }
/// <summary>
/// Details on the account's acceptance of the <a
/// href="https://stripe.com/docs/connect/updating-accounts#tos-acceptance">Stripe Services
/// Agreement</a>.
/// </summary>
[JsonProperty("tos_acceptance")]
public AccountTosAcceptanceOptions TosAcceptance { get; set; }
/// <summary>
/// The type of Stripe account to create. May be one of <c>custom</c>, <c>express</c> or
/// <c>standard</c>.
/// One of: <c>custom</c>, <c>express</c>, or <c>standard</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
| 42.947826
| 105
| 0.614092
|
[
"Apache-2.0"
] |
polinar68/stripe-dotnet
|
src/Stripe.net/Services/Accounts/AccountCreateOptions.cs
| 4,939
|
C#
|
using System.Collections.Generic;
namespace EF6CodeFirstDemo
{
public class Grade
{
public int GradeId { get; set; }
public string GradeName { get; set; }
public string Section { get; set; }
public virtual ICollection<Student> Students { get; set; }
}
}
| 24.916667
| 66
| 0.632107
|
[
"MIT"
] |
nirzaf/EF6-Code-First-Demo-master
|
EF6CodeFirstDemo/Grade.cs
| 301
|
C#
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class BlueprintNodeEventUpdate : BlueprintNodeEvent
{
//If running in the Unity Editor
#if UNITY_EDITOR
//Returns the blueprint node event updates title
protected override string GetTitle()
{
//Return the blueprint node event updates title
return "Update";
}
#endif
}
| 22.647059
| 58
| 0.78961
|
[
"MIT"
] |
ZackaryCowled/Unity-Blueprints
|
Assets/Blueprint/Scripts/Source/Nodes/EventNodes/BlueprintNodeEventUpdate.cs
| 387
|
C#
|
using MADCA.Core.Data;
using MADCA.Core.Note.Abstract;
namespace MADCA.Core.Note.Concrete
{
public sealed class Touch : ShortNote
{
public override NoteType NoteType => NoteType.Touch;
private Touch() { }
public Touch(LanePotision lane, TimingPosition timing, NoteSize size)
: base(lane, timing, size) { }
}
}
| 22.625
| 77
| 0.654696
|
[
"MIT"
] |
TinyTany/MADCA
|
MADCA/Core/Note/Concrete/Touch.cs
| 364
|
C#
|
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.Network.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// Parameters to compare with network configuration.
/// </summary>
public partial class NetworkConfigurationDiagnosticProfile
{
/// <summary>
/// Initializes a new instance of the
/// NetworkConfigurationDiagnosticProfile class.
/// </summary>
public NetworkConfigurationDiagnosticProfile()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the
/// NetworkConfigurationDiagnosticProfile class.
/// </summary>
/// <param name="direction">The direction of the traffic. Possible
/// values include: 'Inbound', 'Outbound'</param>
/// <param name="protocol">Protocol to be verified on. Accepted values
/// are '*', TCP, UDP.</param>
/// <param name="source">Traffic source. Accepted values are '*', IP
/// Address/CIDR, Service Tag.</param>
/// <param name="destination">Traffic destination. Accepted values are:
/// '*', IP Address/CIDR, Service Tag.</param>
/// <param name="destinationPort">Traffic destination port. Accepted
/// values are '*' and a single port in the range (0 - 65535).</param>
public NetworkConfigurationDiagnosticProfile(string direction, string protocol, string source, string destination, string destinationPort)
{
Direction = direction;
Protocol = protocol;
Source = source;
Destination = destination;
DestinationPort = destinationPort;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the direction of the traffic. Possible values include:
/// 'Inbound', 'Outbound'
/// </summary>
[JsonProperty(PropertyName = "direction")]
public string Direction { get; set; }
/// <summary>
/// Gets or sets protocol to be verified on. Accepted values are '*',
/// TCP, UDP.
/// </summary>
[JsonProperty(PropertyName = "protocol")]
public string Protocol { get; set; }
/// <summary>
/// Gets or sets traffic source. Accepted values are '*', IP
/// Address/CIDR, Service Tag.
/// </summary>
[JsonProperty(PropertyName = "source")]
public string Source { get; set; }
/// <summary>
/// Gets or sets traffic destination. Accepted values are: '*', IP
/// Address/CIDR, Service Tag.
/// </summary>
[JsonProperty(PropertyName = "destination")]
public string Destination { get; set; }
/// <summary>
/// Gets or sets traffic destination port. Accepted values are '*' and
/// a single port in the range (0 - 65535).
/// </summary>
[JsonProperty(PropertyName = "destinationPort")]
public string DestinationPort { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Direction == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Direction");
}
if (Protocol == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Protocol");
}
if (Source == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Source");
}
if (Destination == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Destination");
}
if (DestinationPort == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "DestinationPort");
}
}
}
}
| 36.380952
| 146
| 0.580716
|
[
"MIT"
] |
0rland0Wats0n/azure-sdk-for-net
|
sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkConfigurationDiagnosticProfile.cs
| 4,584
|
C#
|
using UnityEngine;
public class AnimationSetActive : StateMachineBehaviour {
public bool activeState = false;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animator.gameObject.SetActive(activeState);
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
//override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
}
| 41.741935
| 140
| 0.789026
|
[
"MIT"
] |
Aggrathon/rps_tournament
|
Assets/Scripts/UI/AnimationSetActive.cs
| 1,296
|
C#
|
using System;
using System.Collections.Generic;
using System.Data;
using FirebirdSql.Data.FirebirdClient;
namespace MyMeta.Firebird
{
#if ENTERPRISE
using System.Runtime.InteropServices;
[ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual), ComDefaultInterface(typeof(IColumns))]
#endif
public class FirebirdColumns : Columns
{
public FirebirdColumns()
{
}
internal DataColumn f_TypeName = null;
internal DataColumn f_TypeNameComplete = null;
override internal void LoadForTable()
{
try
{
FbConnection cn = new FirebirdSql.Data.FirebirdClient.FbConnection(this._dbRoot.ConnectionString);
cn.Open();
DataTable metaData = cn.GetSchema("Columns", new string[] { null, null, this.Table.Name });
DataColumn c;
if (!metaData.Columns.Contains("IS_AUTO_KEY")) { c = metaData.Columns.Add("IS_AUTO_KEY", typeof(Boolean)); c.DefaultValue = false; }
if (!metaData.Columns.Contains("AUTO_KEY_SEED")) { c = metaData.Columns.Add("AUTO_KEY_SEED"); c.DefaultValue = 0; }
if (!metaData.Columns.Contains("AUTO_KEY_INCREMENT")) { c = metaData.Columns.Add("AUTO_KEY_INCREMENT"); c.DefaultValue = 0; }
if (!metaData.Columns.Contains("AUTO_KEY_SEQUENCE")) { c = metaData.Columns.Add("AUTO_KEY_SEQUENCE"); c.DefaultValue = string.Empty; }
PopulateArray(metaData);
LoadExtraData(cn, this.Table.Name, "T");
cn.Close();
}
catch(Exception ex)
{
string m = ex.Message;
}
}
override internal void LoadForView()
{
try
{
FbConnection cn = new FirebirdSql.Data.FirebirdClient.FbConnection(this._dbRoot.ConnectionString);
cn.Open();
DataTable metaData = cn.GetSchema("Columns", new string[] {null, null, this.View.Name});
PopulateArray(metaData);
LoadExtraData(cn, this.View.Name, "V");
cn.Close();
}
catch(Exception ex)
{
string m = ex.Message;
}
}
private void LoadExtraData(FbConnection cn, string name, string type)
{
try
{
int dialect = 1;
object o = null;
short scale = 0;
try
{
FbConnectionStringBuilder cnString = new FbConnectionStringBuilder(cn.ConnectionString);
dialect = cnString.Dialect;
}
catch {}
// AutoKey Data
Dictionary<string, object[]> autoKeyFields = new Dictionary<string, object[]>();
DataTable triggers = cn.GetSchema("Triggers", new string[] {null, null, name});
foreach (DataRow row in triggers.Rows)
{
int isSystemTrigger = Convert.ToInt32(row["IS_SYSTEM_TRIGGER"]);
int isInactive = Convert.ToInt32(row["IS_INACTIVE"]);
int triggerType = Convert.ToInt32(row["TRIGGER_TYPE"]);
if ((isSystemTrigger == 0) && (isInactive == 0) && (triggerType == 1))
{
string source = row["SOURCE"].ToString();
int end = 0;
do
{
string field = null, generatorName = string.Empty;
int tmp, increment = 1, seed = 0;
end = source.IndexOf("gen_id(", end, StringComparison.CurrentCultureIgnoreCase);
if (end >= 0)
{
string s = source.Substring(0, end);
int start = s.LastIndexOf(".");
if (start >= 0 && start < end)
{
field = s.Substring(start).Trim(' ', '.', '=').ToUpper();
}
int end2 = source.IndexOf(")", end);
string s2 = source.Substring(0, end2);
int start2 = s2.LastIndexOf(",");
if (start2 >= 0 && start2 < end2)
{
if (int.TryParse(s2.Substring(start2 + 1).Trim(' ', ','), out tmp))
increment = tmp;
s2 = s2.Substring(0, start2);
generatorName = s2.Substring(end + 7).Trim();
}
if (field != null)
{
autoKeyFields[field] = new object[] { increment, seed, generatorName };
}
end += 7;
}
} while (end != -1);
}
}
string select = "select r.rdb$field_name, f.rdb$field_scale AS SCALE, f.rdb$computed_source AS IsComputed, f.rdb$field_type as FTYPE, f.rdb$field_sub_type AS SUBTYPE, f.rdb$dimensions AS DIM from rdb$relation_fields r, rdb$types t, rdb$fields f where r.rdb$relation_name='" + name + "' and f.rdb$field_name=r.rdb$field_source and t.rdb$field_name='RDB$FIELD_TYPE' and f.rdb$field_type=t.rdb$type order by r.rdb$field_position;";
// Column Data
FbDataAdapter adapter = new FbDataAdapter(select, cn);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
// Dimension Data
string dimSelect = "select r.rdb$field_name AS Name , d.rdb$dimension as DIM, d.rdb$lower_bound as L, d.rdb$upper_bound as U from rdb$fields f, rdb$field_dimensions d, rdb$relation_fields r where r.rdb$relation_name='" + name + "' and f.rdb$field_name = d.rdb$field_name and f.rdb$field_name=r.rdb$field_source order by d.rdb$dimension;";
FbDataAdapter dimAdapter = new FbDataAdapter(dimSelect, cn);
DataTable dimTable = new DataTable();
dimAdapter.Fill(dimTable);
if(this._array.Count > 0)
{
Column col = this._array[0] as Column;
f_TypeName = new DataColumn("TYPE_NAME", typeof(string));
col._row.Table.Columns.Add(f_TypeName);
f_TypeNameComplete = new DataColumn("TYPE_NAME_COMPLETE", typeof(string));
col._row.Table.Columns.Add(f_TypeNameComplete);
this.f_IsComputed = new DataColumn("IS_COMPUTED", typeof(bool));
col._row.Table.Columns.Add(f_IsComputed);
short ftype = 0;
short dim = 0;
DataRowCollection rows = dataTable.Rows;
int count = this._array.Count;
Column c = null;
for( int index = 0; index < count; index++)
{
c = (Column)this[index];
if (autoKeyFields.ContainsKey(c.Name.ToUpper()))
{
c._row["IS_AUTO_KEY"] = true;
c._row["AUTO_KEY_INCREMENT"] = autoKeyFields[c.Name][0];
c._row["AUTO_KEY_SEED"] = autoKeyFields[c.Name][1];
c._row["AUTO_KEY_SEQUENCE"] = autoKeyFields[c.Name][2];
}
if(!c._row.IsNull("DOMAIN_NAME"))
{
// Special Hack, if there is a domain
c._row["TYPE_NAME"] = c._row["DOMAIN_NAME"] as string;
c._row["TYPE_NAME_COMPLETE"] = c._row["DOMAIN_NAME"] as string;
o = rows[index]["IsComputed"];
if(o != DBNull.Value)
{
c._row["IS_COMPUTED"] = true;
}
scale = (short)rows[index]["SCALE"];
if(scale < 0)
{
c._row["NUMERIC_SCALE"] = Math.Abs(scale);
}
continue;
}
try
{
string bigint = c._row["COLUMN_DATA_TYPE"] as string;
if(bigint.ToUpper() == "BIGINT")
{
c._row["TYPE_NAME"] = "BIGINT";
c._row["TYPE_NAME_COMPLETE"] = "BIGINT";
continue;
}
}
catch {}
// public const int blr_text = 14;
// public const int blr_text2 = 15;
// public const int blr_short = 7;
// public const int blr_long = 8;
// public const int blr_quad = 9;
// public const int blr_int64 = 16;
// public const int blr_float = 10;
// public const int blr_double = 27;
// public const int blr_d_float = 11;
// public const int blr_timestamp = 35;
// public const int blr_varying = 37;
// public const int blr_varying2 = 38;
// public const int blr_blob = 261;
// public const int blr_cstring = 40;
// public const int blr_cstring2 = 41;
// public const int blr_blob_id = 45;
// public const int blr_sql_date = 12;
// public const int blr_sql_time = 13;
// Step 1: DataTypeName
ftype = (short)rows[index]["FTYPE"];
switch(ftype)
{
case 7:
c._row["TYPE_NAME"] = "SMALLINT";
break;
case 8:
c._row["TYPE_NAME"] = "INTEGER";
break;
case 9:
c._row["TYPE_NAME"] = "QUAD";
break;
case 10:
c._row["TYPE_NAME"] = "FLOAT";
break;
case 11:
c._row["TYPE_NAME"] = "DOUBLE PRECISION";
break;
case 12:
c._row["TYPE_NAME"] = "DATE";
break;
case 13:
c._row["TYPE_NAME"] = "TIME";
break;
case 14:
c._row["TYPE_NAME"] = "CHAR";
break;
case 16:
c._row["TYPE_NAME"] = "NUMERIC";
break;
case 27:
c._row["TYPE_NAME"] = "DOUBLE PRECISION";
break;
case 35:
if(dialect > 2)
{
c._row["TYPE_NAME"] = "TIMESTAMP";
}
else
{
c._row["TYPE_NAME"] = "DATE";
}
break;
case 37:
c._row["TYPE_NAME"] = "VARCHAR";
break;
case 40:
c._row["TYPE_NAME"] = "CSTRING";
break;
case 261:
short subtype = (short)rows[index]["SUBTYPE"];
switch(subtype)
{
case 0:
c._row["TYPE_NAME"] = "BLOB(BINARY)";
break;
case 1:
c._row["TYPE_NAME"] = "BLOB(TEXT)";
break;
default:
c._row["TYPE_NAME"] = "BLOB(UNKNOWN)";
break;
}
break;
}
scale = (short)rows[index]["SCALE"];
if(scale < 0)
{
c._row["TYPE_NAME"] = "NUMERIC";
c._row["NUMERIC_SCALE"] = Math.Abs(scale);
}
o = rows[index]["IsComputed"];
if(o != DBNull.Value)
{
c._row["IS_COMPUTED"] = true;
}
// Step 2: DataTypeNameComplete
string s = c._row["TYPE_NAME"] as string;
switch(s)
{
case "VARCHAR":
case "CHAR":
c._row["TYPE_NAME_COMPLETE"] = s + "(" + c.CharacterMaxLength + ")";
break;
case "NUMERIC":
switch((int)c._row["COLUMN_SIZE"])
{
case 2:
c._row["TYPE_NAME_COMPLETE"] = s + "(4, " + c.NumericScale.ToString() + ")";
break;
case 4:
c._row["TYPE_NAME_COMPLETE"] = s + "(9, " + c.NumericScale.ToString() + ")";
break;
case 8:
c._row["TYPE_NAME_COMPLETE"] = s + "(15, " + c.NumericScale.ToString() + ")";
break;
default:
c._row["TYPE_NAME_COMPLETE"] = "NUMERIC(18,0)";
break;
}
break;
case "BLOB(TEXT)":
case "BLOB(BINARY)":
c._row["TYPE_NAME_COMPLETE"] = "BLOB";
break;
default:
c._row["TYPE_NAME_COMPLETE"] = s;
break;
}
s = c._row["TYPE_NAME_COMPLETE"] as string;
dim = 0;
o = rows[index]["DIM"];
if(o != DBNull.Value)
{
dim = (short)o;
}
if(dim > 0)
{
dimTable.DefaultView.RowFilter = "Name = '" + c.Name + "'";
dimTable.DefaultView.Sort = "DIM";
string a = "[";
bool bFirst = true;
foreach(DataRowView vrow in dimTable.DefaultView)
{
DataRow row = vrow.Row;
if(!bFirst) a += ",";
a += row["L"].ToString() + ":" + row["U"].ToString();
bFirst = false;
}
a += "]";
c._row["TYPE_NAME_COMPLETE"] = s + a;
c._row["TYPE_NAME"] = c._row["TYPE_NAME"] + ":A";
}
}
}
}
catch(Exception ex)
{
string e = ex.Message;
}
}
//function ibfieldtypetosource(value:integer;size:integer;scale:integer;dialect:integer):string;
//begin
// case value of
// 7:
// Result:='SMALLINT';
// 8:
// Result:='INTEGER';
// 9:
// Result:='QUAD';
// 10:
// Result:='FLOAT';
// 11:
// Result:='DOUBLE PRECISION';
// 12:
// Result:='DATE';
// 13:
// Result:='TIME';
// 14:
// Result:='CHAR('+inttostr(size)+')';
// 16:
// // INT64
// Result:='NUMERIC';
// 27:
// Result:='DOUBLE PRECISION';
// 35:
// if Dialect>2 then
// Result:='TIMESTAMP'
// else
// Result:='DATE';
// 37:
// Result:='VARCHAR('+inttostr(size)+')';
// 40:
// Result:='CSTRING('+inttostr(size)+')';
// 261:
// begin
// Result:='BLOB';
// end;
// else
// Result:='';
// end;
// if scale<0 then
// begin
// Result:='NUMERIC';
// case size of
// 2:
// REsult:=Result+'('+Inttostr(4)+','+inttostr(-scale)+')';
// 4:
// REsult:=Result+'('+Inttostr(9)+','+inttostr(-scale)+')';
// 8:
// begin
// if dialect=1 then
// REsult:=Result+'('+Inttostr(15)+','+inttostr(-scale)+')'
// else
// REsult:=Result+'('+Inttostr(18)+','+inttostr(-scale)+')'
// end;
// else
// REsult:=Result+'('+Inttostr(15)+','+inttostr(-scale)+')';
// end;
// end
// else
// begin
// if Result='NUMERIC' then
// Result:='NUMERIC(18,0)';
// end;
//end;
}
}
// Fills the IBAccess Fields Grid on the table definition
//procedure Filldatasetwithdomainsinfo(base:TIBDatabase;viewsystem:boolean;data:TDataset;fprogres:TFFetching);
//var
// Tran1:TIBTransaction;
// QDomain:TIBSQL;
// QSearch:TIBSQL;
// dinfo:TIBDefDomain;
//begin
// Tran1:=TIBTransaction.create(Application);
// try
// tran1.DefaultDatabase:=base;
// QDomain:=TIBSQL.Create(Application);
// QSearch:=TIBSQL.Create(Application);
// try
// QSearch.database:=base;
// QSearch.transaction:=tran1;
// QDomain.database:=base;
// QDomain.transaction:=tran1;
// tran1.StartTransaction;
// try
// QDomain.SQL.TExt:='SELECT RDB$FIELD_NAME DOMINI,RDB$VALIDATION_SOURCE VALIDA,RDB$COMPUTED_SOURCE CALCULA,'+
// 'RDB$DEFAULT_SOURCE OMISION,RDB$FIELD_LENGTH TAMANY,RDB$SEGMENT_LENGTH SEGLEN,'+
// 'RDB$FIELD_SCALE ESCALA,RDB$NULL_FLAG NONULO,'+
// 'RDB$CHARACTER_SET_ID CHARSET,RDB$COLLATION_ID ORDRE,'+
// 'RDB$FIELD_TYPE TIPO,RDB$FIELD_SUB_TYPE SUBTIPO,'+
// 'RDB$DIMENSIONS DIMENSIO,RDB$CHARACTER_LENGTH CHARLEN'+
// ' FROM RDB$FIELDS ';
// if Not viewsystem then
// QDomain.SQL.TExt:=QDomain.SQL.TExt+' WHERE ( (RDB$SYSTEM_FLAG=0) or (RDB$SYSTEM_FLAG IS NULL) ) ';
// QDomain.SQL.TExt:=QDomain.SQL.TExt+'ORDER BY 1';
// QDomain.ExecQuery;
// try
// While Not QDomain.EOF do
// begin
// dinfo:=FillDomainFromQuerys(QDomain,QSearch,base.sqldialect,fprogres);
// data.Append;
// try
// data.FieldByName('FIELDNAME').Value:=dinfo.name;
// data.FieldByName('DESCRIP').Value:=ibfieldtypetosource(dinfo.basetype,dinfo.size,dinfo.scale,base.sqldialect)
// +dinfo.arraysource;
// if dinfo.Notnull then
// data.FieldByName('NULLS').Value:=SRpNo
// else
// data.FieldByName('NULLS').Value:=SRpYes;
// data.FieldByName('CHECK').Value:=dinfo.check;
// data.FieldByName('DEFAULT').Value:=dinfo.default;
// data.FieldByName('COMPUTED').Value:=dinfo.computed;
// data.FieldByName('CHARACTER_SET').Value:=dinfo.character_set;
// data.FieldByName('COLLATION').Value:=dinfo.collation;
// data.FieldByName('SUBTYPE').Value:=dinfo.subtype;
// data.FieldByName('SEGSIZE').Value:=dinfo.segmentsize;
// data.FieldByName('SIZEBYTES').Value:=dinfo.sizebytes;
// data.post;
// except
// data.cancel;
// raise;
// end;
// QDomain.Next;
// if assigned(fprogres)then
// begin
// fprogres.IncFetch(1);
// end;
// end;
// finally
// QDomain.CLose;
// end;
// tran1.commitretaining;
// except
// tran1.rollback;
// raise;
// end;
// finally
// QSearch.free;
// QDomain.free;
// end;
// finally
// tran1.free;
// end;
//end;
//
//function ibfieldtypetosource(value:integer;size:integer;scale:integer;dialect:integer):string;
//begin
// case value of
// 7:
// Result:='SMALLINT';
// 8:
// Result:='INTEGER';
// 9:
// Result:='QUAD';
// 10:
// Result:='FLOAT';
// 11:
// Result:='DOUBLE PRECISION';
// 12:
// Result:='DATE';
// 13:
// Result:='TIME';
// 14:
// Result:='CHAR('+inttostr(size)+')';
// 16:
// // INT64
// Result:='NUMERIC';
// 27:
// Result:='DOUBLE PRECISION';
// 35:
// if Dialect>2 then
// Result:='TIMESTAMP'
// else
// Result:='DATE';
// 37:
// Result:='VARCHAR('+inttostr(size)+')';
// 40:
// Result:='CSTRING('+inttostr(size)+')';
// 261:
// begin
// Result:='BLOB';
// end;
// else
// Result:='';
// end;
// if scale<0 then
// begin
// Result:='NUMERIC';
// case size of
// 2:
// REsult:=Result+'('+Inttostr(4)+','+inttostr(-scale)+')';
// 4:
// REsult:=Result+'('+Inttostr(9)+','+inttostr(-scale)+')';
// 8:
// begin
// if dialect=1 then
// REsult:=Result+'('+Inttostr(15)+','+inttostr(-scale)+')'
// else
// REsult:=Result+'('+Inttostr(18)+','+inttostr(-scale)+')'
// end;
// else
// REsult:=Result+'('+Inttostr(15)+','+inttostr(-scale)+')';
// end;
// end
// else
// begin
// if Result='NUMERIC' then
// Result:='NUMERIC(18,0)';
// end;
//end;
//
//function ibfieldtypetostringtype(value:integer;scale:integer;dialect:integer):string;
//begin
// case value of
// 7:
// Result:='SMALLINT';
// 8:
// Result:='INTEGER';
// 9:
// Result:='QUAD';
// 10:
// Result:='FLOAT';
// 11:
// Result:='DOUBLE PRECISION';
// 12:
// Result:='DATE';
// 13:
// Result:='TIME';
// 14:
// Result:='CHAR';
// 16:
// // INT64
// Result:='NUMERIC';
// 27:
// Result:='DOUBLE PRECISION';
// 35:
// if Dialect>2 then
// Result:='TIMESTAMP'
// else
// Result:='DATE';
// 37:
// Result:='VARCHAR';
// 40:
// Result:='CSTRING';
// 261:
// begin
// Result:='BLOB';
// end;
// else
// Result:='';
// end;
// if scale<0 then
// result:='NUMERIC';
//end;
//
//function ibfieldtypetosourcescale(value:integer;size:integer;scale:integer;var precision,precscale:variant;dialect:integer):string;
//begin
// precision:=null;
// precscale:=null;
// case value of
// 7:
// Result:='SMALLINT';
// 8:
// Result:='INTEGER';
// 9:
// Result:='QUAD';
// 10:
// Result:='FLOAT';
// 11:
// Result:='DOUBLE PRECISION';
// 12:
// Result:='DATE';
// 13:
// Result:='TIME';
// 14:
// begin
// Result:='CHAR';
// end;
// 16:
// // INT64
// Result:='NUMERIC';
// 27:
// Result:='DOUBLE PRECISION';
// 35:
// if Dialect>2 then
// Result:='TIMESTAMP'
// else
// Result:='DATE';
// 37:
// begin
// Result:='VARCHAR';
// end;
// 40:
// begin
// Result:='CSTRING';
// end;
// 261:
// begin
// Result:='BLOB';
// end;
// else
// Result:='';
// end;
// if scale<0 then
// begin
// Result:='NUMERIC';
// case size of
// 2:
// begin
// precision:=4;
// precscale:=-scale;
// end;
// 4:
// begin
// precision:=9;
// precscale:=-scale;
// end;
// 8:
// begin
// if dialect=1 then
// precision:=15
// else
// precision:=18;
// precscale:=-scale;
// end;
// else
// begin
// precision:=15;
// precscale:=-scale;
// end;
// end;
// end
// else
// begin
// if Result='NUMERIC' then
// Result:='NUMERIC(18,0)';
// end;
//end;
| 26.490013
| 444
| 0.533276
|
[
"BSD-3-Clause"
] |
cafephin/mygeneration
|
src/mymeta/Firebird/Columns.cs
| 19,894
|
C#
|
using Paxstore.OpenApi.Base.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Paxstore.OpenApi.Model
{
public class PushFirmwareTaskPageResponse : PageResponse<PushFirmwareTaskInfo>
{
}
}
| 20.214286
| 82
| 0.784452
|
[
"Apache-2.0"
] |
PAXSTORE/paxstore-openapi-dotnet-sdk
|
PaxstoreOpenApi/Paxstore/OpenApi/Model/TerminalFirmware/PushFirmwareTaskPageResponse.cs
| 285
|
C#
|
using System.Windows.Controls;
using System.Windows.Input;
using ClojureExtension.Utilities;
namespace ClojureExtension.Repl
{
public class InputKeyHandler
{
private readonly TextBox _interactiveTextBox;
private readonly KeyboardExaminer _keyboardExaminer;
private readonly Entity<ReplState> _replEntity;
private readonly ReplWriter _replWriter;
public InputKeyHandler(KeyboardExaminer keyboardExaminer, Entity<ReplState> replEntity, TextBox interactiveTextBox, ReplWriter replWriter)
{
_keyboardExaminer = keyboardExaminer;
_replEntity = replEntity;
_replWriter = replWriter;
_interactiveTextBox = interactiveTextBox;
}
public void PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (_interactiveTextBox.CaretIndex < _replEntity.CurrentState.PromptPosition) e.Handled = true;
}
public void PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter && !_keyboardExaminer.IsShiftDown() && _interactiveTextBox.CaretIndex >= _replEntity.CurrentState.PromptPosition)
{
string userInput = _interactiveTextBox.Text.Substring(_replEntity.CurrentState.PromptPosition);
_replWriter.WriteExpressionToRepl(userInput);
return;
}
if (_interactiveTextBox.CaretIndex > _replEntity.CurrentState.PromptPosition && e.Key == Key.Home && !_keyboardExaminer.IsShiftDown())
{
_interactiveTextBox.CaretIndex = _replEntity.CurrentState.PromptPosition;
e.Handled = true;
return;
}
if (_interactiveTextBox.CaretIndex > _replEntity.CurrentState.PromptPosition && e.Key == Key.Home && _keyboardExaminer.IsShiftDown())
{
_interactiveTextBox.Select(_replEntity.CurrentState.PromptPosition, _interactiveTextBox.CaretIndex - _replEntity.CurrentState.PromptPosition + _interactiveTextBox.SelectionLength);
e.Handled = true;
return;
}
if (_keyboardExaminer.IsArrowKey(e.Key)) return;
if (e.Key == Key.Home || e.Key == Key.End || e.Key == Key.PageUp || e.Key == Key.PageDown) return;
if (_interactiveTextBox.CaretIndex < _replEntity.CurrentState.PromptPosition) e.Handled = true;
if (_interactiveTextBox.CaretIndex == _replEntity.CurrentState.PromptPosition && e.Key == Key.Back)
{
_interactiveTextBox.Text = _interactiveTextBox.Text.Remove(_interactiveTextBox.SelectionStart, _interactiveTextBox.SelectionLength);
_interactiveTextBox.CaretIndex = _replEntity.CurrentState.PromptPosition;
e.Handled = true;
}
}
}
}
| 40.532258
| 185
| 0.754477
|
[
"MIT"
] |
ragnard/vsClojure
|
ClojureExtension.Repl/InputKeyHandler.cs
| 2,515
|
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 workspaces-2015-04-08.normal.json service model.
*/
using System;
using Amazon.Runtime;
using Amazon.Util.Internal;
namespace Amazon.WorkSpaces
{
/// <summary>
/// Configuration for accessing Amazon WorkSpaces service
/// </summary>
public partial class AmazonWorkSpacesConfig : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("3.3.108.19");
private string _userAgent = UserAgentString;
/// <summary>
/// Default constructor
/// </summary>
public AmazonWorkSpacesConfig()
{
this.AuthenticationServiceName = "workspaces";
}
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return "workspaces";
}
}
/// <summary>
/// Gets the ServiceVersion property.
/// </summary>
public override string ServiceVersion
{
get
{
return "2015-04-08";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
}
}
| 26.3
| 108
| 0.589829
|
[
"Apache-2.0"
] |
Vfialkin/aws-sdk-net
|
sdk/src/Services/WorkSpaces/Generated/AmazonWorkSpacesConfig.cs
| 2,104
|
C#
|
using Microsoft.Extensions.Configuration;
namespace et12.edu.ar.AGBD.Ado
{
/// <summary>
/// Clase que abstrae de la creación de la conexión de <c>AdoAGBD</c>
/// </summary>
public static class FactoryAdoAGBD
{
/// <summary>
/// Método que devuelve una instancia de <c>AdoAGBD</c>
/// </summary>
/// <param name="cadena">Cadena de conexión plana</param>
/// <returns>Instancia de <c>AdoAGBD</c></returns>
public static AdoAGBD GetAdoMySQL(string cadena)
=> new AdoAGBD(cadena);
/// <summary>
/// Método que devuelve una instancia de <c>AdoAGBD</c>.
/// </summary>
/// <param name="archivo">Archivo <c>.json</c> con ruta.</param>
/// <param name="nombreConexion">Nombre de la conexión.</param>
/// <returns>Instancia de <c>AdoAGBD</c></returns>
public static AdoAGBD GetAdoMySQL(string archivo, string nombreConexion)
{
IConfiguration config = new ConfigurationBuilder()
.AddJsonFile(archivo, optional: true, reloadOnChange: true)
.Build();
string cadena = config.GetConnectionString(nombreConexion);
return new AdoAGBD(cadena);
}
}
}
| 38.181818
| 80
| 0.596032
|
[
"MIT"
] |
ET12DE1Computacion/AGBD-Ado
|
AGBD/Ado/FactoryAdoAGBD.cs
| 1,268
|
C#
|
namespace Mapbox.Editor
{
using UnityEngine;
using UnityEditor;
using Mapbox.Unity.MeshGeneration.Factories;
[CustomEditor(typeof(FlatTerrainFactory))]
public class FlatTerrainFactoryEditor : FactoryEditor
{
public SerializedProperty
material_Prop,
collider_Prop,
addLayer_Prop,
layerId_Prop;
private MonoScript script;
void OnEnable()
{
material_Prop = serializedObject.FindProperty("_baseMaterial");
collider_Prop = serializedObject.FindProperty("_addCollider");
addLayer_Prop = serializedObject.FindProperty("_addToLayer");
layerId_Prop = serializedObject.FindProperty("_layerId");
script = MonoScript.FromScriptableObject((FlatTerrainFactory)target);
}
public override void OnInspectorGUI()
{
serializedObject.Update();
script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript;
EditorGUILayout.Space();
EditorGUILayout.PropertyField(material_Prop, new GUIContent("Material"));
EditorGUILayout.Space();
collider_Prop.boolValue = EditorGUILayout.Toggle("Add Collider", collider_Prop.boolValue);
EditorGUILayout.Space();
addLayer_Prop.boolValue = EditorGUILayout.Toggle("Add To Layer", addLayer_Prop.boolValue);
if (addLayer_Prop.boolValue)
{
layerId_Prop.intValue = EditorGUILayout.LayerField("Layer", layerId_Prop.intValue);
}
serializedObject.ApplyModifiedProperties();
}
}
}
| 30.76087
| 99
| 0.770318
|
[
"MIT"
] |
MGM-HUD-Hackathon/HelloMapBox
|
Assets/Mapbox/Unity/Editor/FlatTerrainFactoryEditor.cs
| 1,417
|
C#
|
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using Elastic.Xunit.XunitPlumbing;
using Nest;
using System.ComponentModel;
namespace Examples.Analysis.Tokenfilters
{
public class EdgengramTokenfilterPage : ExampleBase
{
[U(Skip = "Example not implemented")]
[Description("analysis/tokenfilters/edgengram-tokenfilter.asciidoc:34")]
public void Line34()
{
// tag::6dbfe5565a95508e65d304131847f9fc[]
var response0 = new SearchResponse<object>();
// end::6dbfe5565a95508e65d304131847f9fc[]
response0.MatchesExample(@"GET _analyze
{
""tokenizer"": ""standard"",
""filter"": [
{ ""type"": ""edge_ngram"",
""min_gram"": 1,
""max_gram"": 2
}
],
""text"": ""the quick brown fox jumps""
}");
}
[U(Skip = "Example not implemented")]
[Description("analysis/tokenfilters/edgengram-tokenfilter.asciidoc:143")]
public void Line143()
{
// tag::16351d99d0608789d04a0bb11a537098[]
var response0 = new SearchResponse<object>();
// end::16351d99d0608789d04a0bb11a537098[]
response0.MatchesExample(@"PUT edge_ngram_example
{
""settings"": {
""analysis"": {
""analyzer"": {
""standard_edge_ngram"": {
""tokenizer"": ""standard"",
""filter"": [ ""edge_ngram"" ]
}
}
}
}
}");
}
[U(Skip = "Example not implemented")]
[Description("analysis/tokenfilters/edgengram-tokenfilter.asciidoc:199")]
public void Line199()
{
// tag::6f07152055e99416deb10e95b428b847[]
var response0 = new SearchResponse<object>();
// end::6f07152055e99416deb10e95b428b847[]
response0.MatchesExample(@"PUT edge_ngram_custom_example
{
""settings"": {
""analysis"": {
""analyzer"": {
""default"": {
""tokenizer"": ""whitespace"",
""filter"": [ ""3_5_edgegrams"" ]
}
},
""filter"": {
""3_5_edgegrams"": {
""type"": ""edge_ngram"",
""min_gram"": 3,
""max_gram"": 5
}
}
}
}
}");
}
}
}
| 26.310345
| 76
| 0.584972
|
[
"Apache-2.0"
] |
magaum/elasticsearch-net
|
tests/Examples/Analysis/Tokenfilters/EdgengramTokenfilterPage.cs
| 2,289
|
C#
|
using UnityEngine;
using UnityEngine.EventSystems;
using Utility.Manager.EventArgs;
using Utility.Manager.Type;
using Utility.System.Publisher_Subscriber_System;
namespace Utility.Manager
{
public class InputManager : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler
{
private float animspeed;
private Ray cameraRay;
private Vector3 currentPositionVector;
#pragma warning disable 649
[SerializeField] private LayerMask hitMask;
#pragma warning restore 649
private Vector3 initialPositionVector;
private InputEventArgs inputEventArgs;
[SerializeField] private Camera mainCamera;
private Vector3 positionDeltaVector;
private RaycastHit raycastHit;
public void OnDrag(PointerEventData eventData)
{
cameraRay = mainCamera.ScreenPointToRay(eventData.position);
if (!Physics.Raycast(cameraRay, out raycastHit, Mathf.Infinity, hitMask)) return;
currentPositionVector = raycastHit.point;
positionDeltaVector = currentPositionVector - initialPositionVector;
initialPositionVector = currentPositionVector;
inputEventArgs = new InputEventArgs
{
InputState = InputState.Drag,
CurrentWorldPosition = currentPositionVector,
Delta = positionDeltaVector,
magnitude = eventData.delta.magnitude
};
PublisherSubscriber.Publish(inputEventArgs);
}
public void OnPointerDown(PointerEventData eventData)
{
cameraRay = mainCamera.ScreenPointToRay(eventData.position);
if (!Physics.Raycast(cameraRay, out raycastHit, Mathf.Infinity, hitMask)) return;
initialPositionVector = raycastHit.point;
PublisherSubscriber.Publish(new InputEventArgs
{
InputState = InputState.Down,
CurrentWorldPosition = initialPositionVector,
Delta = Vector3.zero
});
}
public void OnPointerUp(PointerEventData eventData)
{
PublisherSubscriber.Publish(new InputEventArgs {InputState = InputState.Up});
}
private void OnValidate()
{
if (mainCamera == null) mainCamera = Camera.main;
}
}
}
| 35.772727
| 99
| 0.657349
|
[
"MIT"
] |
punsal/HexFall-Clone
|
Assets/Scripts/Utility/Manager/InputManager.cs
| 2,363
|
C#
|
using NationalInstruments.CommonModel;
using NationalInstruments.DataTypes;
using NationalInstruments.Dfir;
using Rebar.Common;
namespace Rebar.Compiler.Nodes
{
/// <summary>
/// Represents a node that will output references in a common lifetime from its inputs. The <see cref="AlwaysBeginLifetime"/>
/// and <see cref="AlwaysCreateReference"/> properties govern the content and lifetime of the output references.
/// </summary>
internal class ExplicitBorrowNode : DfirNode
{
public ExplicitBorrowNode(Node parentNode, BorrowMode borrowMode, int inputs, bool alwaysBeginLifetime, bool alwaysCreateReference)
: base(parentNode)
{
BorrowMode = borrowMode;
AlwaysBeginLifetime = alwaysBeginLifetime;
AlwaysCreateReference = alwaysCreateReference;
NIType inputType = NITypes.Void, outputType;
switch (borrowMode)
{
case BorrowMode.Mutable:
outputType = NITypes.Void.CreateMutableReference();
break;
default:
outputType = NITypes.Void.CreateImmutableReference();
break;
}
for (int i = 0; i < inputs; ++i)
{
CreateTerminal(Direction.Input, inputType, $"in_{i}");
}
for (int i = 0; i < inputs; ++i)
{
CreateTerminal(Direction.Output, outputType, $"out_{i}");
}
}
private ExplicitBorrowNode(Node parentNode, ExplicitBorrowNode copyFrom, NodeCopyInfo copyInfo)
: base(parentNode, copyFrom, copyInfo)
{
BorrowMode = copyFrom.BorrowMode;
AlwaysBeginLifetime = copyFrom.AlwaysBeginLifetime;
AlwaysCreateReference = copyFrom.AlwaysCreateReference;
}
/// <summary>
/// The <see cref="BorrowMode"/> with which to create the output references.
/// </summary>
public BorrowMode BorrowMode { get; }
/// <summary>
/// Whether to begin a new lifetime unconditionally for the outputs.
/// If true, or if false and the inputs are not already in a common bounded lifetime:
/// the outputs will be in a new common diagram-bounded lifetime that interrupts each of the inputs.
/// Otherwise:
/// the outputs will be in the common lifetime of the inputs.
/// </summary>
public bool AlwaysBeginLifetime { get; }
/// <summary>
/// Whether to create references to the inputs unconditionally.
/// If true, each output will be a reference to its input.
/// If false, each output will be the same reference as its input if its input is a reference, and otherwise a reference to its input.
/// </summary>
public bool AlwaysCreateReference { get; }
protected override Node CopyNodeInto(Node newParentNode, NodeCopyInfo copyInfo)
{
return new ExplicitBorrowNode(newParentNode, this, copyInfo);
}
/// <inheritdoc />
public override T AcceptVisitor<T>(IDfirNodeVisitor<T> visitor)
{
return visitor.VisitExplicitBorrowNode(this);
}
}
}
| 40.419753
| 142
| 0.613317
|
[
"MIT"
] |
ni/rebar
|
src/Rebar/Compiler/Nodes/ExplicitBorrowNode.cs
| 3,276
|
C#
|
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ContosoUniversity.Models
{
public class Course
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Display(Name = "Number")]
public int CourseID { get; set; }
[StringLength(50, MinimumLength = 3)]
public string Title { get; set; }
[Range(0, 5)]
public int Credits { get; set; }
public int DepartmentID { get; set; }
public Department Department { get; set; }
public ICollection<Enrollment> Enrollments { get; set; }
public ICollection<CourseAssignment> CourseAssignments { get; set; }
}
}
| 27.333333
| 76
| 0.659892
|
[
"MIT"
] |
AllaHINDIR/GestionPFE
|
ContosoUniversity/Models/Course.cs
| 740
|
C#
|
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
[assembly: AssemblyVersion("2015.0.0.0")]
[assembly: AssemblyFileVersion("2015.0.0.0")]
[assembly: AssemblyCompany("Autodesk, Inc.")]
[assembly: AssemblyProduct("Autodesk Revit")]
[assembly: AssemblyCopyright("Copyright (c) 2014 Autodesk, Inc. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyTitle("AddInManager")]
[assembly: AssemblyDescription("AddInManager Support Revit API")]
[assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
| 38.055556
| 87
| 0.785401
|
[
"MIT"
] |
ricaun/RevitAddInManager
|
src/AddInManager/Properties/AssemblyInfo.cs
| 687
|
C#
|
using UnityEngine;
namespace HoloToolkit.Sharing
{
public class SharingStage : MonoBehaviour
{
public static SharingStage Instance = null;
/// <summary>
/// Set whether this app should be a Primary or Secondary client.
/// Primary: Connects directly to the Session Server, can create/join/leave sessions
/// Secondary: Connects to a Primary client. Cannot do any session management
/// </summary>
public ClientRole ClientRole = ClientRole.Primary;
public string ServerAddress = "localhost";
public int ServerPort = 20602;
private SharingManager sharingMgr;
public SharingManager Manager { get { return this.sharingMgr; } }
/// <summary>
/// Set whether this app should provide audio input / output features.
/// </summary>
public bool IsAudioEndpoint = true;
/// <summary>
/// Pipes XTools console output to Unity's output window for debugging
/// </summary>
private ConsoleLogWriter logWriter;
private void Awake()
{
Instance = this;
this.logWriter = new ConsoleLogWriter();
ClientConfig config = new ClientConfig(this.ClientRole);
config.SetIsAudioEndpoint(this.IsAudioEndpoint);
config.SetLogWriter(this.logWriter);
config.SetServerAddress(this.ServerAddress);
config.SetServerPort(this.ServerPort);
this.sharingMgr = SharingManager.Create(config);
}
protected void OnDestroy()
{
Instance = null;
// Force a disconnection so that we can stop and start Unity without connections hanging around
this.sharingMgr.GetPairedConnection().Disconnect();
this.sharingMgr.GetServerConnection().Disconnect();
// Release the XTools manager so that it cleans up the C++ copy
this.sharingMgr.Dispose();
this.sharingMgr = null;
// Forces a garbage collection to try to clean up any additional reference to SWIG-wrapped objects
System.GC.Collect();
}
private void LateUpdate()
{
if (this.sharingMgr != null)
{
// Update the XToolsManager to processes any network messages that have arrived
this.sharingMgr.Update();
}
}
private void OnEnable()
{
Application.logMessageReceived += HandleLog;
}
private void OnDisable()
{
Application.logMessageReceived -= HandleLog;
}
void HandleLog(string logString, string stackTrace, LogType type)
{
switch (type)
{
case LogType.Error:
case LogType.Assert:
case LogType.Exception:
Log.Error(string.Format("{0} \n {1}", logString, stackTrace));
break;
case LogType.Warning:
Log.Warning(string.Format("{0} \n {1}", logString, stackTrace));
break;
case LogType.Log:
default:
Log.Info(logString);
break;
}
}
}
}
| 32.097087
| 110
| 0.567453
|
[
"MIT"
] |
gomez-addams/HoloLens-Samples
|
Unity/TransparentObject/Assets/HoloToolkit/Sharing/Scripts/SharingStage.cs
| 3,308
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using VPX.BusinessLogic.Core.Contracts.Groups;
using Microsoft.EntityFrameworkCore;
using VPX.ApiModels;
using VPX.BusinessLogic.Mappings.Users;
using VPX.DataAccess.Core.Contracts;
using VPX.Domain;
namespace VPX.BusinessLogic.Services.Groups
{
public class GroupService : IGroupService
{
private readonly IAppEntityRepository<StudyGroup> groupsRepository;
private readonly IAppEntityRepository<User> usersRepository;
private readonly IDataContext dataContext;
public GroupService(IAppEntityRepository<StudyGroup> groupsRepository,
IAppEntityRepository<User> usersRepository,
IDataContext dataContext)
{
this.groupsRepository = groupsRepository;
this.usersRepository = usersRepository;
this.dataContext = dataContext;
}
public async Task<GroupModel> Create(string name)
{
var group = new StudyGroup { Name = name };
groupsRepository.Add(group);
await dataContext.SaveChangesAsync();
return new GroupModel
{
Id = group.Id,
Name = group.Name,
CreatedAt = group.CreatedAt,
ModifiedAt = group.ModifiedAt,
Users = Enumerable.Empty<UserModel>().ToList()
};
}
public async Task<List<GroupModel>> GetAllSimple()
{
var groups = await groupsRepository.GetQuery().ToListAsync();
return groups
.Select(x => new GroupModel
{
Id = x.Id,
Name = x.Name,
CreatedAt = x.CreatedAt,
ModifiedAt = x.ModifiedAt,
Users = x.Users.Select(UserMap.Map)
.OrderBy(x => x.LastName)
.ThenBy(x => x.FirstName)
.ToList()
})
.ToList();
}
public async Task<GroupModel> GetSimple(Guid id)
{
var group = await groupsRepository.GetQuery().FirstOrDefaultAsync(x => x.Id == id);
return new GroupModel
{
Id = group.Id,
Name = group.Name,
CreatedAt = group.CreatedAt,
ModifiedAt = group.ModifiedAt,
Users = group.Users.Select(UserMap.Map).ToList()
};
}
public async Task Update(UpdateGroupModel model)
{
var group = await groupsRepository.GetQuery().FirstAsync(x => x.Id == model.Id);
if (group != null)
{
group.Name = model.Name;
foreach (var user in await usersRepository.GetQuery().ToListAsync())
{
user.GroupId = null;
if (model.Users != null && model.Users.Contains(user.Id))
{
user.GroupId = group.Id;
}
}
await dataContext.SaveChangesAsync();
}
}
}
}
| 32.237624
| 95
| 0.52672
|
[
"MIT"
] |
VadimProkopchuk/JML
|
src/VPX.BusinessLogic/Services/Groups/GroupService.cs
| 3,258
|
C#
|
using System;
using Newtonsoft.Json;
using Xrpl.Client.Json.Converters;
namespace Xrpl.Client.Model.Ledger.Objects
{
public class PayChannelLedgerObject : BaseRippleLedgerObject
{
public PayChannelLedgerObject()
{
LedgerEntryType = LedgerEntryType.PayChannel;
}
public uint Flags { get; set; }
public string Account { get; set; }
public string Destination { get; set; }
public string Amount { get; set; }
public string Balance { get; set; }
public string PublicKey { get; set; }
public uint SettleDelay { get; set; }
public string OwnerNode { get; set; }
[JsonProperty("PreviousTxnID")]
public string PreviousTransactionId { get; set; }
[JsonProperty("PreviousTxnLgrSeq")]
public uint PreviousTransactionLedgerSequence { get; set; }
[JsonConverter(typeof(RippleDateTimeConverter))]
public DateTime? Expiration { get; set; }
[JsonConverter(typeof(RippleDateTimeConverter))]
public DateTime? CancelAfter { get; set; }
public uint SourceTag { get; set; }
public uint DestinationTag { get; set; }
}
}
| 25.638298
| 67
| 0.635685
|
[
"Apache-2.0"
] |
CASL-AE/Xrpl.C
|
Xrpl.C/Xrpl/Client/Model/Ledger/Objects/PayChannelLedgerObject.cs
| 1,207
|
C#
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UperoleiaMimula.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
// <summary>
// This is a frog recognizer based on the "ribit" or "washboard" template
// It detects ribit type calls by extracting three features: dominant frequency, pulse rate and pulse train duration.
// This type recognizer was first developed for the Canetoad and has been duplicated with modification for other frogs
// To call this recognizer, the first command line argument must be "EventRecognizer".
// Alternatively, this recognizer can be called via the MultiRecognizer.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace AnalysisPrograms.Recognizers
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Acoustics.Shared;
using Acoustics.Shared.ConfigFile;
using AnalysisBase;
using AnalysisBase.ResultBases;
using AnalysisPrograms.Recognizers.Base;
using AudioAnalysisTools;
using AudioAnalysisTools.DSP;
using AudioAnalysisTools.Indices;
using AudioAnalysisTools.StandardSpectrograms;
using AudioAnalysisTools.WavTools;
using log4net;
using SixLabors.ImageSharp;
using TowseyLibrary;
using Path = System.IO.Path;
/// <summary>
/// This is a frog recognizer based on the "ribit" or "washboard" template
/// It detects ribit type calls by extracting three features: dominant frequency, pulse rate and pulse train duration.
///
/// This type recognizer was first developed for the Canetoad and has been duplicated with modification for other frogs
/// To call this recognizer, the first command line argument must be "EventRecognizer".
/// Alternatively, this recognizer can be called via the MultiRecognizer.
///
/// </summary>
internal class UperoleiaMimula : RecognizerBase
{
public override string Description => "[ALPHA/EMBRYONIC] Detects acoustic events of Uperoleia mimula.";
public override string Author => "Towsey";
public override string SpeciesName => "UperoleiaMimula";
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Summarize your results. This method is invoked exactly once per original file.
/// </summary>
public override void SummariseResults(
AnalysisSettings settings,
FileSegment inputFileSegment,
EventBase[] events,
SummaryIndexBase[] indices,
SpectralIndexBase[] spectralIndices,
AnalysisResult2[] results)
{
// No operation - do nothing. Feel free to add your own logic.
base.SummariseResults(settings, inputFileSegment, events, indices, spectralIndices, results);
}
/// <summary>
/// Do your analysis. This method is called once per segment (typically one-minute segments).
/// </summary>
public override RecognizerResults Recognize(AudioRecording recording, Config configuration, TimeSpan segmentStartOffset, Lazy<IndexCalculateResult[]> getSpectralIndexes, DirectoryInfo outputDirectory, int? imageWidth)
{
string speciesName = configuration[AnalysisKeys.SpeciesName] ?? "<no species>";
string abbreviatedSpeciesName = configuration[AnalysisKeys.AbbreviatedSpeciesName] ?? "<no.sp>";
int minHz = configuration.GetInt(AnalysisKeys.MinHz);
int maxHz = configuration.GetInt(AnalysisKeys.MaxHz);
// BETTER TO CALCULATE THIS. IGNORE USER!
// double frameOverlap = Double.Parse(configDict[Keys.FRAME_OVERLAP]);
// duration of DCT in seconds
double dctDuration = configuration.GetDouble(AnalysisKeys.DctDuration);
// minimum acceptable value of a DCT coefficient
double dctThreshold = configuration.GetDouble(AnalysisKeys.DctThreshold);
// ignore oscillations below this threshold freq
int minOscilFreq = configuration.GetInt(AnalysisKeys.MinOscilFreq);
// ignore oscillations above this threshold freq
int maxOscilFreq = configuration.GetInt(AnalysisKeys.MaxOscilFreq);
// min duration of event in seconds
double minDuration = configuration.GetDouble(AnalysisKeys.MinDuration);
// max duration of event in seconds
double maxDuration = configuration.GetDouble(AnalysisKeys.MaxDuration);
// min score for an acceptable event
double eventThreshold = configuration.GetDouble(AnalysisKeys.EventThreshold);
if (recording.WavReader.SampleRate != 22050)
{
throw new InvalidOperationException("Requires a 22050Hz file");
}
// The default was 512 for Canetoad.
// Set longer Framesize for calls having longer pulse periodicity.
const int FrameSize = 128;
double windowOverlap = Oscillations2012.CalculateRequiredFrameOverlap(
recording.SampleRate,
FrameSize,
maxOscilFreq);
//windowOverlap = 0.75; // previous default
// i: MAKE SONOGRAM
var sonoConfig = new SonogramConfig
{
SourceFName = recording.BaseName,
WindowSize = FrameSize,
WindowOverlap = windowOverlap,
//NoiseReductionType = NoiseReductionType.NONE,
NoiseReductionType = NoiseReductionType.Standard,
NoiseReductionParameter = 0.1,
};
// sonoConfig.NoiseReductionType = SNR.Key2NoiseReductionType("STANDARD");
TimeSpan recordingDuration = recording.Duration;
int sr = recording.SampleRate;
double freqBinWidth = sr / (double)sonoConfig.WindowSize;
BaseSonogram sonogram = new SpectrogramStandard(sonoConfig, recording.WavReader);
int rowCount = sonogram.Data.GetLength(0);
int colCount = sonogram.Data.GetLength(1);
// double[,] subMatrix = MatrixTools.Submatrix(sonogram.Data, 0, minBin, (rowCount - 1), maxbin);
// ######################################################################
// ii: DO THE ANALYSIS AND RECOVER SCORES OR WHATEVER
// This window is used to smooth the score array before extracting events.
// A short window (e.g. 3) preserves sharper score edges to define events but also keeps noise.
int scoreSmoothingWindow = 13;
Oscillations2012.Execute(
(SpectrogramStandard)sonogram,
minHz,
maxHz,
dctDuration,
minOscilFreq,
maxOscilFreq,
dctThreshold,
eventThreshold,
minDuration,
maxDuration,
scoreSmoothingWindow,
out var scores,
out var acousticEvents,
out var hits,
segmentStartOffset);
acousticEvents.ForEach(ae =>
{
ae.SpeciesName = speciesName;
ae.SegmentDurationSeconds = recordingDuration.TotalSeconds;
ae.SegmentStartSeconds = segmentStartOffset.TotalSeconds;
ae.Name = abbreviatedSpeciesName;
});
var plot = new Plot(this.DisplayName, scores, eventThreshold);
var plots = new List<Plot> { plot };
this.WriteDebugImage(recording, outputDirectory, sonogram, acousticEvents, plots, hits);
return new RecognizerResults()
{
Sonogram = sonogram,
Hits = hits,
Plots = plots,
Events = acousticEvents,
};
}
private void WriteDebugImage(
AudioRecording recording,
DirectoryInfo outputDirectory,
BaseSonogram sonogram,
List<AcousticEvent> acousticEvents,
List<Plot> plots,
double[,] hits)
{
//DEBUG IMAGE this recogniser only. MUST set false for deployment.
bool displayDebugImage = MainEntry.InDEBUG;
if (displayDebugImage)
{
Image debugImage1 = SpectrogramTools.GetSonogramPlusCharts(sonogram, acousticEvents, plots, hits);
var debugPath1 = outputDirectory.Combine(FilenameHelpers.AnalysisResultName(Path.GetFileNameWithoutExtension(recording.BaseName), this.Identifier, "png", "DebugSpectrogram1"));
debugImage1.Save(debugPath1.FullName);
// save new image with longer frame
var sonoConfig2 = new SonogramConfig
{
SourceFName = recording.BaseName,
WindowSize = 1024,
WindowOverlap = 0,
//NoiseReductionType = NoiseReductionType.NONE,
NoiseReductionType = NoiseReductionType.Standard,
NoiseReductionParameter = 0.1,
};
BaseSonogram sonogram2 = new SpectrogramStandard(sonoConfig2, recording.WavReader);
var debugPath2 = outputDirectory.Combine(FilenameHelpers.AnalysisResultName(Path.GetFileNameWithoutExtension(recording.BaseName), this.Identifier, "png", "DebugSpectrogram2"));
Image debugImage2 = SpectrogramTools.GetSonogramPlusCharts(sonogram2, acousticEvents, plots, null);
debugImage2.Save(debugPath2.FullName);
}
}
}
}
| 45.718182
| 225
| 0.618314
|
[
"Apache-2.0"
] |
ninascarpelli/audio-analysis
|
src/AnalysisPrograms/Recognizers/UperoleiaMimula.cs
| 10,058
|
C#
|
using System;
using System.Drawing;
using ESolutions.Core.Drawing;
using Xunit;
namespace ESolutions.Core.Test
{
public class SizeUnitTest
{
#region TestGetRatioSquare
[Fact]
public void TestGetRatioSquare()
{
Size testUnit = new Size(100, 100);
Double actual = testUnit.GetRatio();
Assert.Equal(1.0, actual);
}
#endregion
#region TestGetRatioPortrait
[Fact]
public void TestGetRatioPortrait()
{
Size testUnit = new Size(100, 200);
Double actual = testUnit.GetRatio();
Assert.Equal(0.5, actual);
}
#endregion
#region TestGetRatioLandscape
[Fact]
public void TestGetRatioLandscape()
{
Size testUnit = new Size(200, 100);
Double actual = testUnit.GetRatio();
Assert.Equal(2.0, actual);
}
#endregion
#region TestIsLandscape
[Fact]
public void TestIsLandscapeOk()
{
Size testUnit = new Size(200, 100);
Assert.True(testUnit.IsLandscape());
}
#endregion
#region TestIsLandscapeFalse
[Fact]
public void TestIsLandscapeFalse()
{
Size testUnit = new Size(100, 100);
Assert.False(testUnit.IsLandscape());
}
#endregion
#region TestIsPortraitOk
[Fact]
public void TestIsPortraitOk()
{
Size testUnit = new Size(100, 200);
Assert.True(testUnit.IsPortrait());
}
#endregion
#region TestIsPortraitFalse
[Fact]
public void TestIsPortraitFalse()
{
Size testUnit = new Size(100, 100);
Assert.False(testUnit.IsPortrait());
}
#endregion
#region TestIsQuadraticOk
[Fact]
public void TestIsQuadraticOk()
{
Size testUnit = new Size(100, 100);
Assert.True(testUnit.IsQuadratic());
}
#endregion
#region TestIsQuadraticFalse
[Fact]
public void TestIsQuadraticFalse()
{
Size testUnit1 = new Size(100, 101);
Size testUnit2 = new Size(101, 100);
Assert.False(testUnit1.IsQuadratic());
Assert.False(testUnit2.IsQuadratic());
}
#endregion
#region TestResizeWidth
[Fact]
public void TestResizeWidth()
{
Size testUnit = new Size(200, 100);
Size actual = testUnit.ResizeWidth(100);
Assert.Equal(100, actual.Width);
Assert.Equal(50, actual.Height);
}
#endregion
#region TestResizeHeight
[Fact]
public void TestResizeHeight()
{
Size testUnit = new Size(200, 100);
Size actual = testUnit.ResizeHeight(200);
Assert.Equal(400, actual.Width);
Assert.Equal(200, actual.Height);
}
#endregion
#region TestToRectangle
[Fact]
public void TestToRectangle()
{
Size size = new Size(80, 90);
Rectangle actual = size.ToRectangle();
Assert.Equal(0, actual.X);
Assert.Equal(0, actual.Y);
Assert.Equal(80, actual.Width);
Assert.Equal(90, actual.Height);
}
#endregion
}
}
| 19.381295
| 44
| 0.68337
|
[
"MIT"
] |
everyday-solution/ESolutions
|
ESolutions.Core.Tests/SizeUnitTest.cs
| 2,696
|
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 xray-2016-04-12.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.XRay.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.XRay.Model.Internal.MarshallTransformations
{
/// <summary>
/// DeleteSamplingRule Request Marshaller
/// </summary>
public class DeleteSamplingRuleRequestMarshaller : IMarshaller<IRequest, DeleteSamplingRuleRequest> , 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((DeleteSamplingRuleRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(DeleteSamplingRuleRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.XRay");
request.Headers["Content-Type"] = "application/x-amz-json-";
request.HttpMethod = "POST";
string uriResourcePath = "/DeleteSamplingRule";
request.ResourcePath = uriResourcePath;
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetRuleARN())
{
context.Writer.WritePropertyName("RuleARN");
context.Writer.Write(publicRequest.RuleARN);
}
if(publicRequest.IsSetRuleName())
{
context.Writer.WritePropertyName("RuleName");
context.Writer.Write(publicRequest.RuleName);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static DeleteSamplingRuleRequestMarshaller _instance = new DeleteSamplingRuleRequestMarshaller();
internal static DeleteSamplingRuleRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeleteSamplingRuleRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
}
| 34.527778
| 151
| 0.625637
|
[
"Apache-2.0"
] |
DalavanCloud/aws-sdk-net
|
sdk/src/Services/XRay/Generated/Model/Internal/MarshallTransformations/DeleteSamplingRuleRequestMarshaller.cs
| 3,729
|
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.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Roslynator.CSharp.CodeFixes;
using Roslynator.Testing.CSharp;
using Xunit;
namespace Roslynator.CSharp.Analysis.Tests
{
public class RCS1207ConvertMethodGroupToAnonymousFunctionTests : AbstractCSharpFixVerifier
{
public override DiagnosticDescriptor Descriptor { get; } = DiagnosticDescriptors.ConvertAnonymousFunctionToMethodGroupOrViceVersa;
protected override DiagnosticAnalyzer Analyzer { get; } = new ConvertAnonymousFunctionToMethodGroupOrViceVersaAnalyzer();
public override CodeFixProvider FixProvider { get; } = new ConvertAnonymousFunctionToMethodGroupOrViceVersaCodeFixProvider();
protected override CSharpCodeVerificationOptions UpdateOptions(CSharpCodeVerificationOptions options)
{
return base.UpdateOptions(options)
.WithEnabled(AnalyzerOptions.ConvertMethodGroupToAnonymousFunction);
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2([|M|]);
}
}
", @"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2(() => M());
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_OneParameter()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M(object p) => null;
void M2(Func<object, object> p)
{
M2([|M|]);
}
}
", @"
using System;
class C
{
static object M(object p) => null;
void M2(Func<object, object> p)
{
M2(f => M(f));
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_TwoParameters()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M(object p1, object p2) => null;
void M2(Func<object, object, object> p)
{
M2([|M|]);
}
}
", @"
using System;
class C
{
static object M(object p1, object p2) => null;
void M2(Func<object, object, object> p)
{
M2((f, f2) => M(f, f2));
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_TwoParameters2()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M(object p1, object p2) => null;
void M2(Func<object, object, object> p)
{
object f = null;
object f2 = null;
M2([|M|]);
}
}
", @"
using System;
class C
{
static object M(object p1, object p2) => null;
void M2(Func<object, object, object> p)
{
object f = null;
object f2 = null;
M2((f3, f4) => M(f3, f4));
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_WithClassName()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2([|C.M|]);
}
}
", @"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2(() => C.M());
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_WithNamespaceName()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
namespace N
{
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2([|N.C.M|]);
}
}
}
", @"
using System;
namespace N
{
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2(() => N.C.M());
}
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Argument_WithGlobalName()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
namespace N
{
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2([|global::N.C.M|]);
}
}
}
", @"
using System;
namespace N
{
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2(() => global::N.C.M());
}
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_LocalDeclaration()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
Func<object> x = [|M|];
}
}
", @"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
Func<object> x = () => M();
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_Assignment()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
Func<object> l = null;
l = [|M|];
l += [|M|];
l -= [|M|];
l ??= [|M|];
}
}
", @"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
Func<object> l = null;
l = () => M();
l += () => M();
l -= () => M();
l ??= () => M();
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_ObjectInitializer()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
Func<object> P { get; set; }
static object M() => null;
void M2(Func<object> p)
{
var c = new C() { P = [|M|] };
}
}
", @"
using System;
class C
{
Func<object> P { get; set; }
static object M() => null;
void M2(Func<object> p)
{
var c = new C() { P = () => M() };
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_PropertyInitializer()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
public Func<object> P { get; set; } = [|M|];
static object M() => null;
}
", @"
using System;
class C
{
public Func<object> P { get; set; } = () => M();
static object M() => null;
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_FieldInitializer()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
Func<object> F = [|M|];
static object M() => null;
}
", @"
using System;
class C
{
Func<object> F = () => M();
static object M() => null;
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_ReturnStatement()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
Func<object> M2(Func<object> p)
{
return [|M|];
}
}
", @"
using System;
class C
{
static object M() => null;
Func<object> M2(Func<object> p)
{
return () => M();
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_ArrowExpressionClause()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
Func<object> M2(Func<object> p) => [|M|];
}
", @"
using System;
class C
{
static object M() => null;
Func<object> M2(Func<object> p) => () => M();
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_ArrayInitializer()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
var x = new Func<object>[] { [|M|] };
}
}
", @"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
var x = new Func<object>[] { () => M() };
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_CollectionInitializer()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
using System.Collections.Generic;
class C
{
static object M() => null;
void M2(Func<object> p)
{
var x = new List<Func<object>>() { [|M|] };
}
}
", @"
using System;
using System.Collections.Generic;
class C
{
static object M() => null;
void M2(Func<object> p)
{
var x = new List<Func<object>>() { () => M() };
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_YieldReturnStatement()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
using System.Collections.Generic;
class C
{
static object M() => null;
IEnumerable<Func<object>> M2(Func<object> p)
{
yield return [|M|];
}
}
", @"
using System;
using System.Collections.Generic;
class C
{
static object M() => null;
IEnumerable<Func<object>> M2(Func<object> p)
{
yield return () => M();
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task Test_SwitchExpressionArm()
{
await VerifyDiagnosticAndFixAsync(@"
using System;
class C
{
static object M() => null;
Func<object> M(Func<object> p)
{
return """" switch
{
_ => [|M|],
};
}
}
", @"
using System;
class C
{
static object M() => null;
Func<object> M(Func<object> p)
{
return """" switch
{
_ => () => M(),
};
}
}
");
}
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertAnonymousFunctionToMethodGroupOrViceVersa)]
public async Task TestNoDiagnostic_AnalyzerOptionDisabled()
{
await VerifyNoDiagnosticAsync(@"
using System;
class C
{
static object M() => null;
void M2(Func<object> p)
{
M2(M);
}
}
", options: Options.WithDisabled(AnalyzerOptions.ConvertMethodGroupToAnonymousFunction));
}
}
}
| 18.97377
| 160
| 0.58666
|
[
"Apache-2.0"
] |
manunio/Roslynator
|
src/Tests/Analyzers.Tests/RCS1207ConvertMethodGroupToAnonymousFunctionTests.cs
| 11,576
|
C#
|
namespace DeemZ.Services.AutoMapperProfiles
{
using AutoMapper;
using DeemZ.Data.Models;
using DeemZ.Models.ViewModels.ChatMessages;
public class ChatMessagesProfile : Profile
{
public ChatMessagesProfile()
{
CreateMap<ChatMessage, ChatMessageViewModel>();
}
}
}
| 24.846154
| 59
| 0.665635
|
[
"MIT"
] |
Berat-Dzhevdetov/DeemZ
|
DeemZ/DeemZ.Services/AutoMapperProfiles/ChatMessagesProfile.cs
| 325
|
C#
|
namespace Utilities.Models
{
using System.Runtime.Serialization;
/// <summary>
/// The point information.
/// </summary>
[DataContract]
public class PointInformation
{
#region Public Properties
/// <summary>
/// Gets or sets the intensity.
/// </summary>
[DataMember]
public double Intensity { get; set; }
/// <summary>
/// Gets or sets the location.
/// </summary>
[DataMember]
public double Location { get; set; }
/// <summary>
/// Gets or sets the smoothed intensity.
/// </summary>
[DataMember]
public double SmoothedIntensity { get; set; }
#endregion
}
}
| 22.181818
| 53
| 0.534153
|
[
"MIT"
] |
PNNL-Comp-Mass-Spec/Atreyu
|
Utilities/Models/PointInformation.cs
| 732
|
C#
|
namespace Friedforfun.ContextSteering.Utilities
{
public enum SteerDirection
{
ATTRACT,
REPULSE
}
public enum RotationAxis
{
YAxis,
ZAxis,
XAxis
}
}
| 12
| 47
| 0.550926
|
[
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] |
friedforfun/ContextSteering
|
Runtime/Utilities/SteeringEnums.cs
| 216
|
C#
|
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Localization;
using Newtonsoft.Json.Linq;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.Notify;
using OrchardCore.Environment.Shell;
using OrchardCore.Mvc.Utilities;
using OrchardCore.Navigation;
using OrchardCore.Routing;
using OrchardCore.Settings;
using ThisNetWorks.OrchardCore.CKEditor.Models;
using ThisNetWorks.OrchardCore.CKEditor.Services;
using ThisNetWorks.OrchardCore.CKEditor.ViewModels;
namespace ThisNetWorks.OrchardCore.CKEditor.Controllers
{
public class AdminController : Controller
{
private readonly string _tenant;
private readonly IAuthorizationService _authorizationService;
private readonly CKEditorConfigurationManager _ckEditorConfigurationManager;
private readonly ISiteService _siteService;
private readonly IStringLocalizer S;
private readonly dynamic New;
public AdminController(
ShellSettings shellSettings,
IAuthorizationService authorizationService,
CKEditorConfigurationManager ckEditorConfigurationManager,
IShapeFactory shapeFactory,
ISiteService siteService,
IStringLocalizer<AdminController> stringLocalizer,
INotifier notifier)
{
_tenant = shellSettings.Name;
_authorizationService = authorizationService;
_ckEditorConfigurationManager = ckEditorConfigurationManager;
New = shapeFactory;
_siteService = siteService;
S = stringLocalizer;
}
public async Task<IActionResult> Index(CKEditorConfigurationIndexOptions options, PagerParameters pagerParameters)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
var siteSettings = await _siteService.GetSiteSettingsAsync();
var pager = new Pager(pagerParameters, siteSettings.PageSize);
// default options
if (options == null)
{
options = new CKEditorConfigurationIndexOptions();
}
var document = await _ckEditorConfigurationManager.GetDocumentAsync();
var configurationEntries = document.Configurations.Values.Select(x => new CKEditorConfigurationEntry { Configuration = x} )
.OrderBy(entry => entry.Configuration.Name)
.Skip(pager.GetStartIndex())
.Take(pager.PageSize)
.ToList();
var pagerShape = (await New.Pager(pager)).TotalItemCount(configurationEntries.Count());
var model = new CKEditorConfigurationIndexViewModel
{
Configurations = configurationEntries,
Options = options,
Pager = pagerShape
};
return View(model);
}
[HttpPost, ActionName("Index")]
[FormValueRequired("submit.Filter")]
public ActionResult IndexFilterPOST(CKEditorConfigurationIndexViewModel model)
{
return RedirectToAction("Index", new RouteValueDictionary {
{ "Options.Search", model.Options.Search }
});
}
public async Task<IActionResult> Create(string name)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
var model = new CKEditorConfigurationViewModel
{
Name = name
};
return View(model);
}
[HttpPost, ActionName("Create")]
public async Task<IActionResult> CreatePost(CKEditorConfigurationViewModel model)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
if (ModelState.IsValid)
{
if (String.IsNullOrWhiteSpace(model.Name))
{
ModelState.AddModelError(nameof(CKEditorConfigurationViewModel.Name), S["The name is mandatory."]);
}
if (String.IsNullOrWhiteSpace(model.Configuration) || !model.Configuration.IsJson())
{
ModelState.AddModelError(nameof(CKEditorConfigurationViewModel.Configuration), S["Invalid JSON configuration."]);
}
}
if (ModelState.IsValid)
{
var document = await _ckEditorConfigurationManager.GetDocumentAsync();
if (document.Configurations.ContainsKey(model.Name))
{
ModelState.AddModelError(nameof(CKEditorConfigurationViewModel.Name), S["A configuration with the same name already exists."]);
}
else
{
var configuration = new CKEditorConfiguration
{
Name = model.Name,
Configuration = FormatJson(model.Configuration)
};
await _ckEditorConfigurationManager.UpdateAsync(model.Name, configuration);
}
return RedirectToAction(nameof(Index));
}
return View(model);
}
public async Task<IActionResult> Edit(string name)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
var document = await _ckEditorConfigurationManager.GetDocumentAsync();
if (!document.Configurations.ContainsKey(name))
{
return RedirectToAction("Create", new { name });
}
var configuration = document.Configurations[name];
var model = new CKEditorConfigurationViewModel
{
Name = name,
Configuration = configuration.Configuration
};
return View(model);
}
[HttpPost]
public async Task<IActionResult> Edit(CKEditorConfigurationViewModel model)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
if (ModelState.IsValid)
{
if (String.IsNullOrWhiteSpace(model.Name))
{
ModelState.AddModelError(nameof(CKEditorConfigurationViewModel.Name), S["The name is mandatory."]);
}
if (String.IsNullOrWhiteSpace(model.Configuration) || !model.Configuration.IsJson())
{
ModelState.AddModelError(nameof(CKEditorConfigurationViewModel.Configuration), S["Invalid JSON configuration."]);
}
}
if (ModelState.IsValid)
{
var configuration = new CKEditorConfiguration
{
Name = model.Name,
Configuration = FormatJson(model.Configuration)
};
await _ckEditorConfigurationManager.UpdateAsync(model.Name, configuration);
return RedirectToAction(nameof(Index));
}
// If we got this far, something failed, redisplay form
return View(model);
}
[HttpPost]
public async Task<IActionResult> Delete(string name)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageCKEditorConfigurations))
{
return Forbid();
}
var document = await _ckEditorConfigurationManager.LoadDocumentAsync();
if (!document.Configurations.ContainsKey(name))
{
return NotFound();
}
await _ckEditorConfigurationManager.RemoveAsync(name);
return RedirectToAction(nameof(Index));
}
private string FormatJson(string json)
{
var jObject = JObject.Parse(json);
return jObject.ToString(Newtonsoft.Json.Formatting.Indented);
}
}
}
| 35.454545
| 147
| 0.59324
|
[
"BSD-3-Clause"
] |
ThisNetWorks/ThisNetWorks.OrchardCore.CKEditor
|
src/ThisNetWorks.OrchardCore.CKEditor/Controllers/AdminController.cs
| 8,580
|
C#
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="StartupBuilderSimpleCreator.cs" company="Marcin Smółka zNET Computer Solutions">
// Copyright (c) Marcin Smółka zNET Computer Solutions. All rights reserved.
// </copyright>
// <summary>
// The startup.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ZNetCS.AspNetCore.Logging.EntityFrameworkCoreTest
{
#region Usings
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
#endregion
/// <summary>
/// The startup.
/// </summary>
public class StartupBuilderSimpleCreator
{
#region Static Fields
/// <summary>
/// The memory root.
/// </summary>
public static readonly InMemoryDatabaseRoot MemoryRoot = new InMemoryDatabaseRoot();
#endregion
#region Public Methods
/// <summary>
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
/// </summary>
/// <param name="app">
/// The application builder.
/// </param>
/// <param name="loggerFactory">
/// The logger factory.
/// </param>
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
ILogger logger = loggerFactory.CreateLogger("Configure");
app.Use(
async (context, next) =>
{
logger.LogInformation(1, "Handling request {Test}.", "Test2");
await next.Invoke();
logger.LogInformation(2, "Finished handling request {0}.", "param 1", "param2");
});
app.Run(async context => { await context.Response.WriteAsync("Hello World"); });
}
/// <summary>
/// This method gets called by the runtime. Use this method to add services to the container.
/// </summary>
/// <param name="services">
/// The service collection.
/// </param>
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFrameworkInMemoryDatabase();
// Add framework services.
services.AddDbContext<ContextSimple>(options => options.UseInMemoryDatabase("SimpleLogCreatorDatabase", MemoryRoot));
}
#endregion
}
}
| 34.246914
| 129
| 0.556597
|
[
"MIT"
] |
msmolka/ZNetCS.AspNetCore.Logging.EntityFrameworkCore
|
test/ZNetCS.AspNetCore.Logging.EntityFrameworkCoreTest/StartupBuilderSimpleCreator.cs
| 2,780
|
C#
|
using System;
using UnityEngine;
namespace FootIK
{
public struct Length
{
public float min;
public float max;
}
[Serializable]
public struct Limb
{
public Leg leg;
public Knees knees;
public Foot foot;
public Vector3 target;
Bone[] bones;
public void Collect(Transform t, bool left)
{
foreach (var leg in t.GetComponentsInChildren<Leg>())
{
if (leg.left == left)
{
this.leg = leg;
break;
}
}
this.knees = this.leg.GetComponentInChildren<Knees>();
this.foot = this.leg.GetComponentInChildren<Foot>();
bones = new Bone[3];
bones[0] = new Bone();
bones[1] = new Bone();
bones[2] = new Bone();
}
public Vector3 VisualTarget(Vector3 target)
{
Vector3 offset = Vector3.zero;
var divide = Mathf.Sqrt((target - foot.position).sqrMagnitude / (leg.position - foot.position).sqrMagnitude);
var softDivide = leg.softThreshold;
var hardDivide = leg.hardThreshold;
if (divide > hardDivide)
{
var delta = target - foot.position;
var holdTarget = foot.position + (delta / divide * hardDivide);
offset = target - holdTarget;
target = holdTarget;
}
else if (divide > softDivide)
{
var delta = target - foot.position;
var proportion = softDivide + (divide - softDivide) * Mathf.InverseLerp(softDivide, hardDivide, divide);
var holdTarget = foot.position + (delta / divide * proportion);
offset = target - holdTarget;
target = holdTarget;
}
this.target = target;
return offset;
}
public void Calculate(Vector3 target, Vector3 offset)
{
leg.position += offset;
if (!foot || !knees)
{
return;
}
SetBone();
Curle(target);
GetBone();
}
private void Curle(Vector3 target)
{
var normal = Vector3.Cross(knees.position - leg.position, foot.position - knees.position);
DebugPoint(Color.white);
Debug.DrawLine(knees.position, knees.position + normal * 2, Color.blue);
IKSolverUtil.SolveTrigonometric(bones, 0, 1, 2, target, normal, 1);
DebugPoint(Color.green);
}
void DebugPoint(Color color)
{
Debug.DrawLine(leg.position, knees.position, color);
Debug.DrawLine(foot.position, knees.position, color);
Debug.DrawLine(foot.position, leg.position, color);
}
void SetBone()
{
bones[0].position = leg.position;
bones[0].rotation = leg.transform.rotation;
bones[1].position = knees.position;
bones[1].rotation = knees.transform.rotation;
bones[2].position = foot.position;
bones[2].rotation = foot.transform.rotation;
}
void GetBone()
{
leg.position = bones[0].position;
leg.transform.rotation = bones[0].rotation;
knees.position = bones[1].position;
knees.transform.rotation = bones[1].rotation;
foot.position = bones[2].position;
foot.transform.rotation = bones[2].rotation;
}
}
}
| 32.159292
| 121
| 0.518987
|
[
"MIT"
] |
Yene2017/ProcedureAnimation_IK_Baka
|
_Scripts/FootIK/Limb.cs
| 3,636
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Core
{
public interface IEntityRepository<T> where T:class,IEntity,new()
{
List<T> GetAll(Expression<Func<T, bool>> filter = null);
T Get(Expression<Func<T, bool>> filter);
void Add(T entity);
void Update(T entity);
void Delete(T entity);
}
}
| 23.894737
| 69
| 0.671806
|
[
"MIT"
] |
TekEmre/Restful-API-Rental-App
|
Core/IEntityRepository.cs
| 456
|
C#
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
[assembly:System.Reflection.AssemblyVersionAttribute("4.0.0.0")]
[assembly:System.CLSCompliantAttribute(true)]
[assembly:System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute.DebuggingModes)(2))]
[assembly:System.Drawing.BitmapSuffixInSatelliteAssemblyAttribute]
[assembly:System.Reflection.AssemblyCompanyAttribute("Mono development team")]
[assembly:System.Reflection.AssemblyCopyrightAttribute("(c) Various Mono authors")]
[assembly:System.Reflection.AssemblyDefaultAliasAttribute("System.Drawing.dll")]
[assembly:System.Reflection.AssemblyDescriptionAttribute("System.Drawing.dll")]
[assembly:System.Reflection.AssemblyFileVersionAttribute("4.7.2046.0")]
[assembly:System.Reflection.AssemblyInformationalVersionAttribute("4.7.2046.0")]
[assembly:System.Reflection.AssemblyProductAttribute("Mono Common Language Infrastructure")]
[assembly:System.Reflection.AssemblyTitleAttribute("System.Drawing.dll")]
[assembly:System.Resources.NeutralResourcesLanguageAttribute("en-US")]
[assembly:System.Resources.SatelliteContractVersionAttribute("4.0.0.0")]
[assembly:System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8)]
[assembly:System.Runtime.CompilerServices.DependencyAttribute("System,", (System.Runtime.CompilerServices.LoadHint)(1))]
[assembly:System.Runtime.CompilerServices.ReferenceAssemblyAttribute]
[assembly:System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows=true)]
[assembly:System.Runtime.InteropServices.ComCompatibleVersionAttribute(1, 0, 3300, 0)]
[assembly:System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly:System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((System.Runtime.InteropServices.DllImportSearchPath)(2050))]
[assembly:System.Runtime.InteropServices.TypeLibVersionAttribute(2, 4)]
[assembly:System.Security.AllowPartiallyTrustedCallersAttribute]
[assembly:System.Security.SecurityRulesAttribute((System.Security.SecurityRuleSet)(1), SkipVerificationInFullTrust=true)]
[assembly:System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.RequestMinimum, SkipVerification=true)]
namespace System.Drawing
{
[System.ComponentModel.EditorAttribute("System.Drawing.Design.BitmapEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
public sealed partial class Bitmap : System.Drawing.Image
{
public Bitmap(System.Drawing.Image original) { }
public Bitmap(System.Drawing.Image original, System.Drawing.Size newSize) { }
public Bitmap(System.Drawing.Image original, int width, int height) { }
public Bitmap(int width, int height) { }
public Bitmap(int width, int height, System.Drawing.Graphics g) { }
public Bitmap(int width, int height, System.Drawing.Imaging.PixelFormat format) { }
public Bitmap(int width, int height, int stride, System.Drawing.Imaging.PixelFormat format, System.IntPtr scan0) { }
public Bitmap(System.IO.Stream stream) { }
public Bitmap(System.IO.Stream stream, bool useIcm) { }
public Bitmap(string filename) { }
public Bitmap(string filename, bool useIcm) { }
public Bitmap(System.Type type, string resource) { }
public System.Drawing.Bitmap Clone(System.Drawing.Rectangle rect, System.Drawing.Imaging.PixelFormat format) { throw null; }
public System.Drawing.Bitmap Clone(System.Drawing.RectangleF rect, System.Drawing.Imaging.PixelFormat format) { throw null; }
public static System.Drawing.Bitmap FromHicon(System.IntPtr hicon) { throw null; }
public static System.Drawing.Bitmap FromResource(System.IntPtr hinstance, string bitmapName) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.IntPtr GetHbitmap() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.IntPtr GetHbitmap(System.Drawing.Color background) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.IntPtr GetHicon() { throw null; }
public System.Drawing.Color GetPixel(int x, int y) { throw null; }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.Drawing.Imaging.BitmapData LockBits(System.Drawing.Rectangle rect, System.Drawing.Imaging.ImageLockMode flags, System.Drawing.Imaging.PixelFormat format) { throw null; }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.Drawing.Imaging.BitmapData LockBits(System.Drawing.Rectangle rect, System.Drawing.Imaging.ImageLockMode flags, System.Drawing.Imaging.PixelFormat format, System.Drawing.Imaging.BitmapData bitmapData) { throw null; }
public void MakeTransparent() { }
public void MakeTransparent(System.Drawing.Color transparentColor) { }
public void SetPixel(int x, int y, System.Drawing.Color color) { }
public void SetResolution(float xDpi, float yDpi) { }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public void UnlockBits(System.Drawing.Imaging.BitmapData bitmapdata) { }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(1))]
public partial class BitmapSuffixInSameAssemblyAttribute : System.Attribute
{
public BitmapSuffixInSameAssemblyAttribute() { }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(1))]
public partial class BitmapSuffixInSatelliteAssemblyAttribute : System.Attribute
{
public BitmapSuffixInSatelliteAssemblyAttribute() { }
}
public abstract partial class Brush : System.MarshalByRefObject, System.ICloneable, System.IDisposable
{
protected Brush() { }
public abstract object Clone();
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~Brush() { }
protected internal void SetNativeBrush(System.IntPtr brush) { }
}
public sealed partial class Brushes
{
internal Brushes() { }
public static System.Drawing.Brush AliceBlue { get { throw null; } }
public static System.Drawing.Brush AntiqueWhite { get { throw null; } }
public static System.Drawing.Brush Aqua { get { throw null; } }
public static System.Drawing.Brush Aquamarine { get { throw null; } }
public static System.Drawing.Brush Azure { get { throw null; } }
public static System.Drawing.Brush Beige { get { throw null; } }
public static System.Drawing.Brush Bisque { get { throw null; } }
public static System.Drawing.Brush Black { get { throw null; } }
public static System.Drawing.Brush BlanchedAlmond { get { throw null; } }
public static System.Drawing.Brush Blue { get { throw null; } }
public static System.Drawing.Brush BlueViolet { get { throw null; } }
public static System.Drawing.Brush Brown { get { throw null; } }
public static System.Drawing.Brush BurlyWood { get { throw null; } }
public static System.Drawing.Brush CadetBlue { get { throw null; } }
public static System.Drawing.Brush Chartreuse { get { throw null; } }
public static System.Drawing.Brush Chocolate { get { throw null; } }
public static System.Drawing.Brush Coral { get { throw null; } }
public static System.Drawing.Brush CornflowerBlue { get { throw null; } }
public static System.Drawing.Brush Cornsilk { get { throw null; } }
public static System.Drawing.Brush Crimson { get { throw null; } }
public static System.Drawing.Brush Cyan { get { throw null; } }
public static System.Drawing.Brush DarkBlue { get { throw null; } }
public static System.Drawing.Brush DarkCyan { get { throw null; } }
public static System.Drawing.Brush DarkGoldenrod { get { throw null; } }
public static System.Drawing.Brush DarkGray { get { throw null; } }
public static System.Drawing.Brush DarkGreen { get { throw null; } }
public static System.Drawing.Brush DarkKhaki { get { throw null; } }
public static System.Drawing.Brush DarkMagenta { get { throw null; } }
public static System.Drawing.Brush DarkOliveGreen { get { throw null; } }
public static System.Drawing.Brush DarkOrange { get { throw null; } }
public static System.Drawing.Brush DarkOrchid { get { throw null; } }
public static System.Drawing.Brush DarkRed { get { throw null; } }
public static System.Drawing.Brush DarkSalmon { get { throw null; } }
public static System.Drawing.Brush DarkSeaGreen { get { throw null; } }
public static System.Drawing.Brush DarkSlateBlue { get { throw null; } }
public static System.Drawing.Brush DarkSlateGray { get { throw null; } }
public static System.Drawing.Brush DarkTurquoise { get { throw null; } }
public static System.Drawing.Brush DarkViolet { get { throw null; } }
public static System.Drawing.Brush DeepPink { get { throw null; } }
public static System.Drawing.Brush DeepSkyBlue { get { throw null; } }
public static System.Drawing.Brush DimGray { get { throw null; } }
public static System.Drawing.Brush DodgerBlue { get { throw null; } }
public static System.Drawing.Brush Firebrick { get { throw null; } }
public static System.Drawing.Brush FloralWhite { get { throw null; } }
public static System.Drawing.Brush ForestGreen { get { throw null; } }
public static System.Drawing.Brush Fuchsia { get { throw null; } }
public static System.Drawing.Brush Gainsboro { get { throw null; } }
public static System.Drawing.Brush GhostWhite { get { throw null; } }
public static System.Drawing.Brush Gold { get { throw null; } }
public static System.Drawing.Brush Goldenrod { get { throw null; } }
public static System.Drawing.Brush Gray { get { throw null; } }
public static System.Drawing.Brush Green { get { throw null; } }
public static System.Drawing.Brush GreenYellow { get { throw null; } }
public static System.Drawing.Brush Honeydew { get { throw null; } }
public static System.Drawing.Brush HotPink { get { throw null; } }
public static System.Drawing.Brush IndianRed { get { throw null; } }
public static System.Drawing.Brush Indigo { get { throw null; } }
public static System.Drawing.Brush Ivory { get { throw null; } }
public static System.Drawing.Brush Khaki { get { throw null; } }
public static System.Drawing.Brush Lavender { get { throw null; } }
public static System.Drawing.Brush LavenderBlush { get { throw null; } }
public static System.Drawing.Brush LawnGreen { get { throw null; } }
public static System.Drawing.Brush LemonChiffon { get { throw null; } }
public static System.Drawing.Brush LightBlue { get { throw null; } }
public static System.Drawing.Brush LightCoral { get { throw null; } }
public static System.Drawing.Brush LightCyan { get { throw null; } }
public static System.Drawing.Brush LightGoldenrodYellow { get { throw null; } }
public static System.Drawing.Brush LightGray { get { throw null; } }
public static System.Drawing.Brush LightGreen { get { throw null; } }
public static System.Drawing.Brush LightPink { get { throw null; } }
public static System.Drawing.Brush LightSalmon { get { throw null; } }
public static System.Drawing.Brush LightSeaGreen { get { throw null; } }
public static System.Drawing.Brush LightSkyBlue { get { throw null; } }
public static System.Drawing.Brush LightSlateGray { get { throw null; } }
public static System.Drawing.Brush LightSteelBlue { get { throw null; } }
public static System.Drawing.Brush LightYellow { get { throw null; } }
public static System.Drawing.Brush Lime { get { throw null; } }
public static System.Drawing.Brush LimeGreen { get { throw null; } }
public static System.Drawing.Brush Linen { get { throw null; } }
public static System.Drawing.Brush Magenta { get { throw null; } }
public static System.Drawing.Brush Maroon { get { throw null; } }
public static System.Drawing.Brush MediumAquamarine { get { throw null; } }
public static System.Drawing.Brush MediumBlue { get { throw null; } }
public static System.Drawing.Brush MediumOrchid { get { throw null; } }
public static System.Drawing.Brush MediumPurple { get { throw null; } }
public static System.Drawing.Brush MediumSeaGreen { get { throw null; } }
public static System.Drawing.Brush MediumSlateBlue { get { throw null; } }
public static System.Drawing.Brush MediumSpringGreen { get { throw null; } }
public static System.Drawing.Brush MediumTurquoise { get { throw null; } }
public static System.Drawing.Brush MediumVioletRed { get { throw null; } }
public static System.Drawing.Brush MidnightBlue { get { throw null; } }
public static System.Drawing.Brush MintCream { get { throw null; } }
public static System.Drawing.Brush MistyRose { get { throw null; } }
public static System.Drawing.Brush Moccasin { get { throw null; } }
public static System.Drawing.Brush NavajoWhite { get { throw null; } }
public static System.Drawing.Brush Navy { get { throw null; } }
public static System.Drawing.Brush OldLace { get { throw null; } }
public static System.Drawing.Brush Olive { get { throw null; } }
public static System.Drawing.Brush OliveDrab { get { throw null; } }
public static System.Drawing.Brush Orange { get { throw null; } }
public static System.Drawing.Brush OrangeRed { get { throw null; } }
public static System.Drawing.Brush Orchid { get { throw null; } }
public static System.Drawing.Brush PaleGoldenrod { get { throw null; } }
public static System.Drawing.Brush PaleGreen { get { throw null; } }
public static System.Drawing.Brush PaleTurquoise { get { throw null; } }
public static System.Drawing.Brush PaleVioletRed { get { throw null; } }
public static System.Drawing.Brush PapayaWhip { get { throw null; } }
public static System.Drawing.Brush PeachPuff { get { throw null; } }
public static System.Drawing.Brush Peru { get { throw null; } }
public static System.Drawing.Brush Pink { get { throw null; } }
public static System.Drawing.Brush Plum { get { throw null; } }
public static System.Drawing.Brush PowderBlue { get { throw null; } }
public static System.Drawing.Brush Purple { get { throw null; } }
public static System.Drawing.Brush Red { get { throw null; } }
public static System.Drawing.Brush RosyBrown { get { throw null; } }
public static System.Drawing.Brush RoyalBlue { get { throw null; } }
public static System.Drawing.Brush SaddleBrown { get { throw null; } }
public static System.Drawing.Brush Salmon { get { throw null; } }
public static System.Drawing.Brush SandyBrown { get { throw null; } }
public static System.Drawing.Brush SeaGreen { get { throw null; } }
public static System.Drawing.Brush SeaShell { get { throw null; } }
public static System.Drawing.Brush Sienna { get { throw null; } }
public static System.Drawing.Brush Silver { get { throw null; } }
public static System.Drawing.Brush SkyBlue { get { throw null; } }
public static System.Drawing.Brush SlateBlue { get { throw null; } }
public static System.Drawing.Brush SlateGray { get { throw null; } }
public static System.Drawing.Brush Snow { get { throw null; } }
public static System.Drawing.Brush SpringGreen { get { throw null; } }
public static System.Drawing.Brush SteelBlue { get { throw null; } }
public static System.Drawing.Brush Tan { get { throw null; } }
public static System.Drawing.Brush Teal { get { throw null; } }
public static System.Drawing.Brush Thistle { get { throw null; } }
public static System.Drawing.Brush Tomato { get { throw null; } }
public static System.Drawing.Brush Transparent { get { throw null; } }
public static System.Drawing.Brush Turquoise { get { throw null; } }
public static System.Drawing.Brush Violet { get { throw null; } }
public static System.Drawing.Brush Wheat { get { throw null; } }
public static System.Drawing.Brush White { get { throw null; } }
public static System.Drawing.Brush WhiteSmoke { get { throw null; } }
public static System.Drawing.Brush Yellow { get { throw null; } }
public static System.Drawing.Brush YellowGreen { get { throw null; } }
}
public sealed partial class BufferedGraphics : System.IDisposable
{
internal BufferedGraphics() { }
public System.Drawing.Graphics Graphics { get { throw null; } }
public void Dispose() { }
~BufferedGraphics() { }
public void Render() { }
public void Render(System.Drawing.Graphics target) { }
public void Render(System.IntPtr targetDC) { }
}
public sealed partial class BufferedGraphicsContext : System.IDisposable
{
public BufferedGraphicsContext() { }
public System.Drawing.Size MaximumBuffer { get { throw null; } [System.Security.Permissions.UIPermissionAttribute(System.Security.Permissions.SecurityAction.Demand, Window=(System.Security.Permissions.UIPermissionWindow)(3))]set { } }
public System.Drawing.BufferedGraphics Allocate(System.Drawing.Graphics targetGraphics, System.Drawing.Rectangle targetRectangle) { throw null; }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.Drawing.BufferedGraphics Allocate(System.IntPtr targetDC, System.Drawing.Rectangle targetRectangle) { throw null; }
public void Dispose() { }
~BufferedGraphicsContext() { }
public void Invalidate() { }
}
public sealed partial class BufferedGraphicsManager
{
internal BufferedGraphicsManager() { }
public static System.Drawing.BufferedGraphicsContext Current { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct CharacterRange
{
private int _dummyPrimitive;
public CharacterRange(int First, int Length) { throw null;}
public int First { get { throw null; } set { } }
public int Length { get { throw null; } set { } }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2) { throw null; }
public static bool operator !=(System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2) { throw null; }
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.ColorEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.ColorConverter))]
[System.Diagnostics.DebuggerDisplayAttribute("{NameAndARGBValue}")]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct Color
{
private object _dummy;
private int _dummyPrimitive;
public static readonly System.Drawing.Color Empty;
public byte A { get { throw null; } }
public static System.Drawing.Color AliceBlue { get { throw null; } }
public static System.Drawing.Color AntiqueWhite { get { throw null; } }
public static System.Drawing.Color Aqua { get { throw null; } }
public static System.Drawing.Color Aquamarine { get { throw null; } }
public static System.Drawing.Color Azure { get { throw null; } }
public byte B { get { throw null; } }
public static System.Drawing.Color Beige { get { throw null; } }
public static System.Drawing.Color Bisque { get { throw null; } }
public static System.Drawing.Color Black { get { throw null; } }
public static System.Drawing.Color BlanchedAlmond { get { throw null; } }
public static System.Drawing.Color Blue { get { throw null; } }
public static System.Drawing.Color BlueViolet { get { throw null; } }
public static System.Drawing.Color Brown { get { throw null; } }
public static System.Drawing.Color BurlyWood { get { throw null; } }
public static System.Drawing.Color CadetBlue { get { throw null; } }
public static System.Drawing.Color Chartreuse { get { throw null; } }
public static System.Drawing.Color Chocolate { get { throw null; } }
public static System.Drawing.Color Coral { get { throw null; } }
public static System.Drawing.Color CornflowerBlue { get { throw null; } }
public static System.Drawing.Color Cornsilk { get { throw null; } }
public static System.Drawing.Color Crimson { get { throw null; } }
public static System.Drawing.Color Cyan { get { throw null; } }
public static System.Drawing.Color DarkBlue { get { throw null; } }
public static System.Drawing.Color DarkCyan { get { throw null; } }
public static System.Drawing.Color DarkGoldenrod { get { throw null; } }
public static System.Drawing.Color DarkGray { get { throw null; } }
public static System.Drawing.Color DarkGreen { get { throw null; } }
public static System.Drawing.Color DarkKhaki { get { throw null; } }
public static System.Drawing.Color DarkMagenta { get { throw null; } }
public static System.Drawing.Color DarkOliveGreen { get { throw null; } }
public static System.Drawing.Color DarkOrange { get { throw null; } }
public static System.Drawing.Color DarkOrchid { get { throw null; } }
public static System.Drawing.Color DarkRed { get { throw null; } }
public static System.Drawing.Color DarkSalmon { get { throw null; } }
public static System.Drawing.Color DarkSeaGreen { get { throw null; } }
public static System.Drawing.Color DarkSlateBlue { get { throw null; } }
public static System.Drawing.Color DarkSlateGray { get { throw null; } }
public static System.Drawing.Color DarkTurquoise { get { throw null; } }
public static System.Drawing.Color DarkViolet { get { throw null; } }
public static System.Drawing.Color DeepPink { get { throw null; } }
public static System.Drawing.Color DeepSkyBlue { get { throw null; } }
public static System.Drawing.Color DimGray { get { throw null; } }
public static System.Drawing.Color DodgerBlue { get { throw null; } }
public static System.Drawing.Color Firebrick { get { throw null; } }
public static System.Drawing.Color FloralWhite { get { throw null; } }
public static System.Drawing.Color ForestGreen { get { throw null; } }
public static System.Drawing.Color Fuchsia { get { throw null; } }
public byte G { get { throw null; } }
public static System.Drawing.Color Gainsboro { get { throw null; } }
public static System.Drawing.Color GhostWhite { get { throw null; } }
public static System.Drawing.Color Gold { get { throw null; } }
public static System.Drawing.Color Goldenrod { get { throw null; } }
public static System.Drawing.Color Gray { get { throw null; } }
public static System.Drawing.Color Green { get { throw null; } }
public static System.Drawing.Color GreenYellow { get { throw null; } }
public static System.Drawing.Color Honeydew { get { throw null; } }
public static System.Drawing.Color HotPink { get { throw null; } }
public static System.Drawing.Color IndianRed { get { throw null; } }
public static System.Drawing.Color Indigo { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public bool IsKnownColor { get { throw null; } }
public bool IsNamedColor { get { throw null; } }
public bool IsSystemColor { get { throw null; } }
public static System.Drawing.Color Ivory { get { throw null; } }
public static System.Drawing.Color Khaki { get { throw null; } }
public static System.Drawing.Color Lavender { get { throw null; } }
public static System.Drawing.Color LavenderBlush { get { throw null; } }
public static System.Drawing.Color LawnGreen { get { throw null; } }
public static System.Drawing.Color LemonChiffon { get { throw null; } }
public static System.Drawing.Color LightBlue { get { throw null; } }
public static System.Drawing.Color LightCoral { get { throw null; } }
public static System.Drawing.Color LightCyan { get { throw null; } }
public static System.Drawing.Color LightGoldenrodYellow { get { throw null; } }
public static System.Drawing.Color LightGray { get { throw null; } }
public static System.Drawing.Color LightGreen { get { throw null; } }
public static System.Drawing.Color LightPink { get { throw null; } }
public static System.Drawing.Color LightSalmon { get { throw null; } }
public static System.Drawing.Color LightSeaGreen { get { throw null; } }
public static System.Drawing.Color LightSkyBlue { get { throw null; } }
public static System.Drawing.Color LightSlateGray { get { throw null; } }
public static System.Drawing.Color LightSteelBlue { get { throw null; } }
public static System.Drawing.Color LightYellow { get { throw null; } }
public static System.Drawing.Color Lime { get { throw null; } }
public static System.Drawing.Color LimeGreen { get { throw null; } }
public static System.Drawing.Color Linen { get { throw null; } }
public static System.Drawing.Color Magenta { get { throw null; } }
public static System.Drawing.Color Maroon { get { throw null; } }
public static System.Drawing.Color MediumAquamarine { get { throw null; } }
public static System.Drawing.Color MediumBlue { get { throw null; } }
public static System.Drawing.Color MediumOrchid { get { throw null; } }
public static System.Drawing.Color MediumPurple { get { throw null; } }
public static System.Drawing.Color MediumSeaGreen { get { throw null; } }
public static System.Drawing.Color MediumSlateBlue { get { throw null; } }
public static System.Drawing.Color MediumSpringGreen { get { throw null; } }
public static System.Drawing.Color MediumTurquoise { get { throw null; } }
public static System.Drawing.Color MediumVioletRed { get { throw null; } }
public static System.Drawing.Color MidnightBlue { get { throw null; } }
public static System.Drawing.Color MintCream { get { throw null; } }
public static System.Drawing.Color MistyRose { get { throw null; } }
public static System.Drawing.Color Moccasin { get { throw null; } }
public string Name { get { throw null; } }
public static System.Drawing.Color NavajoWhite { get { throw null; } }
public static System.Drawing.Color Navy { get { throw null; } }
public static System.Drawing.Color OldLace { get { throw null; } }
public static System.Drawing.Color Olive { get { throw null; } }
public static System.Drawing.Color OliveDrab { get { throw null; } }
public static System.Drawing.Color Orange { get { throw null; } }
public static System.Drawing.Color OrangeRed { get { throw null; } }
public static System.Drawing.Color Orchid { get { throw null; } }
public static System.Drawing.Color PaleGoldenrod { get { throw null; } }
public static System.Drawing.Color PaleGreen { get { throw null; } }
public static System.Drawing.Color PaleTurquoise { get { throw null; } }
public static System.Drawing.Color PaleVioletRed { get { throw null; } }
public static System.Drawing.Color PapayaWhip { get { throw null; } }
public static System.Drawing.Color PeachPuff { get { throw null; } }
public static System.Drawing.Color Peru { get { throw null; } }
public static System.Drawing.Color Pink { get { throw null; } }
public static System.Drawing.Color Plum { get { throw null; } }
public static System.Drawing.Color PowderBlue { get { throw null; } }
public static System.Drawing.Color Purple { get { throw null; } }
public byte R { get { throw null; } }
public static System.Drawing.Color Red { get { throw null; } }
public static System.Drawing.Color RosyBrown { get { throw null; } }
public static System.Drawing.Color RoyalBlue { get { throw null; } }
public static System.Drawing.Color SaddleBrown { get { throw null; } }
public static System.Drawing.Color Salmon { get { throw null; } }
public static System.Drawing.Color SandyBrown { get { throw null; } }
public static System.Drawing.Color SeaGreen { get { throw null; } }
public static System.Drawing.Color SeaShell { get { throw null; } }
public static System.Drawing.Color Sienna { get { throw null; } }
public static System.Drawing.Color Silver { get { throw null; } }
public static System.Drawing.Color SkyBlue { get { throw null; } }
public static System.Drawing.Color SlateBlue { get { throw null; } }
public static System.Drawing.Color SlateGray { get { throw null; } }
public static System.Drawing.Color Snow { get { throw null; } }
public static System.Drawing.Color SpringGreen { get { throw null; } }
public static System.Drawing.Color SteelBlue { get { throw null; } }
public static System.Drawing.Color Tan { get { throw null; } }
public static System.Drawing.Color Teal { get { throw null; } }
public static System.Drawing.Color Thistle { get { throw null; } }
public static System.Drawing.Color Tomato { get { throw null; } }
public static System.Drawing.Color Transparent { get { throw null; } }
public static System.Drawing.Color Turquoise { get { throw null; } }
public static System.Drawing.Color Violet { get { throw null; } }
public static System.Drawing.Color Wheat { get { throw null; } }
public static System.Drawing.Color White { get { throw null; } }
public static System.Drawing.Color WhiteSmoke { get { throw null; } }
public static System.Drawing.Color Yellow { get { throw null; } }
public static System.Drawing.Color YellowGreen { get { throw null; } }
public override bool Equals(object obj) { throw null; }
public static System.Drawing.Color FromArgb(int argb) { throw null; }
public static System.Drawing.Color FromArgb(int alpha, System.Drawing.Color baseColor) { throw null; }
public static System.Drawing.Color FromArgb(int red, int green, int blue) { throw null; }
public static System.Drawing.Color FromArgb(int alpha, int red, int green, int blue) { throw null; }
public static System.Drawing.Color FromKnownColor(System.Drawing.KnownColor color) { throw null; }
public static System.Drawing.Color FromName(string name) { throw null; }
public float GetBrightness() { throw null; }
public override int GetHashCode() { throw null; }
public float GetHue() { throw null; }
public float GetSaturation() { throw null; }
public static bool operator ==(System.Drawing.Color left, System.Drawing.Color right) { throw null; }
public static bool operator !=(System.Drawing.Color left, System.Drawing.Color right) { throw null; }
public int ToArgb() { throw null; }
public System.Drawing.KnownColor ToKnownColor() { throw null; }
public override string ToString() { throw null; }
}
public partial class ColorConverter : System.ComponentModel.TypeConverter
{
public ColorConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public sealed partial class ColorTranslator
{
internal ColorTranslator() { }
public static System.Drawing.Color FromHtml(string htmlColor) { throw null; }
public static System.Drawing.Color FromOle(int oleColor) { throw null; }
public static System.Drawing.Color FromWin32(int win32Color) { throw null; }
public static string ToHtml(System.Drawing.Color c) { throw null; }
public static int ToOle(System.Drawing.Color c) { throw null; }
public static int ToWin32(System.Drawing.Color c) { throw null; }
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.ContentAlignmentEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public enum ContentAlignment
{
BottomCenter = 512,
BottomLeft = 256,
BottomRight = 1024,
MiddleCenter = 32,
MiddleLeft = 16,
MiddleRight = 64,
TopCenter = 2,
TopLeft = 1,
TopRight = 4,
}
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
public enum CopyPixelOperation
{
Blackness = 66,
CaptureBlt = 1073741824,
DestinationInvert = 5570569,
MergeCopy = 12583114,
MergePaint = 12255782,
NoMirrorBitmap = -2147483648,
NotSourceCopy = 3342344,
NotSourceErase = 1114278,
PatCopy = 15728673,
PatInvert = 5898313,
PatPaint = 16452105,
SourceAnd = 8913094,
SourceCopy = 13369376,
SourceErase = 4457256,
SourceInvert = 6684742,
SourcePaint = 15597702,
Whiteness = 16711778,
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.FontEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.FontConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
public sealed partial class Font : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
{
public Font(System.Drawing.Font prototype, System.Drawing.FontStyle newStyle) { }
public Font(System.Drawing.FontFamily family, float emSize) { }
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style) { }
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit) { }
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet) { }
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) { }
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.GraphicsUnit unit) { }
public Font(string familyName, float emSize) { }
public Font(string familyName, float emSize, System.Drawing.FontStyle style) { }
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit) { }
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet) { }
public Font(string familyName, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) { }
public Font(string familyName, float emSize, System.Drawing.GraphicsUnit unit) { }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public bool Bold { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.FontFamily FontFamily { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public byte GdiCharSet { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public bool GdiVerticalFont { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Height { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsSystemFont { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public bool Italic { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
[System.ComponentModel.EditorAttribute("System.Drawing.Design.FontNameEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.FontConverter.FontNameConverter))]
public string Name { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public string OriginalFontName { get { throw null; } }
public float Size { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public float SizeInPoints { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public bool Strikeout { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.FontStyle Style { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public string SystemFontName { get { throw null; } }
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public bool Underline { get { throw null; } }
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.FontConverter.FontUnitConverter))]
public System.Drawing.GraphicsUnit Unit { get { throw null; } }
public object Clone() { throw null; }
public void Dispose() { }
public override bool Equals(object obj) { throw null; }
~Font() { }
public static System.Drawing.Font FromHdc(System.IntPtr hdc) { throw null; }
public static System.Drawing.Font FromHfont(System.IntPtr hfont) { throw null; }
public static System.Drawing.Font FromLogFont(object lf) { throw null; }
public static System.Drawing.Font FromLogFont(object lf, System.IntPtr hdc) { throw null; }
public override int GetHashCode() { throw null; }
public float GetHeight() { throw null; }
public float GetHeight(System.Drawing.Graphics graphics) { throw null; }
public float GetHeight(float dpi) { throw null; }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(128))]
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
public System.IntPtr ToHfont() { throw null; }
public void ToLogFont(object logFont) { }
public void ToLogFont(object logFont, System.Drawing.Graphics graphics) { }
public override string ToString() { throw null; }
}
public partial class FontConverter : System.ComponentModel.TypeConverter
{
public FontConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
~FontConverter() { }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public sealed partial class FontNameConverter : System.ComponentModel.TypeConverter, System.IDisposable
{
public FontNameConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
void System.IDisposable.Dispose() { }
}
public partial class FontUnitConverter : System.ComponentModel.EnumConverter
{
public FontUnitConverter() : base (default(System.Type)) { }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
}
public sealed partial class FontFamily : System.MarshalByRefObject, System.IDisposable
{
public FontFamily(System.Drawing.Text.GenericFontFamilies genericFamily) { }
public FontFamily(string name) { }
public FontFamily(string name, System.Drawing.Text.FontCollection fontCollection) { }
public static System.Drawing.FontFamily[] Families { get { throw null; } }
public static System.Drawing.FontFamily GenericMonospace { get { throw null; } }
public static System.Drawing.FontFamily GenericSansSerif { get { throw null; } }
public static System.Drawing.FontFamily GenericSerif { get { throw null; } }
public string Name { get { throw null; } }
public void Dispose() { }
public override bool Equals(object obj) { throw null; }
~FontFamily() { }
public int GetCellAscent(System.Drawing.FontStyle style) { throw null; }
public int GetCellDescent(System.Drawing.FontStyle style) { throw null; }
public int GetEmHeight(System.Drawing.FontStyle style) { throw null; }
[System.ObsoleteAttribute("Do not use method GetFamilies, use property Families instead")]
public static System.Drawing.FontFamily[] GetFamilies(System.Drawing.Graphics graphics) { throw null; }
public override int GetHashCode() { throw null; }
public int GetLineSpacing(System.Drawing.FontStyle style) { throw null; }
public string GetName(int language) { throw null; }
public bool IsStyleAvailable(System.Drawing.FontStyle style) { throw null; }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum FontStyle
{
Bold = 1,
Italic = 2,
Regular = 0,
Strikeout = 8,
Underline = 4,
}
public sealed partial class Graphics : System.MarshalByRefObject, System.Drawing.IDeviceContext, System.IDisposable
{
internal Graphics() { }
public System.Drawing.Region Clip { get { throw null; } set { } }
public System.Drawing.RectangleF ClipBounds { get { throw null; } }
public System.Drawing.Drawing2D.CompositingMode CompositingMode { get { throw null; } set { } }
public System.Drawing.Drawing2D.CompositingQuality CompositingQuality { get { throw null; } set { } }
public float DpiX { get { throw null; } }
public float DpiY { get { throw null; } }
public System.Drawing.Drawing2D.InterpolationMode InterpolationMode { get { throw null; } set { } }
public bool IsClipEmpty { get { throw null; } }
public bool IsVisibleClipEmpty { get { throw null; } }
public float PageScale { get { throw null; } set { } }
public System.Drawing.GraphicsUnit PageUnit { get { throw null; } set { } }
public System.Drawing.Drawing2D.PixelOffsetMode PixelOffsetMode { get { throw null; } set { } }
public System.Drawing.Point RenderingOrigin { get { throw null; } set { } }
public System.Drawing.Drawing2D.SmoothingMode SmoothingMode { get { throw null; } set { } }
public int TextContrast { get { throw null; } set { } }
public System.Drawing.Text.TextRenderingHint TextRenderingHint { get { throw null; } set { } }
public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } }
public System.Drawing.RectangleF VisibleClipBounds { get { throw null; } }
public void AddMetafileComment(byte[] data) { }
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer() { throw null; }
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer(System.Drawing.Rectangle dstrect, System.Drawing.Rectangle srcrect, System.Drawing.GraphicsUnit unit) { throw null; }
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer(System.Drawing.RectangleF dstrect, System.Drawing.RectangleF srcrect, System.Drawing.GraphicsUnit unit) { throw null; }
public void Clear(System.Drawing.Color color) { }
public void CopyFromScreen(System.Drawing.Point upperLeftSource, System.Drawing.Point upperLeftDestination, System.Drawing.Size blockRegionSize) { }
public void CopyFromScreen(System.Drawing.Point upperLeftSource, System.Drawing.Point upperLeftDestination, System.Drawing.Size blockRegionSize, System.Drawing.CopyPixelOperation copyPixelOperation) { }
public void CopyFromScreen(int sourceX, int sourceY, int destinationX, int destinationY, System.Drawing.Size blockRegionSize) { }
public void CopyFromScreen(int sourceX, int sourceY, int destinationX, int destinationY, System.Drawing.Size blockRegionSize, System.Drawing.CopyPixelOperation copyPixelOperation) { }
public void Dispose() { }
public void DrawArc(System.Drawing.Pen pen, System.Drawing.Rectangle rect, float startAngle, float sweepAngle) { }
public void DrawArc(System.Drawing.Pen pen, System.Drawing.RectangleF rect, float startAngle, float sweepAngle) { }
public void DrawArc(System.Drawing.Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) { }
public void DrawArc(System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { }
public void DrawBezier(System.Drawing.Pen pen, System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4) { }
public void DrawBezier(System.Drawing.Pen pen, System.Drawing.PointF pt1, System.Drawing.PointF pt2, System.Drawing.PointF pt3, System.Drawing.PointF pt4) { }
public void DrawBezier(System.Drawing.Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) { }
public void DrawBeziers(System.Drawing.Pen pen, System.Drawing.PointF[] points) { }
public void DrawBeziers(System.Drawing.Pen pen, System.Drawing.Point[] points) { }
public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points) { }
public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension, System.Drawing.Drawing2D.FillMode fillmode) { }
public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.Point[] points) { }
public void DrawClosedCurve(System.Drawing.Pen pen, System.Drawing.Point[] points, float tension, System.Drawing.Drawing2D.FillMode fillmode) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points, int offset, int numberOfSegments, float tension) { }
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points, float tension) { }
public void DrawEllipse(System.Drawing.Pen pen, System.Drawing.Rectangle rect) { }
public void DrawEllipse(System.Drawing.Pen pen, System.Drawing.RectangleF rect) { }
public void DrawEllipse(System.Drawing.Pen pen, int x, int y, int width, int height) { }
public void DrawEllipse(System.Drawing.Pen pen, float x, float y, float width, float height) { }
public void DrawIcon(System.Drawing.Icon icon, System.Drawing.Rectangle targetRect) { }
public void DrawIcon(System.Drawing.Icon icon, int x, int y) { }
public void DrawIconUnstretched(System.Drawing.Icon icon, System.Drawing.Rectangle targetRect) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point point) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF point) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle rect) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, System.IntPtr callbackData) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttrs) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, System.IntPtr callbackData) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.RectangleF rect) { }
public void DrawImage(System.Drawing.Image image, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, int x, int y) { }
public void DrawImage(System.Drawing.Image image, int x, int y, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, int x, int y, int width, int height) { }
public void DrawImage(System.Drawing.Image image, float x, float y) { }
public void DrawImage(System.Drawing.Image image, float x, float y, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit) { }
public void DrawImage(System.Drawing.Image image, float x, float y, float width, float height) { }
public void DrawImageUnscaled(System.Drawing.Image image, System.Drawing.Point point) { }
public void DrawImageUnscaled(System.Drawing.Image image, System.Drawing.Rectangle rect) { }
public void DrawImageUnscaled(System.Drawing.Image image, int x, int y) { }
public void DrawImageUnscaled(System.Drawing.Image image, int x, int y, int width, int height) { }
public void DrawImageUnscaledAndClipped(System.Drawing.Image image, System.Drawing.Rectangle rect) { }
public void DrawLine(System.Drawing.Pen pen, System.Drawing.Point pt1, System.Drawing.Point pt2) { }
public void DrawLine(System.Drawing.Pen pen, System.Drawing.PointF pt1, System.Drawing.PointF pt2) { }
public void DrawLine(System.Drawing.Pen pen, int x1, int y1, int x2, int y2) { }
public void DrawLine(System.Drawing.Pen pen, float x1, float y1, float x2, float y2) { }
public void DrawLines(System.Drawing.Pen pen, System.Drawing.PointF[] points) { }
public void DrawLines(System.Drawing.Pen pen, System.Drawing.Point[] points) { }
public void DrawPath(System.Drawing.Pen pen, System.Drawing.Drawing2D.GraphicsPath path) { }
public void DrawPie(System.Drawing.Pen pen, System.Drawing.Rectangle rect, float startAngle, float sweepAngle) { }
public void DrawPie(System.Drawing.Pen pen, System.Drawing.RectangleF rect, float startAngle, float sweepAngle) { }
public void DrawPie(System.Drawing.Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) { }
public void DrawPie(System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { }
public void DrawPolygon(System.Drawing.Pen pen, System.Drawing.PointF[] points) { }
public void DrawPolygon(System.Drawing.Pen pen, System.Drawing.Point[] points) { }
public void DrawRectangle(System.Drawing.Pen pen, System.Drawing.Rectangle rect) { }
public void DrawRectangle(System.Drawing.Pen pen, int x, int y, int width, int height) { }
public void DrawRectangle(System.Drawing.Pen pen, float x, float y, float width, float height) { }
public void DrawRectangles(System.Drawing.Pen pen, System.Drawing.RectangleF[] rects) { }
public void DrawRectangles(System.Drawing.Pen pen, System.Drawing.Rectangle[] rects) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat format) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat format) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y) { }
public void DrawString(string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat format) { }
public void EndContainer(System.Drawing.Drawing2D.GraphicsContainer container) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point destPoint, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF destPoint, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Point[] destPoints, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.Rectangle destRect, System.Drawing.Rectangle srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData) { }
public void EnumerateMetafile(System.Drawing.Imaging.Metafile metafile, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, System.IntPtr callbackData, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public void ExcludeClip(System.Drawing.Rectangle rect) { }
public void ExcludeClip(System.Drawing.Region region) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.Point[] points) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode) { }
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension) { }
public void FillEllipse(System.Drawing.Brush brush, System.Drawing.Rectangle rect) { }
public void FillEllipse(System.Drawing.Brush brush, System.Drawing.RectangleF rect) { }
public void FillEllipse(System.Drawing.Brush brush, int x, int y, int width, int height) { }
public void FillEllipse(System.Drawing.Brush brush, float x, float y, float width, float height) { }
public void FillPath(System.Drawing.Brush brush, System.Drawing.Drawing2D.GraphicsPath path) { }
public void FillPie(System.Drawing.Brush brush, System.Drawing.Rectangle rect, float startAngle, float sweepAngle) { }
public void FillPie(System.Drawing.Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle) { }
public void FillPie(System.Drawing.Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle) { }
public void FillPolygon(System.Drawing.Brush brush, System.Drawing.PointF[] points) { }
public void FillPolygon(System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillMode) { }
public void FillPolygon(System.Drawing.Brush brush, System.Drawing.Point[] points) { }
public void FillPolygon(System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillMode) { }
public void FillRectangle(System.Drawing.Brush brush, System.Drawing.Rectangle rect) { }
public void FillRectangle(System.Drawing.Brush brush, System.Drawing.RectangleF rect) { }
public void FillRectangle(System.Drawing.Brush brush, int x, int y, int width, int height) { }
public void FillRectangle(System.Drawing.Brush brush, float x, float y, float width, float height) { }
public void FillRectangles(System.Drawing.Brush brush, System.Drawing.RectangleF[] rects) { }
public void FillRectangles(System.Drawing.Brush brush, System.Drawing.Rectangle[] rects) { }
public void FillRegion(System.Drawing.Brush brush, System.Drawing.Region region) { }
~Graphics() { }
public void Flush() { }
public void Flush(System.Drawing.Drawing2D.FlushIntention intention) { }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
public static System.Drawing.Graphics FromHdc(System.IntPtr hdc) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
public static System.Drawing.Graphics FromHdc(System.IntPtr hdc, System.IntPtr hdevice) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public static System.Drawing.Graphics FromHdcInternal(System.IntPtr hdc) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
public static System.Drawing.Graphics FromHwnd(System.IntPtr hwnd) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public static System.Drawing.Graphics FromHwndInternal(System.IntPtr hwnd) { throw null; }
public static System.Drawing.Graphics FromImage(System.Drawing.Image image) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
[System.Security.Permissions.StrongNameIdentityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="System.Windows.Forms", PublicKey="0x00000000000000000400000000000000")]
public object GetContextInfo() { throw null; }
public static System.IntPtr GetHalftonePalette() { throw null; }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public System.IntPtr GetHdc() { throw null; }
public System.Drawing.Color GetNearestColor(System.Drawing.Color color) { throw null; }
public void IntersectClip(System.Drawing.Rectangle rect) { }
public void IntersectClip(System.Drawing.RectangleF rect) { }
public void IntersectClip(System.Drawing.Region region) { }
public bool IsVisible(System.Drawing.Point point) { throw null; }
public bool IsVisible(System.Drawing.PointF point) { throw null; }
public bool IsVisible(System.Drawing.Rectangle rect) { throw null; }
public bool IsVisible(System.Drawing.RectangleF rect) { throw null; }
public bool IsVisible(int x, int y) { throw null; }
public bool IsVisible(int x, int y, int width, int height) { throw null; }
public bool IsVisible(float x, float y) { throw null; }
public bool IsVisible(float x, float y, float width, float height) { throw null; }
public System.Drawing.Region[] MeasureCharacterRanges(string text, System.Drawing.Font font, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat stringFormat) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, System.Drawing.PointF origin, System.Drawing.StringFormat stringFormat) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, System.Drawing.SizeF layoutArea) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat stringFormat) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat stringFormat, out int charactersFitted, out int linesFilled) { charactersFitted = default(int); linesFilled = default(int); throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, int width) { throw null; }
public System.Drawing.SizeF MeasureString(string text, System.Drawing.Font font, int width, System.Drawing.StringFormat format) { throw null; }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix) { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public void ReleaseHdc() { }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
public void ReleaseHdc(System.IntPtr hdc) { }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
public void ReleaseHdcInternal(System.IntPtr hdc) { }
public void ResetClip() { }
public void ResetTransform() { }
public void Restore(System.Drawing.Drawing2D.GraphicsState gstate) { }
public void RotateTransform(float angle) { }
public void RotateTransform(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public System.Drawing.Drawing2D.GraphicsState Save() { throw null; }
public void ScaleTransform(float sx, float sy) { }
public void ScaleTransform(float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order) { }
public void SetClip(System.Drawing.Drawing2D.GraphicsPath path) { }
public void SetClip(System.Drawing.Drawing2D.GraphicsPath path, System.Drawing.Drawing2D.CombineMode combineMode) { }
public void SetClip(System.Drawing.Graphics g) { }
public void SetClip(System.Drawing.Graphics g, System.Drawing.Drawing2D.CombineMode combineMode) { }
public void SetClip(System.Drawing.Rectangle rect) { }
public void SetClip(System.Drawing.Rectangle rect, System.Drawing.Drawing2D.CombineMode combineMode) { }
public void SetClip(System.Drawing.RectangleF rect) { }
public void SetClip(System.Drawing.RectangleF rect, System.Drawing.Drawing2D.CombineMode combineMode) { }
public void SetClip(System.Drawing.Region region, System.Drawing.Drawing2D.CombineMode combineMode) { }
public void TransformPoints(System.Drawing.Drawing2D.CoordinateSpace destSpace, System.Drawing.Drawing2D.CoordinateSpace srcSpace, System.Drawing.PointF[] pts) { }
public void TransformPoints(System.Drawing.Drawing2D.CoordinateSpace destSpace, System.Drawing.Drawing2D.CoordinateSpace srcSpace, System.Drawing.Point[] pts) { }
public void TranslateClip(int dx, int dy) { }
public void TranslateClip(float dx, float dy) { }
public void TranslateTransform(float dx, float dy) { }
public void TranslateTransform(float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order) { }
public delegate bool DrawImageAbort(System.IntPtr callbackdata);
public delegate bool EnumerateMetafileProc(System.Drawing.Imaging.EmfPlusRecordType recordType, int flags, int dataSize, System.IntPtr data, System.Drawing.Imaging.PlayRecordCallback callbackData);
}
public enum GraphicsUnit
{
Display = 1,
Document = 5,
Inch = 4,
Millimeter = 6,
Pixel = 2,
Point = 3,
World = 0,
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.IconEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.IconConverter))]
[System.SerializableAttribute]
public sealed partial class Icon : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
{
public Icon(System.Drawing.Icon original, System.Drawing.Size size) { }
public Icon(System.Drawing.Icon original, int width, int height) { }
public Icon(System.IO.Stream stream) { }
public Icon(System.IO.Stream stream, System.Drawing.Size size) { }
public Icon(System.IO.Stream stream, int width, int height) { }
public Icon(string fileName) { }
public Icon(string fileName, System.Drawing.Size size) { }
public Icon(string fileName, int width, int height) { }
public Icon(System.Type type, string resource) { }
[System.ComponentModel.BrowsableAttribute(false)]
public System.IntPtr Handle { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Height { get { throw null; } }
public System.Drawing.Size Size { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Width { get { throw null; } }
public object Clone() { throw null; }
public void Dispose() { }
public static System.Drawing.Icon ExtractAssociatedIcon(string filePath) { throw null; }
~Icon() { }
public static System.Drawing.Icon FromHandle(System.IntPtr handle) { throw null; }
public void Save(System.IO.Stream outputStream) { }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(128))]
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
public System.Drawing.Bitmap ToBitmap() { throw null; }
public override string ToString() { throw null; }
}
public partial class IconConverter : System.ComponentModel.ExpandableObjectConverter
{
public IconConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
}
public partial interface IDeviceContext : System.IDisposable
{
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
System.IntPtr GetHdc();
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(2))]
void ReleaseHdc();
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.ImageEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.ImmutableObjectAttribute(true)]
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.ImageConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
public abstract partial class Image : System.MarshalByRefObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
{
internal Image() { }
[System.ComponentModel.BrowsableAttribute(false)]
public int Flags { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Guid[] FrameDimensionsList { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public int Height { get { throw null; } }
public float HorizontalResolution { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.Imaging.ColorPalette Palette { get { throw null; } set { } }
public System.Drawing.SizeF PhysicalDimension { get { throw null; } }
public System.Drawing.Imaging.PixelFormat PixelFormat { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public int[] PropertyIdList { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.Imaging.PropertyItem[] PropertyItems { get { throw null; } }
public System.Drawing.Imaging.ImageFormat RawFormat { get { throw null; } }
public System.Drawing.Size Size { get { throw null; } }
[System.ComponentModel.BindableAttribute(true)]
[System.ComponentModel.DefaultValueAttribute(null)]
[System.ComponentModel.LocalizableAttribute(false)]
[System.ComponentModel.TypeConverterAttribute(typeof(System.ComponentModel.StringConverter))]
public object Tag { get { throw null; } set { } }
public float VerticalResolution { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public int Width { get { throw null; } }
public object Clone() { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~Image() { }
public static System.Drawing.Image FromFile(string filename) { throw null; }
public static System.Drawing.Image FromFile(string filename, bool useEmbeddedColorManagement) { throw null; }
public static System.Drawing.Bitmap FromHbitmap(System.IntPtr hbitmap) { throw null; }
public static System.Drawing.Bitmap FromHbitmap(System.IntPtr hbitmap, System.IntPtr hpalette) { throw null; }
public static System.Drawing.Image FromStream(System.IO.Stream stream) { throw null; }
public static System.Drawing.Image FromStream(System.IO.Stream stream, bool useEmbeddedColorManagement) { throw null; }
public static System.Drawing.Image FromStream(System.IO.Stream stream, bool useEmbeddedColorManagement, bool validateImageData) { throw null; }
public System.Drawing.RectangleF GetBounds(ref System.Drawing.GraphicsUnit pageUnit) { throw null; }
public System.Drawing.Imaging.EncoderParameters GetEncoderParameterList(System.Guid encoder) { throw null; }
public int GetFrameCount(System.Drawing.Imaging.FrameDimension dimension) { throw null; }
public static int GetPixelFormatSize(System.Drawing.Imaging.PixelFormat pixfmt) { throw null; }
public System.Drawing.Imaging.PropertyItem GetPropertyItem(int propid) { throw null; }
public System.Drawing.Image GetThumbnailImage(int thumbWidth, int thumbHeight, System.Drawing.Image.GetThumbnailImageAbort callback, System.IntPtr callbackData) { throw null; }
public static bool IsAlphaPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw null; }
public static bool IsCanonicalPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw null; }
public static bool IsExtendedPixelFormat(System.Drawing.Imaging.PixelFormat pixfmt) { throw null; }
public void RemovePropertyItem(int propid) { }
public void RotateFlip(System.Drawing.RotateFlipType rotateFlipType) { }
public void Save(System.IO.Stream stream, System.Drawing.Imaging.ImageCodecInfo encoder, System.Drawing.Imaging.EncoderParameters encoderParams) { }
public void Save(System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) { }
public void Save(string filename) { }
public void Save(string filename, System.Drawing.Imaging.ImageCodecInfo encoder, System.Drawing.Imaging.EncoderParameters encoderParams) { }
public void Save(string filename, System.Drawing.Imaging.ImageFormat format) { }
public void SaveAdd(System.Drawing.Image image, System.Drawing.Imaging.EncoderParameters encoderParams) { }
public void SaveAdd(System.Drawing.Imaging.EncoderParameters encoderParams) { }
public int SelectActiveFrame(System.Drawing.Imaging.FrameDimension dimension, int frameIndex) { throw null; }
public void SetPropertyItem(System.Drawing.Imaging.PropertyItem propitem) { }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(128))]
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
public delegate bool GetThumbnailImageAbort();
}
public sealed partial class ImageAnimator
{
internal ImageAnimator() { }
public static void Animate(System.Drawing.Image image, System.EventHandler onFrameChangedHandler) { }
public static bool CanAnimate(System.Drawing.Image image) { throw null; }
public static void StopAnimate(System.Drawing.Image image, System.EventHandler onFrameChangedHandler) { }
public static void UpdateFrames() { }
public static void UpdateFrames(System.Drawing.Image image) { }
}
public partial class ImageConverter : System.ComponentModel.TypeConverter
{
public ImageConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public partial class ImageFormatConverter : System.ComponentModel.TypeConverter
{
public ImageFormatConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public enum KnownColor
{
ActiveBorder = 1,
ActiveCaption = 2,
ActiveCaptionText = 3,
AliceBlue = 28,
AntiqueWhite = 29,
AppWorkspace = 4,
Aqua = 30,
Aquamarine = 31,
Azure = 32,
Beige = 33,
Bisque = 34,
Black = 35,
BlanchedAlmond = 36,
Blue = 37,
BlueViolet = 38,
Brown = 39,
BurlyWood = 40,
ButtonFace = 168,
ButtonHighlight = 169,
ButtonShadow = 170,
CadetBlue = 41,
Chartreuse = 42,
Chocolate = 43,
Control = 5,
ControlDark = 6,
ControlDarkDark = 7,
ControlLight = 8,
ControlLightLight = 9,
ControlText = 10,
Coral = 44,
CornflowerBlue = 45,
Cornsilk = 46,
Crimson = 47,
Cyan = 48,
DarkBlue = 49,
DarkCyan = 50,
DarkGoldenrod = 51,
DarkGray = 52,
DarkGreen = 53,
DarkKhaki = 54,
DarkMagenta = 55,
DarkOliveGreen = 56,
DarkOrange = 57,
DarkOrchid = 58,
DarkRed = 59,
DarkSalmon = 60,
DarkSeaGreen = 61,
DarkSlateBlue = 62,
DarkSlateGray = 63,
DarkTurquoise = 64,
DarkViolet = 65,
DeepPink = 66,
DeepSkyBlue = 67,
Desktop = 11,
DimGray = 68,
DodgerBlue = 69,
Firebrick = 70,
FloralWhite = 71,
ForestGreen = 72,
Fuchsia = 73,
Gainsboro = 74,
GhostWhite = 75,
Gold = 76,
Goldenrod = 77,
GradientActiveCaption = 171,
GradientInactiveCaption = 172,
Gray = 78,
GrayText = 12,
Green = 79,
GreenYellow = 80,
Highlight = 13,
HighlightText = 14,
Honeydew = 81,
HotPink = 82,
HotTrack = 15,
InactiveBorder = 16,
InactiveCaption = 17,
InactiveCaptionText = 18,
IndianRed = 83,
Indigo = 84,
Info = 19,
InfoText = 20,
Ivory = 85,
Khaki = 86,
Lavender = 87,
LavenderBlush = 88,
LawnGreen = 89,
LemonChiffon = 90,
LightBlue = 91,
LightCoral = 92,
LightCyan = 93,
LightGoldenrodYellow = 94,
LightGray = 95,
LightGreen = 96,
LightPink = 97,
LightSalmon = 98,
LightSeaGreen = 99,
LightSkyBlue = 100,
LightSlateGray = 101,
LightSteelBlue = 102,
LightYellow = 103,
Lime = 104,
LimeGreen = 105,
Linen = 106,
Magenta = 107,
Maroon = 108,
MediumAquamarine = 109,
MediumBlue = 110,
MediumOrchid = 111,
MediumPurple = 112,
MediumSeaGreen = 113,
MediumSlateBlue = 114,
MediumSpringGreen = 115,
MediumTurquoise = 116,
MediumVioletRed = 117,
Menu = 21,
MenuBar = 173,
MenuHighlight = 174,
MenuText = 22,
MidnightBlue = 118,
MintCream = 119,
MistyRose = 120,
Moccasin = 121,
NavajoWhite = 122,
Navy = 123,
OldLace = 124,
Olive = 125,
OliveDrab = 126,
Orange = 127,
OrangeRed = 128,
Orchid = 129,
PaleGoldenrod = 130,
PaleGreen = 131,
PaleTurquoise = 132,
PaleVioletRed = 133,
PapayaWhip = 134,
PeachPuff = 135,
Peru = 136,
Pink = 137,
Plum = 138,
PowderBlue = 139,
Purple = 140,
Red = 141,
RosyBrown = 142,
RoyalBlue = 143,
SaddleBrown = 144,
Salmon = 145,
SandyBrown = 146,
ScrollBar = 23,
SeaGreen = 147,
SeaShell = 148,
Sienna = 149,
Silver = 150,
SkyBlue = 151,
SlateBlue = 152,
SlateGray = 153,
Snow = 154,
SpringGreen = 155,
SteelBlue = 156,
Tan = 157,
Teal = 158,
Thistle = 159,
Tomato = 160,
Transparent = 27,
Turquoise = 161,
Violet = 162,
Wheat = 163,
White = 164,
WhiteSmoke = 165,
Window = 24,
WindowFrame = 25,
WindowText = 26,
Yellow = 166,
YellowGreen = 167,
}
public sealed partial class Pen : System.MarshalByRefObject, System.ICloneable, System.IDisposable
{
public Pen(System.Drawing.Brush brush) { }
public Pen(System.Drawing.Brush brush, float width) { }
public Pen(System.Drawing.Color color) { }
public Pen(System.Drawing.Color color, float width) { }
public System.Drawing.Drawing2D.PenAlignment Alignment { get { throw null; } set { } }
public System.Drawing.Brush Brush { get { throw null; } set { } }
public System.Drawing.Color Color { get { throw null; } set { } }
public float[] CompoundArray { get { throw null; } set { } }
public System.Drawing.Drawing2D.CustomLineCap CustomEndCap { get { throw null; } set { } }
public System.Drawing.Drawing2D.CustomLineCap CustomStartCap { get { throw null; } set { } }
public System.Drawing.Drawing2D.DashCap DashCap { get { throw null; } set { } }
public float DashOffset { get { throw null; } set { } }
public float[] DashPattern { get { throw null; } set { } }
public System.Drawing.Drawing2D.DashStyle DashStyle { get { throw null; } set { } }
public System.Drawing.Drawing2D.LineCap EndCap { get { throw null; } set { } }
public System.Drawing.Drawing2D.LineJoin LineJoin { get { throw null; } set { } }
public float MiterLimit { get { throw null; } set { } }
public System.Drawing.Drawing2D.PenType PenType { get { throw null; } }
public System.Drawing.Drawing2D.LineCap StartCap { get { throw null; } set { } }
public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } }
public float Width { get { throw null; } set { } }
public object Clone() { throw null; }
public void Dispose() { }
~Pen() { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix) { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ResetTransform() { }
public void RotateTransform(float angle) { }
public void RotateTransform(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ScaleTransform(float sx, float sy) { }
public void ScaleTransform(float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order) { }
public void SetLineCap(System.Drawing.Drawing2D.LineCap startCap, System.Drawing.Drawing2D.LineCap endCap, System.Drawing.Drawing2D.DashCap dashCap) { }
public void TranslateTransform(float dx, float dy) { }
public void TranslateTransform(float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order) { }
}
public sealed partial class Pens
{
internal Pens() { }
public static System.Drawing.Pen AliceBlue { get { throw null; } }
public static System.Drawing.Pen AntiqueWhite { get { throw null; } }
public static System.Drawing.Pen Aqua { get { throw null; } }
public static System.Drawing.Pen Aquamarine { get { throw null; } }
public static System.Drawing.Pen Azure { get { throw null; } }
public static System.Drawing.Pen Beige { get { throw null; } }
public static System.Drawing.Pen Bisque { get { throw null; } }
public static System.Drawing.Pen Black { get { throw null; } }
public static System.Drawing.Pen BlanchedAlmond { get { throw null; } }
public static System.Drawing.Pen Blue { get { throw null; } }
public static System.Drawing.Pen BlueViolet { get { throw null; } }
public static System.Drawing.Pen Brown { get { throw null; } }
public static System.Drawing.Pen BurlyWood { get { throw null; } }
public static System.Drawing.Pen CadetBlue { get { throw null; } }
public static System.Drawing.Pen Chartreuse { get { throw null; } }
public static System.Drawing.Pen Chocolate { get { throw null; } }
public static System.Drawing.Pen Coral { get { throw null; } }
public static System.Drawing.Pen CornflowerBlue { get { throw null; } }
public static System.Drawing.Pen Cornsilk { get { throw null; } }
public static System.Drawing.Pen Crimson { get { throw null; } }
public static System.Drawing.Pen Cyan { get { throw null; } }
public static System.Drawing.Pen DarkBlue { get { throw null; } }
public static System.Drawing.Pen DarkCyan { get { throw null; } }
public static System.Drawing.Pen DarkGoldenrod { get { throw null; } }
public static System.Drawing.Pen DarkGray { get { throw null; } }
public static System.Drawing.Pen DarkGreen { get { throw null; } }
public static System.Drawing.Pen DarkKhaki { get { throw null; } }
public static System.Drawing.Pen DarkMagenta { get { throw null; } }
public static System.Drawing.Pen DarkOliveGreen { get { throw null; } }
public static System.Drawing.Pen DarkOrange { get { throw null; } }
public static System.Drawing.Pen DarkOrchid { get { throw null; } }
public static System.Drawing.Pen DarkRed { get { throw null; } }
public static System.Drawing.Pen DarkSalmon { get { throw null; } }
public static System.Drawing.Pen DarkSeaGreen { get { throw null; } }
public static System.Drawing.Pen DarkSlateBlue { get { throw null; } }
public static System.Drawing.Pen DarkSlateGray { get { throw null; } }
public static System.Drawing.Pen DarkTurquoise { get { throw null; } }
public static System.Drawing.Pen DarkViolet { get { throw null; } }
public static System.Drawing.Pen DeepPink { get { throw null; } }
public static System.Drawing.Pen DeepSkyBlue { get { throw null; } }
public static System.Drawing.Pen DimGray { get { throw null; } }
public static System.Drawing.Pen DodgerBlue { get { throw null; } }
public static System.Drawing.Pen Firebrick { get { throw null; } }
public static System.Drawing.Pen FloralWhite { get { throw null; } }
public static System.Drawing.Pen ForestGreen { get { throw null; } }
public static System.Drawing.Pen Fuchsia { get { throw null; } }
public static System.Drawing.Pen Gainsboro { get { throw null; } }
public static System.Drawing.Pen GhostWhite { get { throw null; } }
public static System.Drawing.Pen Gold { get { throw null; } }
public static System.Drawing.Pen Goldenrod { get { throw null; } }
public static System.Drawing.Pen Gray { get { throw null; } }
public static System.Drawing.Pen Green { get { throw null; } }
public static System.Drawing.Pen GreenYellow { get { throw null; } }
public static System.Drawing.Pen Honeydew { get { throw null; } }
public static System.Drawing.Pen HotPink { get { throw null; } }
public static System.Drawing.Pen IndianRed { get { throw null; } }
public static System.Drawing.Pen Indigo { get { throw null; } }
public static System.Drawing.Pen Ivory { get { throw null; } }
public static System.Drawing.Pen Khaki { get { throw null; } }
public static System.Drawing.Pen Lavender { get { throw null; } }
public static System.Drawing.Pen LavenderBlush { get { throw null; } }
public static System.Drawing.Pen LawnGreen { get { throw null; } }
public static System.Drawing.Pen LemonChiffon { get { throw null; } }
public static System.Drawing.Pen LightBlue { get { throw null; } }
public static System.Drawing.Pen LightCoral { get { throw null; } }
public static System.Drawing.Pen LightCyan { get { throw null; } }
public static System.Drawing.Pen LightGoldenrodYellow { get { throw null; } }
public static System.Drawing.Pen LightGray { get { throw null; } }
public static System.Drawing.Pen LightGreen { get { throw null; } }
public static System.Drawing.Pen LightPink { get { throw null; } }
public static System.Drawing.Pen LightSalmon { get { throw null; } }
public static System.Drawing.Pen LightSeaGreen { get { throw null; } }
public static System.Drawing.Pen LightSkyBlue { get { throw null; } }
public static System.Drawing.Pen LightSlateGray { get { throw null; } }
public static System.Drawing.Pen LightSteelBlue { get { throw null; } }
public static System.Drawing.Pen LightYellow { get { throw null; } }
public static System.Drawing.Pen Lime { get { throw null; } }
public static System.Drawing.Pen LimeGreen { get { throw null; } }
public static System.Drawing.Pen Linen { get { throw null; } }
public static System.Drawing.Pen Magenta { get { throw null; } }
public static System.Drawing.Pen Maroon { get { throw null; } }
public static System.Drawing.Pen MediumAquamarine { get { throw null; } }
public static System.Drawing.Pen MediumBlue { get { throw null; } }
public static System.Drawing.Pen MediumOrchid { get { throw null; } }
public static System.Drawing.Pen MediumPurple { get { throw null; } }
public static System.Drawing.Pen MediumSeaGreen { get { throw null; } }
public static System.Drawing.Pen MediumSlateBlue { get { throw null; } }
public static System.Drawing.Pen MediumSpringGreen { get { throw null; } }
public static System.Drawing.Pen MediumTurquoise { get { throw null; } }
public static System.Drawing.Pen MediumVioletRed { get { throw null; } }
public static System.Drawing.Pen MidnightBlue { get { throw null; } }
public static System.Drawing.Pen MintCream { get { throw null; } }
public static System.Drawing.Pen MistyRose { get { throw null; } }
public static System.Drawing.Pen Moccasin { get { throw null; } }
public static System.Drawing.Pen NavajoWhite { get { throw null; } }
public static System.Drawing.Pen Navy { get { throw null; } }
public static System.Drawing.Pen OldLace { get { throw null; } }
public static System.Drawing.Pen Olive { get { throw null; } }
public static System.Drawing.Pen OliveDrab { get { throw null; } }
public static System.Drawing.Pen Orange { get { throw null; } }
public static System.Drawing.Pen OrangeRed { get { throw null; } }
public static System.Drawing.Pen Orchid { get { throw null; } }
public static System.Drawing.Pen PaleGoldenrod { get { throw null; } }
public static System.Drawing.Pen PaleGreen { get { throw null; } }
public static System.Drawing.Pen PaleTurquoise { get { throw null; } }
public static System.Drawing.Pen PaleVioletRed { get { throw null; } }
public static System.Drawing.Pen PapayaWhip { get { throw null; } }
public static System.Drawing.Pen PeachPuff { get { throw null; } }
public static System.Drawing.Pen Peru { get { throw null; } }
public static System.Drawing.Pen Pink { get { throw null; } }
public static System.Drawing.Pen Plum { get { throw null; } }
public static System.Drawing.Pen PowderBlue { get { throw null; } }
public static System.Drawing.Pen Purple { get { throw null; } }
public static System.Drawing.Pen Red { get { throw null; } }
public static System.Drawing.Pen RosyBrown { get { throw null; } }
public static System.Drawing.Pen RoyalBlue { get { throw null; } }
public static System.Drawing.Pen SaddleBrown { get { throw null; } }
public static System.Drawing.Pen Salmon { get { throw null; } }
public static System.Drawing.Pen SandyBrown { get { throw null; } }
public static System.Drawing.Pen SeaGreen { get { throw null; } }
public static System.Drawing.Pen SeaShell { get { throw null; } }
public static System.Drawing.Pen Sienna { get { throw null; } }
public static System.Drawing.Pen Silver { get { throw null; } }
public static System.Drawing.Pen SkyBlue { get { throw null; } }
public static System.Drawing.Pen SlateBlue { get { throw null; } }
public static System.Drawing.Pen SlateGray { get { throw null; } }
public static System.Drawing.Pen Snow { get { throw null; } }
public static System.Drawing.Pen SpringGreen { get { throw null; } }
public static System.Drawing.Pen SteelBlue { get { throw null; } }
public static System.Drawing.Pen Tan { get { throw null; } }
public static System.Drawing.Pen Teal { get { throw null; } }
public static System.Drawing.Pen Thistle { get { throw null; } }
public static System.Drawing.Pen Tomato { get { throw null; } }
public static System.Drawing.Pen Transparent { get { throw null; } }
public static System.Drawing.Pen Turquoise { get { throw null; } }
public static System.Drawing.Pen Violet { get { throw null; } }
public static System.Drawing.Pen Wheat { get { throw null; } }
public static System.Drawing.Pen White { get { throw null; } }
public static System.Drawing.Pen WhiteSmoke { get { throw null; } }
public static System.Drawing.Pen Yellow { get { throw null; } }
public static System.Drawing.Pen YellowGreen { get { throw null; } }
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.PointConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct Point
{
private int _dummyPrimitive;
public static readonly System.Drawing.Point Empty;
public Point(System.Drawing.Size sz) { throw null;}
public Point(int dw) { throw null;}
public Point(int x, int y) { throw null;}
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
public int X { get { throw null; } set { } }
public int Y { get { throw null; } set { } }
public static System.Drawing.Point Add(System.Drawing.Point pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.Point Ceiling(System.Drawing.PointF value) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public void Offset(System.Drawing.Point p) { }
public void Offset(int dx, int dy) { }
public static System.Drawing.Point operator +(System.Drawing.Point pt, System.Drawing.Size sz) { throw null; }
public static bool operator ==(System.Drawing.Point left, System.Drawing.Point right) { throw null; }
public static explicit operator System.Drawing.Size (System.Drawing.Point p) { throw null; }
public static implicit operator System.Drawing.PointF (System.Drawing.Point p) { throw null; }
public static bool operator !=(System.Drawing.Point left, System.Drawing.Point right) { throw null; }
public static System.Drawing.Point operator -(System.Drawing.Point pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.Point Round(System.Drawing.PointF value) { throw null; }
public static System.Drawing.Point Subtract(System.Drawing.Point pt, System.Drawing.Size sz) { throw null; }
public override string ToString() { throw null; }
public static System.Drawing.Point Truncate(System.Drawing.PointF value) { throw null; }
}
public partial class PointConverter : System.ComponentModel.TypeConverter
{
public PointConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct PointF
{
private int _dummyPrimitive;
public static readonly System.Drawing.PointF Empty;
public PointF(float x, float y) { throw null;}
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
public float X { get { throw null; } set { } }
public float Y { get { throw null; } set { } }
public static System.Drawing.PointF Add(System.Drawing.PointF pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.PointF Add(System.Drawing.PointF pt, System.Drawing.SizeF sz) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Drawing.PointF operator +(System.Drawing.PointF pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.PointF operator +(System.Drawing.PointF pt, System.Drawing.SizeF sz) { throw null; }
public static bool operator ==(System.Drawing.PointF left, System.Drawing.PointF right) { throw null; }
public static bool operator !=(System.Drawing.PointF left, System.Drawing.PointF right) { throw null; }
public static System.Drawing.PointF operator -(System.Drawing.PointF pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.PointF operator -(System.Drawing.PointF pt, System.Drawing.SizeF sz) { throw null; }
public static System.Drawing.PointF Subtract(System.Drawing.PointF pt, System.Drawing.Size sz) { throw null; }
public static System.Drawing.PointF Subtract(System.Drawing.PointF pt, System.Drawing.SizeF sz) { throw null; }
public override string ToString() { throw null; }
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.RectangleConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct Rectangle
{
private int _dummyPrimitive;
public static readonly System.Drawing.Rectangle Empty;
public Rectangle(System.Drawing.Point location, System.Drawing.Size size) { throw null;}
public Rectangle(int x, int y, int width, int height) { throw null;}
[System.ComponentModel.BrowsableAttribute(false)]
public int Bottom { get { throw null; } }
public int Height { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Left { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.Point Location { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Right { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.Size Size { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public int Top { get { throw null; } }
public int Width { get { throw null; } set { } }
public int X { get { throw null; } set { } }
public int Y { get { throw null; } set { } }
public static System.Drawing.Rectangle Ceiling(System.Drawing.RectangleF value) { throw null; }
public bool Contains(System.Drawing.Point pt) { throw null; }
public bool Contains(System.Drawing.Rectangle rect) { throw null; }
public bool Contains(int x, int y) { throw null; }
public override bool Equals(object obj) { throw null; }
public static System.Drawing.Rectangle FromLTRB(int left, int top, int right, int bottom) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Drawing.Rectangle Inflate(System.Drawing.Rectangle rect, int x, int y) { throw null; }
public void Inflate(System.Drawing.Size size) { }
public void Inflate(int width, int height) { }
public void Intersect(System.Drawing.Rectangle rect) { }
public static System.Drawing.Rectangle Intersect(System.Drawing.Rectangle a, System.Drawing.Rectangle b) { throw null; }
public bool IntersectsWith(System.Drawing.Rectangle rect) { throw null; }
public void Offset(System.Drawing.Point pos) { }
public void Offset(int x, int y) { }
public static bool operator ==(System.Drawing.Rectangle left, System.Drawing.Rectangle right) { throw null; }
public static bool operator !=(System.Drawing.Rectangle left, System.Drawing.Rectangle right) { throw null; }
public static System.Drawing.Rectangle Round(System.Drawing.RectangleF value) { throw null; }
public override string ToString() { throw null; }
public static System.Drawing.Rectangle Truncate(System.Drawing.RectangleF value) { throw null; }
public static System.Drawing.Rectangle Union(System.Drawing.Rectangle a, System.Drawing.Rectangle b) { throw null; }
}
public partial class RectangleConverter : System.ComponentModel.TypeConverter
{
public RectangleConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct RectangleF
{
private int _dummyPrimitive;
public static readonly System.Drawing.RectangleF Empty;
public RectangleF(System.Drawing.PointF location, System.Drawing.SizeF size) { throw null;}
public RectangleF(float x, float y, float width, float height) { throw null;}
[System.ComponentModel.BrowsableAttribute(false)]
public float Bottom { get { throw null; } }
public float Height { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public float Left { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.PointF Location { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public float Right { get { throw null; } }
[System.ComponentModel.BrowsableAttribute(false)]
public System.Drawing.SizeF Size { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public float Top { get { throw null; } }
public float Width { get { throw null; } set { } }
public float X { get { throw null; } set { } }
public float Y { get { throw null; } set { } }
public bool Contains(System.Drawing.PointF pt) { throw null; }
public bool Contains(System.Drawing.RectangleF rect) { throw null; }
public bool Contains(float x, float y) { throw null; }
public override bool Equals(object obj) { throw null; }
public static System.Drawing.RectangleF FromLTRB(float left, float top, float right, float bottom) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Drawing.RectangleF Inflate(System.Drawing.RectangleF rect, float x, float y) { throw null; }
public void Inflate(System.Drawing.SizeF size) { }
public void Inflate(float x, float y) { }
public void Intersect(System.Drawing.RectangleF rect) { }
public static System.Drawing.RectangleF Intersect(System.Drawing.RectangleF a, System.Drawing.RectangleF b) { throw null; }
public bool IntersectsWith(System.Drawing.RectangleF rect) { throw null; }
public void Offset(System.Drawing.PointF pos) { }
public void Offset(float x, float y) { }
public static bool operator ==(System.Drawing.RectangleF left, System.Drawing.RectangleF right) { throw null; }
public static implicit operator System.Drawing.RectangleF (System.Drawing.Rectangle r) { throw null; }
public static bool operator !=(System.Drawing.RectangleF left, System.Drawing.RectangleF right) { throw null; }
public override string ToString() { throw null; }
public static System.Drawing.RectangleF Union(System.Drawing.RectangleF a, System.Drawing.RectangleF b) { throw null; }
}
public sealed partial class Region : System.MarshalByRefObject, System.IDisposable
{
public Region() { }
public Region(System.Drawing.Drawing2D.GraphicsPath path) { }
public Region(System.Drawing.Drawing2D.RegionData rgnData) { }
public Region(System.Drawing.Rectangle rect) { }
public Region(System.Drawing.RectangleF rect) { }
public System.Drawing.Region Clone() { throw null; }
public void Complement(System.Drawing.Drawing2D.GraphicsPath path) { }
public void Complement(System.Drawing.Rectangle rect) { }
public void Complement(System.Drawing.RectangleF rect) { }
public void Complement(System.Drawing.Region region) { }
public void Dispose() { }
public bool Equals(System.Drawing.Region region, System.Drawing.Graphics g) { throw null; }
public void Exclude(System.Drawing.Drawing2D.GraphicsPath path) { }
public void Exclude(System.Drawing.Rectangle rect) { }
public void Exclude(System.Drawing.RectangleF rect) { }
public void Exclude(System.Drawing.Region region) { }
~Region() { }
public static System.Drawing.Region FromHrgn(System.IntPtr hrgn) { throw null; }
public System.Drawing.RectangleF GetBounds(System.Drawing.Graphics g) { throw null; }
public System.IntPtr GetHrgn(System.Drawing.Graphics g) { throw null; }
public System.Drawing.Drawing2D.RegionData GetRegionData() { throw null; }
public System.Drawing.RectangleF[] GetRegionScans(System.Drawing.Drawing2D.Matrix matrix) { throw null; }
public void Intersect(System.Drawing.Drawing2D.GraphicsPath path) { }
public void Intersect(System.Drawing.Rectangle rect) { }
public void Intersect(System.Drawing.RectangleF rect) { }
public void Intersect(System.Drawing.Region region) { }
public bool IsEmpty(System.Drawing.Graphics g) { throw null; }
public bool IsInfinite(System.Drawing.Graphics g) { throw null; }
public bool IsVisible(System.Drawing.Point point) { throw null; }
public bool IsVisible(System.Drawing.Point point, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(System.Drawing.PointF point) { throw null; }
public bool IsVisible(System.Drawing.PointF point, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(System.Drawing.Rectangle rect) { throw null; }
public bool IsVisible(System.Drawing.Rectangle rect, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(System.Drawing.RectangleF rect) { throw null; }
public bool IsVisible(System.Drawing.RectangleF rect, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(int x, int y, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(int x, int y, int width, int height) { throw null; }
public bool IsVisible(int x, int y, int width, int height, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(float x, float y) { throw null; }
public bool IsVisible(float x, float y, System.Drawing.Graphics g) { throw null; }
public bool IsVisible(float x, float y, float width, float height) { throw null; }
public bool IsVisible(float x, float y, float width, float height, System.Drawing.Graphics g) { throw null; }
public void MakeEmpty() { }
public void MakeInfinite() { }
public void ReleaseHrgn(System.IntPtr regionHandle) { }
public void Transform(System.Drawing.Drawing2D.Matrix matrix) { }
public void Translate(int dx, int dy) { }
public void Translate(float dx, float dy) { }
public void Union(System.Drawing.Drawing2D.GraphicsPath path) { }
public void Union(System.Drawing.Rectangle rect) { }
public void Union(System.Drawing.RectangleF rect) { }
public void Union(System.Drawing.Region region) { }
public void Xor(System.Drawing.Drawing2D.GraphicsPath path) { }
public void Xor(System.Drawing.Rectangle rect) { }
public void Xor(System.Drawing.RectangleF rect) { }
public void Xor(System.Drawing.Region region) { }
}
public enum RotateFlipType
{
Rotate180FlipNone = 2,
Rotate180FlipX = 6,
Rotate180FlipXY = 0,
Rotate180FlipY = 4,
Rotate270FlipNone = 3,
Rotate270FlipX = 7,
Rotate270FlipXY = 1,
Rotate270FlipY = 5,
Rotate90FlipNone = 1,
Rotate90FlipX = 5,
Rotate90FlipXY = 3,
Rotate90FlipY = 7,
RotateNoneFlipNone = 0,
RotateNoneFlipX = 4,
RotateNoneFlipXY = 2,
RotateNoneFlipY = 6,
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.SizeConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct Size
{
private int _dummyPrimitive;
public static readonly System.Drawing.Size Empty;
public Size(System.Drawing.Point pt) { throw null;}
public Size(int width, int height) { throw null;}
public int Height { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
public int Width { get { throw null; } set { } }
public static System.Drawing.Size Add(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public static System.Drawing.Size Ceiling(System.Drawing.SizeF value) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Drawing.Size operator +(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public static bool operator ==(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public static explicit operator System.Drawing.Point (System.Drawing.Size size) { throw null; }
public static implicit operator System.Drawing.SizeF (System.Drawing.Size p) { throw null; }
public static bool operator !=(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public static System.Drawing.Size operator -(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public static System.Drawing.Size Round(System.Drawing.SizeF value) { throw null; }
public static System.Drawing.Size Subtract(System.Drawing.Size sz1, System.Drawing.Size sz2) { throw null; }
public override string ToString() { throw null; }
public static System.Drawing.Size Truncate(System.Drawing.SizeF value) { throw null; }
}
public partial class SizeConverter : System.ComponentModel.TypeConverter
{
public SizeConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.SizeFConverter))]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
[System.SerializableAttribute]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public partial struct SizeF
{
private int _dummyPrimitive;
public static readonly System.Drawing.SizeF Empty;
public SizeF(System.Drawing.PointF pt) { throw null;}
public SizeF(System.Drawing.SizeF size) { throw null;}
public SizeF(float width, float height) { throw null;}
public float Height { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
public bool IsEmpty { get { throw null; } }
public float Width { get { throw null; } set { } }
public static System.Drawing.SizeF Add(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Drawing.SizeF operator +(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public static bool operator ==(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public static explicit operator System.Drawing.PointF (System.Drawing.SizeF size) { throw null; }
public static bool operator !=(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public static System.Drawing.SizeF operator -(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public static System.Drawing.SizeF Subtract(System.Drawing.SizeF sz1, System.Drawing.SizeF sz2) { throw null; }
public System.Drawing.PointF ToPointF() { throw null; }
public System.Drawing.Size ToSize() { throw null; }
public override string ToString() { throw null; }
}
public partial class SizeFConverter : System.ComponentModel.TypeConverter
{
public SizeFConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public sealed partial class SolidBrush : System.Drawing.Brush
{
public SolidBrush(System.Drawing.Color color) { }
public System.Drawing.Color Color { get { throw null; } set { } }
public override object Clone() { throw null; }
protected override void Dispose(bool disposing) { }
}
public enum StringAlignment
{
Center = 1,
Far = 2,
Near = 0,
}
public enum StringDigitSubstitute
{
National = 2,
None = 1,
Traditional = 3,
User = 0,
}
public sealed partial class StringFormat : System.MarshalByRefObject, System.ICloneable, System.IDisposable
{
public StringFormat() { }
public StringFormat(System.Drawing.StringFormat format) { }
public StringFormat(System.Drawing.StringFormatFlags options) { }
public StringFormat(System.Drawing.StringFormatFlags options, int language) { }
public System.Drawing.StringAlignment Alignment { get { throw null; } set { } }
public int DigitSubstitutionLanguage { get { throw null; } }
public System.Drawing.StringDigitSubstitute DigitSubstitutionMethod { get { throw null; } }
public System.Drawing.StringFormatFlags FormatFlags { get { throw null; } set { } }
public static System.Drawing.StringFormat GenericDefault { get { throw null; } }
public static System.Drawing.StringFormat GenericTypographic { get { throw null; } }
public System.Drawing.Text.HotkeyPrefix HotkeyPrefix { get { throw null; } set { } }
public System.Drawing.StringAlignment LineAlignment { get { throw null; } set { } }
public System.Drawing.StringTrimming Trimming { get { throw null; } set { } }
public object Clone() { throw null; }
public void Dispose() { }
~StringFormat() { }
public float[] GetTabStops(out float firstTabOffset) { firstTabOffset = default(float); throw null; }
public void SetDigitSubstitution(int language, System.Drawing.StringDigitSubstitute substitute) { }
public void SetMeasurableCharacterRanges(System.Drawing.CharacterRange[] ranges) { }
public void SetTabStops(float firstTabOffset, float[] tabStops) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum StringFormatFlags
{
DirectionRightToLeft = 1,
DirectionVertical = 2,
DisplayFormatControl = 32,
FitBlackBox = 4,
LineLimit = 8192,
MeasureTrailingSpaces = 2048,
NoClip = 16384,
NoFontFallback = 1024,
NoWrap = 4096,
}
public enum StringTrimming
{
Character = 1,
EllipsisCharacter = 3,
EllipsisPath = 5,
EllipsisWord = 4,
None = 0,
Word = 2,
}
public enum StringUnit
{
Display = 1,
Document = 5,
Em = 32,
Inch = 4,
Millimeter = 6,
Pixel = 2,
Point = 3,
World = 0,
}
public sealed partial class SystemBrushes
{
internal SystemBrushes() { }
public static System.Drawing.Brush ActiveBorder { get { throw null; } }
public static System.Drawing.Brush ActiveCaption { get { throw null; } }
public static System.Drawing.Brush ActiveCaptionText { get { throw null; } }
public static System.Drawing.Brush AppWorkspace { get { throw null; } }
public static System.Drawing.Brush ButtonFace { get { throw null; } }
public static System.Drawing.Brush ButtonHighlight { get { throw null; } }
public static System.Drawing.Brush ButtonShadow { get { throw null; } }
public static System.Drawing.Brush Control { get { throw null; } }
public static System.Drawing.Brush ControlDark { get { throw null; } }
public static System.Drawing.Brush ControlDarkDark { get { throw null; } }
public static System.Drawing.Brush ControlLight { get { throw null; } }
public static System.Drawing.Brush ControlLightLight { get { throw null; } }
public static System.Drawing.Brush ControlText { get { throw null; } }
public static System.Drawing.Brush Desktop { get { throw null; } }
public static System.Drawing.Brush GradientActiveCaption { get { throw null; } }
public static System.Drawing.Brush GradientInactiveCaption { get { throw null; } }
public static System.Drawing.Brush GrayText { get { throw null; } }
public static System.Drawing.Brush Highlight { get { throw null; } }
public static System.Drawing.Brush HighlightText { get { throw null; } }
public static System.Drawing.Brush HotTrack { get { throw null; } }
public static System.Drawing.Brush InactiveBorder { get { throw null; } }
public static System.Drawing.Brush InactiveCaption { get { throw null; } }
public static System.Drawing.Brush InactiveCaptionText { get { throw null; } }
public static System.Drawing.Brush Info { get { throw null; } }
public static System.Drawing.Brush InfoText { get { throw null; } }
public static System.Drawing.Brush Menu { get { throw null; } }
public static System.Drawing.Brush MenuBar { get { throw null; } }
public static System.Drawing.Brush MenuHighlight { get { throw null; } }
public static System.Drawing.Brush MenuText { get { throw null; } }
public static System.Drawing.Brush ScrollBar { get { throw null; } }
public static System.Drawing.Brush Window { get { throw null; } }
public static System.Drawing.Brush WindowFrame { get { throw null; } }
public static System.Drawing.Brush WindowText { get { throw null; } }
public static System.Drawing.Brush FromSystemColor(System.Drawing.Color c) { throw null; }
}
public sealed partial class SystemColors
{
internal SystemColors() { }
public static System.Drawing.Color ActiveBorder { get { throw null; } }
public static System.Drawing.Color ActiveCaption { get { throw null; } }
public static System.Drawing.Color ActiveCaptionText { get { throw null; } }
public static System.Drawing.Color AppWorkspace { get { throw null; } }
public static System.Drawing.Color ButtonFace { get { throw null; } }
public static System.Drawing.Color ButtonHighlight { get { throw null; } }
public static System.Drawing.Color ButtonShadow { get { throw null; } }
public static System.Drawing.Color Control { get { throw null; } }
public static System.Drawing.Color ControlDark { get { throw null; } }
public static System.Drawing.Color ControlDarkDark { get { throw null; } }
public static System.Drawing.Color ControlLight { get { throw null; } }
public static System.Drawing.Color ControlLightLight { get { throw null; } }
public static System.Drawing.Color ControlText { get { throw null; } }
public static System.Drawing.Color Desktop { get { throw null; } }
public static System.Drawing.Color GradientActiveCaption { get { throw null; } }
public static System.Drawing.Color GradientInactiveCaption { get { throw null; } }
public static System.Drawing.Color GrayText { get { throw null; } }
public static System.Drawing.Color Highlight { get { throw null; } }
public static System.Drawing.Color HighlightText { get { throw null; } }
public static System.Drawing.Color HotTrack { get { throw null; } }
public static System.Drawing.Color InactiveBorder { get { throw null; } }
public static System.Drawing.Color InactiveCaption { get { throw null; } }
public static System.Drawing.Color InactiveCaptionText { get { throw null; } }
public static System.Drawing.Color Info { get { throw null; } }
public static System.Drawing.Color InfoText { get { throw null; } }
public static System.Drawing.Color Menu { get { throw null; } }
public static System.Drawing.Color MenuBar { get { throw null; } }
public static System.Drawing.Color MenuHighlight { get { throw null; } }
public static System.Drawing.Color MenuText { get { throw null; } }
public static System.Drawing.Color ScrollBar { get { throw null; } }
public static System.Drawing.Color Window { get { throw null; } }
public static System.Drawing.Color WindowFrame { get { throw null; } }
public static System.Drawing.Color WindowText { get { throw null; } }
}
public sealed partial class SystemFonts
{
internal SystemFonts() { }
public static System.Drawing.Font CaptionFont { get { throw null; } }
public static System.Drawing.Font DefaultFont { get { throw null; } }
public static System.Drawing.Font DialogFont { get { throw null; } }
public static System.Drawing.Font IconTitleFont { get { throw null; } }
public static System.Drawing.Font MenuFont { get { throw null; } }
public static System.Drawing.Font MessageBoxFont { get { throw null; } }
public static System.Drawing.Font SmallCaptionFont { get { throw null; } }
public static System.Drawing.Font StatusFont { get { throw null; } }
public static System.Drawing.Font GetFontByName(string systemFontName) { throw null; }
}
public sealed partial class SystemIcons
{
internal SystemIcons() { }
public static System.Drawing.Icon Application { get { throw null; } }
public static System.Drawing.Icon Asterisk { get { throw null; } }
public static System.Drawing.Icon Error { get { throw null; } }
public static System.Drawing.Icon Exclamation { get { throw null; } }
public static System.Drawing.Icon Hand { get { throw null; } }
public static System.Drawing.Icon Information { get { throw null; } }
public static System.Drawing.Icon Question { get { throw null; } }
public static System.Drawing.Icon Shield { get { throw null; } }
public static System.Drawing.Icon Warning { get { throw null; } }
public static System.Drawing.Icon WinLogo { get { throw null; } }
}
public sealed partial class SystemPens
{
internal SystemPens() { }
public static System.Drawing.Pen ActiveBorder { get { throw null; } }
public static System.Drawing.Pen ActiveCaption { get { throw null; } }
public static System.Drawing.Pen ActiveCaptionText { get { throw null; } }
public static System.Drawing.Pen AppWorkspace { get { throw null; } }
public static System.Drawing.Pen ButtonFace { get { throw null; } }
public static System.Drawing.Pen ButtonHighlight { get { throw null; } }
public static System.Drawing.Pen ButtonShadow { get { throw null; } }
public static System.Drawing.Pen Control { get { throw null; } }
public static System.Drawing.Pen ControlDark { get { throw null; } }
public static System.Drawing.Pen ControlDarkDark { get { throw null; } }
public static System.Drawing.Pen ControlLight { get { throw null; } }
public static System.Drawing.Pen ControlLightLight { get { throw null; } }
public static System.Drawing.Pen ControlText { get { throw null; } }
public static System.Drawing.Pen Desktop { get { throw null; } }
public static System.Drawing.Pen GradientActiveCaption { get { throw null; } }
public static System.Drawing.Pen GradientInactiveCaption { get { throw null; } }
public static System.Drawing.Pen GrayText { get { throw null; } }
public static System.Drawing.Pen Highlight { get { throw null; } }
public static System.Drawing.Pen HighlightText { get { throw null; } }
public static System.Drawing.Pen HotTrack { get { throw null; } }
public static System.Drawing.Pen InactiveBorder { get { throw null; } }
public static System.Drawing.Pen InactiveCaption { get { throw null; } }
public static System.Drawing.Pen InactiveCaptionText { get { throw null; } }
public static System.Drawing.Pen Info { get { throw null; } }
public static System.Drawing.Pen InfoText { get { throw null; } }
public static System.Drawing.Pen Menu { get { throw null; } }
public static System.Drawing.Pen MenuBar { get { throw null; } }
public static System.Drawing.Pen MenuHighlight { get { throw null; } }
public static System.Drawing.Pen MenuText { get { throw null; } }
public static System.Drawing.Pen ScrollBar { get { throw null; } }
public static System.Drawing.Pen Window { get { throw null; } }
public static System.Drawing.Pen WindowFrame { get { throw null; } }
public static System.Drawing.Pen WindowText { get { throw null; } }
public static System.Drawing.Pen FromSystemColor(System.Drawing.Color c) { throw null; }
}
public sealed partial class TextureBrush : System.Drawing.Brush
{
public TextureBrush(System.Drawing.Image bitmap) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.Drawing2D.WrapMode wrapMode) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.Drawing2D.WrapMode wrapMode, System.Drawing.Rectangle dstRect) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.Drawing2D.WrapMode wrapMode, System.Drawing.RectangleF dstRect) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.Rectangle dstRect) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.Rectangle dstRect, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.RectangleF dstRect) { }
public TextureBrush(System.Drawing.Image image, System.Drawing.RectangleF dstRect, System.Drawing.Imaging.ImageAttributes imageAttr) { }
public System.Drawing.Image Image { get { throw null; } }
public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } }
public System.Drawing.Drawing2D.WrapMode WrapMode { get { throw null; } set { } }
public override object Clone() { throw null; }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix) { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ResetTransform() { }
public void RotateTransform(float angle) { }
public void RotateTransform(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ScaleTransform(float sx, float sy) { }
public void ScaleTransform(float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order) { }
public void TranslateTransform(float dx, float dy) { }
public void TranslateTransform(float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order) { }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(4))]
public partial class ToolboxBitmapAttribute : System.Attribute
{
public static readonly System.Drawing.ToolboxBitmapAttribute Default;
public ToolboxBitmapAttribute(string imageFile) { }
public ToolboxBitmapAttribute(System.Type t) { }
public ToolboxBitmapAttribute(System.Type t, string name) { }
public override bool Equals(object value) { throw null; }
public override int GetHashCode() { throw null; }
public System.Drawing.Image GetImage(object component) { throw null; }
public System.Drawing.Image GetImage(object component, bool large) { throw null; }
public System.Drawing.Image GetImage(System.Type type) { throw null; }
public System.Drawing.Image GetImage(System.Type type, bool large) { throw null; }
public System.Drawing.Image GetImage(System.Type type, string imgName, bool large) { throw null; }
public static System.Drawing.Image GetImageFromResource(System.Type t, string imageName, bool large) { throw null; }
}
}
#if CONFIG_DEP
namespace System.Drawing.Configuration
{
public sealed partial class SystemDrawingSection : System.Configuration.ConfigurationSection
{
public SystemDrawingSection() { }
[System.Configuration.ConfigurationPropertyAttribute("bitmapSuffix")]
public string BitmapSuffix { get { throw null; } set { } }
protected override System.Configuration.ConfigurationPropertyCollection Properties { get { throw null; } }
}
}
#endif
namespace System.Drawing.Design
{
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public sealed partial class CategoryNameCollection : System.Collections.ReadOnlyCollectionBase
{
public CategoryNameCollection(System.Drawing.Design.CategoryNameCollection value) { }
public CategoryNameCollection(string[] value) { }
public string this[int index] { get { throw null; } }
public bool Contains(string value) { throw null; }
public void CopyTo(string[] array, int index) { }
public int IndexOf(string value) { throw null; }
}
public partial interface IPropertyValueUIService
{
event System.EventHandler PropertyUIValueItemsChanged;
void AddPropertyValueUIHandler(System.Drawing.Design.PropertyValueUIHandler newHandler);
System.Drawing.Design.PropertyValueUIItem[] GetPropertyUIValueItems(System.ComponentModel.ITypeDescriptorContext context, System.ComponentModel.PropertyDescriptor propDesc);
void NotifyPropertyValueUIItemsChanged();
void RemovePropertyValueUIHandler(System.Drawing.Design.PropertyValueUIHandler newHandler);
}
public partial interface IToolboxItemProvider
{
System.Drawing.Design.ToolboxItemCollection Items { get; }
}
[System.Runtime.InteropServices.GuidAttribute("4BACD258-DE64-4048-BC4E-FEDBEF9ACB76")]
[System.Runtime.InteropServices.InterfaceTypeAttribute((System.Runtime.InteropServices.ComInterfaceType)(1))]
public partial interface IToolboxService
{
System.Drawing.Design.CategoryNameCollection CategoryNames { get; }
string SelectedCategory { get; set; }
void AddCreator(System.Drawing.Design.ToolboxItemCreatorCallback creator, string format);
void AddCreator(System.Drawing.Design.ToolboxItemCreatorCallback creator, string format, System.ComponentModel.Design.IDesignerHost host);
void AddLinkedToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem, System.ComponentModel.Design.IDesignerHost host);
void AddLinkedToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem, string category, System.ComponentModel.Design.IDesignerHost host);
void AddToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem);
void AddToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem, string category);
System.Drawing.Design.ToolboxItem DeserializeToolboxItem(object serializedObject);
System.Drawing.Design.ToolboxItem DeserializeToolboxItem(object serializedObject, System.ComponentModel.Design.IDesignerHost host);
System.Drawing.Design.ToolboxItem GetSelectedToolboxItem();
System.Drawing.Design.ToolboxItem GetSelectedToolboxItem(System.ComponentModel.Design.IDesignerHost host);
System.Drawing.Design.ToolboxItemCollection GetToolboxItems();
System.Drawing.Design.ToolboxItemCollection GetToolboxItems(System.ComponentModel.Design.IDesignerHost host);
System.Drawing.Design.ToolboxItemCollection GetToolboxItems(string category);
System.Drawing.Design.ToolboxItemCollection GetToolboxItems(string category, System.ComponentModel.Design.IDesignerHost host);
bool IsSupported(object serializedObject, System.Collections.ICollection filterAttributes);
bool IsSupported(object serializedObject, System.ComponentModel.Design.IDesignerHost host);
bool IsToolboxItem(object serializedObject);
bool IsToolboxItem(object serializedObject, System.ComponentModel.Design.IDesignerHost host);
void Refresh();
void RemoveCreator(string format);
void RemoveCreator(string format, System.ComponentModel.Design.IDesignerHost host);
void RemoveToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem);
void RemoveToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem, string category);
void SelectedToolboxItemUsed();
object SerializeToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem);
bool SetCursor();
void SetSelectedToolboxItem(System.Drawing.Design.ToolboxItem toolboxItem);
}
public partial interface IToolboxUser
{
bool GetToolSupported(System.Drawing.Design.ToolboxItem tool);
void ToolPicked(System.Drawing.Design.ToolboxItem tool);
}
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public partial class PaintValueEventArgs : System.EventArgs
{
public PaintValueEventArgs(System.ComponentModel.ITypeDescriptorContext context, object value, System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds) { }
public System.Drawing.Rectangle Bounds { get { throw null; } }
public System.ComponentModel.ITypeDescriptorContext Context { get { throw null; } }
public System.Drawing.Graphics Graphics { get { throw null; } }
public object Value { get { throw null; } }
}
public delegate void PropertyValueUIHandler(System.ComponentModel.ITypeDescriptorContext context, System.ComponentModel.PropertyDescriptor propDesc, System.Collections.ArrayList valueUIItemList);
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public partial class PropertyValueUIItem
{
public PropertyValueUIItem(System.Drawing.Image uiItemImage, System.Drawing.Design.PropertyValueUIItemInvokeHandler handler, string tooltip) { }
public virtual System.Drawing.Image Image { get { throw null; } }
public virtual System.Drawing.Design.PropertyValueUIItemInvokeHandler InvokeHandler { get { throw null; } }
public virtual string ToolTip { get { throw null; } }
public virtual void Reset() { }
}
public delegate void PropertyValueUIItemInvokeHandler(System.ComponentModel.ITypeDescriptorContext context, System.ComponentModel.PropertyDescriptor descriptor, System.Drawing.Design.PropertyValueUIItem invokedItem);
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public partial class ToolboxComponentsCreatedEventArgs : System.EventArgs
{
public ToolboxComponentsCreatedEventArgs(System.ComponentModel.IComponent[] components) { }
public System.ComponentModel.IComponent[] Components { get { throw null; } }
}
public delegate void ToolboxComponentsCreatedEventHandler(object sender, System.Drawing.Design.ToolboxComponentsCreatedEventArgs e);
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public partial class ToolboxComponentsCreatingEventArgs : System.EventArgs
{
public ToolboxComponentsCreatingEventArgs(System.ComponentModel.Design.IDesignerHost host) { }
public System.ComponentModel.Design.IDesignerHost DesignerHost { get { throw null; } }
}
public delegate void ToolboxComponentsCreatingEventHandler(object sender, System.Drawing.Design.ToolboxComponentsCreatingEventArgs e);
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
[System.SerializableAttribute]
public partial class ToolboxItem : System.Runtime.Serialization.ISerializable
{
public ToolboxItem() { }
public ToolboxItem(System.Type toolType) { }
public System.Reflection.AssemblyName AssemblyName { get { throw null; } set { } }
public System.Drawing.Bitmap Bitmap { get { throw null; } set { } }
public string Company { get { throw null; } set { } }
public virtual string ComponentType { get { throw null; } }
public System.Reflection.AssemblyName[] DependentAssemblies { get { throw null; } set { } }
public string Description { get { throw null; } set { } }
public string DisplayName { get { throw null; } set { } }
public System.Collections.ICollection Filter { get { throw null; } set { } }
public bool IsTransient { get { throw null; } set { } }
public virtual bool Locked { get { throw null; } }
public System.Drawing.Bitmap OriginalBitmap { get { throw null; } set { } }
public System.Collections.IDictionary Properties { get { throw null; } }
public string TypeName { get { throw null; } set { } }
public virtual string Version { get { throw null; } }
public event System.Drawing.Design.ToolboxComponentsCreatedEventHandler ComponentsCreated { add { } remove { } }
public event System.Drawing.Design.ToolboxComponentsCreatingEventHandler ComponentsCreating { add { } remove { } }
protected void CheckUnlocked() { }
public System.ComponentModel.IComponent[] CreateComponents() { throw null; }
public System.ComponentModel.IComponent[] CreateComponents(System.ComponentModel.Design.IDesignerHost host) { throw null; }
public System.ComponentModel.IComponent[] CreateComponents(System.ComponentModel.Design.IDesignerHost host, System.Collections.IDictionary defaultValues) { throw null; }
protected virtual System.ComponentModel.IComponent[] CreateComponentsCore(System.ComponentModel.Design.IDesignerHost host) { throw null; }
protected virtual System.ComponentModel.IComponent[] CreateComponentsCore(System.ComponentModel.Design.IDesignerHost host, System.Collections.IDictionary defaultValues) { throw null; }
protected virtual void Deserialize(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override bool Equals(object obj) { throw null; }
protected virtual object FilterPropertyValue(string propertyName, object value) { throw null; }
public override int GetHashCode() { throw null; }
public System.Type GetType(System.ComponentModel.Design.IDesignerHost host) { throw null; }
protected virtual System.Type GetType(System.ComponentModel.Design.IDesignerHost host, System.Reflection.AssemblyName assemblyName, string typeName, bool reference) { throw null; }
public virtual void Initialize(System.Type type) { }
public virtual void Lock() { }
protected virtual void OnComponentsCreated(System.Drawing.Design.ToolboxComponentsCreatedEventArgs args) { }
protected virtual void OnComponentsCreating(System.Drawing.Design.ToolboxComponentsCreatingEventArgs args) { }
protected virtual void Serialize(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
protected void ValidatePropertyType(string propertyName, object value, System.Type expectedType, bool allowNull) { }
protected virtual object ValidatePropertyValue(string propertyName, object value) { throw null; }
}
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public sealed partial class ToolboxItemCollection : System.Collections.ReadOnlyCollectionBase
{
public ToolboxItemCollection(System.Drawing.Design.ToolboxItemCollection value) { }
public ToolboxItemCollection(System.Drawing.Design.ToolboxItem[] value) { }
public System.Drawing.Design.ToolboxItem this[int index] { get { throw null; } }
public bool Contains(System.Drawing.Design.ToolboxItem value) { throw null; }
public void CopyTo(System.Drawing.Design.ToolboxItem[] array, int index) { }
public int IndexOf(System.Drawing.Design.ToolboxItem value) { throw null; }
}
public delegate System.Drawing.Design.ToolboxItem ToolboxItemCreatorCallback(object serializedObject, string format);
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public partial class UITypeEditor
{
public UITypeEditor() { }
public virtual bool IsDropDownResizable { get { throw null; } }
public virtual object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { throw null; }
public object EditValue(System.IServiceProvider provider, object value) { throw null; }
public System.Drawing.Design.UITypeEditorEditStyle GetEditStyle() { throw null; }
public virtual System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public bool GetPaintValueSupported() { throw null; }
public virtual bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public virtual void PaintValue(System.Drawing.Design.PaintValueEventArgs e) { }
public void PaintValue(object value, System.Drawing.Graphics canvas, System.Drawing.Rectangle rectangle) { }
}
public enum UITypeEditorEditStyle
{
DropDown = 3,
Modal = 2,
None = 1,
}
}
namespace System.Drawing.Drawing2D
{
public sealed partial class AdjustableArrowCap : System.Drawing.Drawing2D.CustomLineCap
{
public AdjustableArrowCap(float width, float height) : base (default(System.Drawing.Drawing2D.GraphicsPath), default(System.Drawing.Drawing2D.GraphicsPath)) { }
public AdjustableArrowCap(float width, float height, bool isFilled) : base (default(System.Drawing.Drawing2D.GraphicsPath), default(System.Drawing.Drawing2D.GraphicsPath)) { }
public bool Filled { get { throw null; } set { } }
public float Height { get { throw null; } set { } }
public float MiddleInset { get { throw null; } set { } }
public float Width { get { throw null; } set { } }
}
public sealed partial class Blend
{
public Blend() { }
public Blend(int count) { }
public float[] Factors { get { throw null; } set { } }
public float[] Positions { get { throw null; } set { } }
}
public sealed partial class ColorBlend
{
public ColorBlend() { }
public ColorBlend(int count) { }
public System.Drawing.Color[] Colors { get { throw null; } set { } }
public float[] Positions { get { throw null; } set { } }
}
public enum CombineMode
{
Complement = 5,
Exclude = 4,
Intersect = 1,
Replace = 0,
Union = 2,
Xor = 3,
}
public enum CompositingMode
{
SourceCopy = 1,
SourceOver = 0,
}
public enum CompositingQuality
{
AssumeLinear = 4,
Default = 0,
GammaCorrected = 3,
HighQuality = 2,
HighSpeed = 1,
Invalid = -1,
}
public enum CoordinateSpace
{
Device = 2,
Page = 1,
World = 0,
}
public partial class CustomLineCap : System.MarshalByRefObject, System.ICloneable, System.IDisposable
{
public CustomLineCap(System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath) { }
public CustomLineCap(System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath, System.Drawing.Drawing2D.LineCap baseCap) { }
public CustomLineCap(System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath, System.Drawing.Drawing2D.LineCap baseCap, float baseInset) { }
public System.Drawing.Drawing2D.LineCap BaseCap { get { throw null; } set { } }
public float BaseInset { get { throw null; } set { } }
public System.Drawing.Drawing2D.LineJoin StrokeJoin { get { throw null; } set { } }
public float WidthScale { get { throw null; } set { } }
public object Clone() { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~CustomLineCap() { }
public void GetStrokeCaps(out System.Drawing.Drawing2D.LineCap startCap, out System.Drawing.Drawing2D.LineCap endCap) { startCap = default(System.Drawing.Drawing2D.LineCap); endCap = default(System.Drawing.Drawing2D.LineCap); }
public void SetStrokeCaps(System.Drawing.Drawing2D.LineCap startCap, System.Drawing.Drawing2D.LineCap endCap) { }
}
public enum DashCap
{
Flat = 0,
Round = 2,
Triangle = 3,
}
public enum DashStyle
{
Custom = 5,
Dash = 1,
DashDot = 3,
DashDotDot = 4,
Dot = 2,
Solid = 0,
}
public enum FillMode
{
Alternate = 0,
Winding = 1,
}
public enum FlushIntention
{
Flush = 0,
Sync = 1,
}
public sealed partial class GraphicsContainer : System.MarshalByRefObject
{
internal GraphicsContainer() { }
}
public sealed partial class GraphicsPath : System.MarshalByRefObject, System.ICloneable, System.IDisposable
{
public GraphicsPath() { }
public GraphicsPath(System.Drawing.Drawing2D.FillMode fillMode) { }
public GraphicsPath(System.Drawing.PointF[] pts, byte[] types) { }
public GraphicsPath(System.Drawing.PointF[] pts, byte[] types, System.Drawing.Drawing2D.FillMode fillMode) { }
public GraphicsPath(System.Drawing.Point[] pts, byte[] types) { }
public GraphicsPath(System.Drawing.Point[] pts, byte[] types, System.Drawing.Drawing2D.FillMode fillMode) { }
public System.Drawing.Drawing2D.FillMode FillMode { get { throw null; } set { } }
public System.Drawing.Drawing2D.PathData PathData { get { throw null; } }
public System.Drawing.PointF[] PathPoints { get { throw null; } }
public byte[] PathTypes { get { throw null; } }
public int PointCount { get { throw null; } }
public void AddArc(System.Drawing.Rectangle rect, float startAngle, float sweepAngle) { }
public void AddArc(System.Drawing.RectangleF rect, float startAngle, float sweepAngle) { }
public void AddArc(int x, int y, int width, int height, float startAngle, float sweepAngle) { }
public void AddArc(float x, float y, float width, float height, float startAngle, float sweepAngle) { }
public void AddBezier(System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4) { }
public void AddBezier(System.Drawing.PointF pt1, System.Drawing.PointF pt2, System.Drawing.PointF pt3, System.Drawing.PointF pt4) { }
public void AddBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { }
public void AddBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) { }
public void AddBeziers(System.Drawing.PointF[] points) { }
public void AddBeziers(params System.Drawing.Point[] points) { }
public void AddClosedCurve(System.Drawing.PointF[] points) { }
public void AddClosedCurve(System.Drawing.PointF[] points, float tension) { }
public void AddClosedCurve(System.Drawing.Point[] points) { }
public void AddClosedCurve(System.Drawing.Point[] points, float tension) { }
public void AddCurve(System.Drawing.PointF[] points) { }
public void AddCurve(System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension) { }
public void AddCurve(System.Drawing.PointF[] points, float tension) { }
public void AddCurve(System.Drawing.Point[] points) { }
public void AddCurve(System.Drawing.Point[] points, int offset, int numberOfSegments, float tension) { }
public void AddCurve(System.Drawing.Point[] points, float tension) { }
public void AddEllipse(System.Drawing.Rectangle rect) { }
public void AddEllipse(System.Drawing.RectangleF rect) { }
public void AddEllipse(int x, int y, int width, int height) { }
public void AddEllipse(float x, float y, float width, float height) { }
public void AddLine(System.Drawing.Point pt1, System.Drawing.Point pt2) { }
public void AddLine(System.Drawing.PointF pt1, System.Drawing.PointF pt2) { }
public void AddLine(int x1, int y1, int x2, int y2) { }
public void AddLine(float x1, float y1, float x2, float y2) { }
public void AddLines(System.Drawing.PointF[] points) { }
public void AddLines(System.Drawing.Point[] points) { }
public void AddPath(System.Drawing.Drawing2D.GraphicsPath addingPath, bool connect) { }
public void AddPie(System.Drawing.Rectangle rect, float startAngle, float sweepAngle) { }
public void AddPie(int x, int y, int width, int height, float startAngle, float sweepAngle) { }
public void AddPie(float x, float y, float width, float height, float startAngle, float sweepAngle) { }
public void AddPolygon(System.Drawing.PointF[] points) { }
public void AddPolygon(System.Drawing.Point[] points) { }
public void AddRectangle(System.Drawing.Rectangle rect) { }
public void AddRectangle(System.Drawing.RectangleF rect) { }
public void AddRectangles(System.Drawing.RectangleF[] rects) { }
public void AddRectangles(System.Drawing.Rectangle[] rects) { }
public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.Point origin, System.Drawing.StringFormat format) { }
public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.PointF origin, System.Drawing.StringFormat format) { }
public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.Rectangle layoutRect, System.Drawing.StringFormat format) { }
public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat format) { }
public void ClearMarkers() { }
public object Clone() { throw null; }
public void CloseAllFigures() { }
public void CloseFigure() { }
public void Dispose() { }
~GraphicsPath() { }
public void Flatten() { }
public void Flatten(System.Drawing.Drawing2D.Matrix matrix) { }
public void Flatten(System.Drawing.Drawing2D.Matrix matrix, float flatness) { }
public System.Drawing.RectangleF GetBounds() { throw null; }
public System.Drawing.RectangleF GetBounds(System.Drawing.Drawing2D.Matrix matrix) { throw null; }
public System.Drawing.RectangleF GetBounds(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Pen pen) { throw null; }
public System.Drawing.PointF GetLastPoint() { throw null; }
public bool IsOutlineVisible(System.Drawing.Point point, System.Drawing.Pen pen) { throw null; }
public bool IsOutlineVisible(System.Drawing.Point pt, System.Drawing.Pen pen, System.Drawing.Graphics graphics) { throw null; }
public bool IsOutlineVisible(System.Drawing.PointF point, System.Drawing.Pen pen) { throw null; }
public bool IsOutlineVisible(System.Drawing.PointF pt, System.Drawing.Pen pen, System.Drawing.Graphics graphics) { throw null; }
public bool IsOutlineVisible(int x, int y, System.Drawing.Pen pen) { throw null; }
public bool IsOutlineVisible(int x, int y, System.Drawing.Pen pen, System.Drawing.Graphics graphics) { throw null; }
public bool IsOutlineVisible(float x, float y, System.Drawing.Pen pen) { throw null; }
public bool IsOutlineVisible(float x, float y, System.Drawing.Pen pen, System.Drawing.Graphics graphics) { throw null; }
public bool IsVisible(System.Drawing.Point point) { throw null; }
public bool IsVisible(System.Drawing.Point pt, System.Drawing.Graphics graphics) { throw null; }
public bool IsVisible(System.Drawing.PointF point) { throw null; }
public bool IsVisible(System.Drawing.PointF pt, System.Drawing.Graphics graphics) { throw null; }
public bool IsVisible(int x, int y) { throw null; }
public bool IsVisible(int x, int y, System.Drawing.Graphics graphics) { throw null; }
public bool IsVisible(float x, float y) { throw null; }
public bool IsVisible(float x, float y, System.Drawing.Graphics graphics) { throw null; }
public void Reset() { }
public void Reverse() { }
public void SetMarkers() { }
public void StartFigure() { }
public void Transform(System.Drawing.Drawing2D.Matrix matrix) { }
public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect) { }
public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix) { }
public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.WarpMode warpMode) { }
public void Warp(System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.WarpMode warpMode, float flatness) { }
public void Widen(System.Drawing.Pen pen) { }
public void Widen(System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix) { }
public void Widen(System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix, float flatness) { }
}
public sealed partial class GraphicsPathIterator : System.MarshalByRefObject, System.IDisposable
{
public GraphicsPathIterator(System.Drawing.Drawing2D.GraphicsPath path) { }
public int Count { get { throw null; } }
public int SubpathCount { get { throw null; } }
public int CopyData(ref System.Drawing.PointF[] points, ref byte[] types, int startIndex, int endIndex) { throw null; }
public void Dispose() { }
public int Enumerate(ref System.Drawing.PointF[] points, ref byte[] types) { throw null; }
~GraphicsPathIterator() { }
public bool HasCurve() { throw null; }
public int NextMarker(System.Drawing.Drawing2D.GraphicsPath path) { throw null; }
public int NextMarker(out int startIndex, out int endIndex) { startIndex = default(int); endIndex = default(int); throw null; }
public int NextPathType(out byte pathType, out int startIndex, out int endIndex) { pathType = default(byte); startIndex = default(int); endIndex = default(int); throw null; }
public int NextSubpath(System.Drawing.Drawing2D.GraphicsPath path, out bool isClosed) { isClosed = default(bool); throw null; }
public int NextSubpath(out int startIndex, out int endIndex, out bool isClosed) { startIndex = default(int); endIndex = default(int); isClosed = default(bool); throw null; }
public void Rewind() { }
}
public sealed partial class GraphicsState : System.MarshalByRefObject
{
internal GraphicsState() { }
}
public sealed partial class HatchBrush : System.Drawing.Brush
{
public HatchBrush(System.Drawing.Drawing2D.HatchStyle hatchstyle, System.Drawing.Color foreColor) { }
public HatchBrush(System.Drawing.Drawing2D.HatchStyle hatchstyle, System.Drawing.Color foreColor, System.Drawing.Color backColor) { }
public System.Drawing.Color BackgroundColor { get { throw null; } }
public System.Drawing.Color ForegroundColor { get { throw null; } }
public System.Drawing.Drawing2D.HatchStyle HatchStyle { get { throw null; } }
public override object Clone() { throw null; }
}
public enum HatchStyle
{
BackwardDiagonal = 3,
Cross = 4,
DarkDownwardDiagonal = 20,
DarkHorizontal = 29,
DarkUpwardDiagonal = 21,
DarkVertical = 28,
DashedDownwardDiagonal = 30,
DashedHorizontal = 32,
DashedUpwardDiagonal = 31,
DashedVertical = 33,
DiagonalBrick = 38,
DiagonalCross = 5,
Divot = 42,
DottedDiamond = 44,
DottedGrid = 43,
ForwardDiagonal = 2,
Horizontal = 0,
HorizontalBrick = 39,
LargeCheckerBoard = 50,
LargeConfetti = 35,
LargeGrid = 4,
LightDownwardDiagonal = 18,
LightHorizontal = 25,
LightUpwardDiagonal = 19,
LightVertical = 24,
Max = 4,
Min = 0,
NarrowHorizontal = 27,
NarrowVertical = 26,
OutlinedDiamond = 51,
Percent05 = 6,
Percent10 = 7,
Percent20 = 8,
Percent25 = 9,
Percent30 = 10,
Percent40 = 11,
Percent50 = 12,
Percent60 = 13,
Percent70 = 14,
Percent75 = 15,
Percent80 = 16,
Percent90 = 17,
Plaid = 41,
Shingle = 45,
SmallCheckerBoard = 49,
SmallConfetti = 34,
SmallGrid = 48,
SolidDiamond = 52,
Sphere = 47,
Trellis = 46,
Vertical = 1,
Wave = 37,
Weave = 40,
WideDownwardDiagonal = 22,
WideUpwardDiagonal = 23,
ZigZag = 36,
}
public enum InterpolationMode
{
Bicubic = 4,
Bilinear = 3,
Default = 0,
High = 2,
HighQualityBicubic = 7,
HighQualityBilinear = 6,
Invalid = -1,
Low = 1,
NearestNeighbor = 5,
}
public sealed partial class LinearGradientBrush : System.Drawing.Brush
{
public LinearGradientBrush(System.Drawing.Point point1, System.Drawing.Point point2, System.Drawing.Color color1, System.Drawing.Color color2) { }
public LinearGradientBrush(System.Drawing.PointF point1, System.Drawing.PointF point2, System.Drawing.Color color1, System.Drawing.Color color2) { }
public LinearGradientBrush(System.Drawing.Rectangle rect, System.Drawing.Color color1, System.Drawing.Color color2, System.Drawing.Drawing2D.LinearGradientMode linearGradientMode) { }
public LinearGradientBrush(System.Drawing.Rectangle rect, System.Drawing.Color color1, System.Drawing.Color color2, float angle) { }
public LinearGradientBrush(System.Drawing.Rectangle rect, System.Drawing.Color color1, System.Drawing.Color color2, float angle, bool isAngleScaleable) { }
public LinearGradientBrush(System.Drawing.RectangleF rect, System.Drawing.Color color1, System.Drawing.Color color2, System.Drawing.Drawing2D.LinearGradientMode linearGradientMode) { }
public LinearGradientBrush(System.Drawing.RectangleF rect, System.Drawing.Color color1, System.Drawing.Color color2, float angle) { }
public LinearGradientBrush(System.Drawing.RectangleF rect, System.Drawing.Color color1, System.Drawing.Color color2, float angle, bool isAngleScaleable) { }
public System.Drawing.Drawing2D.Blend Blend { get { throw null; } set { } }
public bool GammaCorrection { get { throw null; } set { } }
public System.Drawing.Drawing2D.ColorBlend InterpolationColors { get { throw null; } set { } }
public System.Drawing.Color[] LinearColors { get { throw null; } set { } }
public System.Drawing.RectangleF Rectangle { get { throw null; } }
public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } }
public System.Drawing.Drawing2D.WrapMode WrapMode { get { throw null; } set { } }
public override object Clone() { throw null; }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix) { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ResetTransform() { }
public void RotateTransform(float angle) { }
public void RotateTransform(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ScaleTransform(float sx, float sy) { }
public void ScaleTransform(float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order) { }
public void SetBlendTriangularShape(float focus) { }
public void SetBlendTriangularShape(float focus, float scale) { }
public void SetSigmaBellShape(float focus) { }
public void SetSigmaBellShape(float focus, float scale) { }
public void TranslateTransform(float dx, float dy) { }
public void TranslateTransform(float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order) { }
}
public enum LinearGradientMode
{
BackwardDiagonal = 3,
ForwardDiagonal = 2,
Horizontal = 0,
Vertical = 1,
}
public enum LineCap
{
AnchorMask = 240,
ArrowAnchor = 20,
Custom = 255,
DiamondAnchor = 19,
Flat = 0,
NoAnchor = 16,
Round = 2,
RoundAnchor = 18,
Square = 1,
SquareAnchor = 17,
Triangle = 3,
}
public enum LineJoin
{
Bevel = 1,
Miter = 0,
MiterClipped = 3,
Round = 2,
}
public sealed partial class Matrix : System.MarshalByRefObject, System.IDisposable
{
public Matrix() { }
public Matrix(System.Drawing.Rectangle rect, System.Drawing.Point[] plgpts) { }
public Matrix(System.Drawing.RectangleF rect, System.Drawing.PointF[] plgpts) { }
public Matrix(float m11, float m12, float m21, float m22, float dx, float dy) { }
public float[] Elements { get { throw null; } }
public bool IsIdentity { get { throw null; } }
public bool IsInvertible { get { throw null; } }
public float OffsetX { get { throw null; } }
public float OffsetY { get { throw null; } }
public System.Drawing.Drawing2D.Matrix Clone() { throw null; }
public void Dispose() { }
public override bool Equals(object obj) { throw null; }
~Matrix() { }
public override int GetHashCode() { throw null; }
public void Invert() { }
public void Multiply(System.Drawing.Drawing2D.Matrix matrix) { }
public void Multiply(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
public void Reset() { }
public void Rotate(float angle) { }
public void Rotate(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public void RotateAt(float angle, System.Drawing.PointF point) { }
public void RotateAt(float angle, System.Drawing.PointF point, System.Drawing.Drawing2D.MatrixOrder order) { }
public void Scale(float scaleX, float scaleY) { }
public void Scale(float scaleX, float scaleY, System.Drawing.Drawing2D.MatrixOrder order) { }
public void Shear(float shearX, float shearY) { }
public void Shear(float shearX, float shearY, System.Drawing.Drawing2D.MatrixOrder order) { }
public void TransformPoints(System.Drawing.PointF[] pts) { }
public void TransformPoints(System.Drawing.Point[] pts) { }
public void TransformVectors(System.Drawing.PointF[] pts) { }
public void TransformVectors(System.Drawing.Point[] pts) { }
public void Translate(float offsetX, float offsetY) { }
public void Translate(float offsetX, float offsetY, System.Drawing.Drawing2D.MatrixOrder order) { }
public void VectorTransformPoints(System.Drawing.Point[] pts) { }
}
public enum MatrixOrder
{
Append = 1,
Prepend = 0,
}
public sealed partial class PathData
{
public PathData() { }
public System.Drawing.PointF[] Points { get { throw null; } set { } }
public byte[] Types { get { throw null; } set { } }
}
public sealed partial class PathGradientBrush : System.Drawing.Brush
{
public PathGradientBrush(System.Drawing.Drawing2D.GraphicsPath path) { }
public PathGradientBrush(System.Drawing.PointF[] points) { }
public PathGradientBrush(System.Drawing.PointF[] points, System.Drawing.Drawing2D.WrapMode wrapMode) { }
public PathGradientBrush(System.Drawing.Point[] points) { }
public PathGradientBrush(System.Drawing.Point[] points, System.Drawing.Drawing2D.WrapMode wrapMode) { }
public System.Drawing.Drawing2D.Blend Blend { get { throw null; } set { } }
public System.Drawing.Color CenterColor { get { throw null; } set { } }
public System.Drawing.PointF CenterPoint { get { throw null; } set { } }
public System.Drawing.PointF FocusScales { get { throw null; } set { } }
public System.Drawing.Drawing2D.ColorBlend InterpolationColors { get { throw null; } set { } }
public System.Drawing.RectangleF Rectangle { get { throw null; } }
public System.Drawing.Color[] SurroundColors { get { throw null; } set { } }
public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } }
public System.Drawing.Drawing2D.WrapMode WrapMode { get { throw null; } set { } }
public override object Clone() { throw null; }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix) { }
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ResetTransform() { }
public void RotateTransform(float angle) { }
public void RotateTransform(float angle, System.Drawing.Drawing2D.MatrixOrder order) { }
public void ScaleTransform(float sx, float sy) { }
public void ScaleTransform(float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order) { }
public void SetBlendTriangularShape(float focus) { }
public void SetBlendTriangularShape(float focus, float scale) { }
public void SetSigmaBellShape(float focus) { }
public void SetSigmaBellShape(float focus, float scale) { }
public void TranslateTransform(float dx, float dy) { }
public void TranslateTransform(float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order) { }
}
public enum PathPointType
{
Bezier = 3,
Bezier3 = 3,
CloseSubpath = 128,
DashMode = 16,
Line = 1,
PathMarker = 32,
PathTypeMask = 7,
Start = 0,
}
public enum PenAlignment
{
Center = 0,
Inset = 1,
Left = 3,
Outset = 2,
Right = 4,
}
public enum PenType
{
HatchFill = 1,
LinearGradient = 4,
PathGradient = 3,
SolidColor = 0,
TextureFill = 2,
}
public enum PixelOffsetMode
{
Default = 0,
Half = 4,
HighQuality = 2,
HighSpeed = 1,
Invalid = -1,
None = 3,
}
public enum QualityMode
{
Default = 0,
High = 2,
Invalid = -1,
Low = 1,
}
public sealed partial class RegionData
{
internal RegionData() { }
public byte[] Data { get { throw null; } set { } }
}
public enum SmoothingMode
{
AntiAlias = 4,
Default = 0,
HighQuality = 2,
HighSpeed = 1,
Invalid = -1,
None = 3,
}
public enum WarpMode
{
Bilinear = 1,
Perspective = 0,
}
public enum WrapMode
{
Clamp = 4,
Tile = 0,
TileFlipX = 1,
TileFlipXY = 3,
TileFlipY = 2,
}
}
namespace System.Drawing.Imaging
{
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class BitmapData
{
public BitmapData() { }
public int Height { get { throw null; } set { } }
public System.Drawing.Imaging.PixelFormat PixelFormat { get { throw null; } set { } }
public int Reserved { get { throw null; } set { } }
public System.IntPtr Scan0 { get { throw null; } set { } }
public int Stride { get { throw null; } set { } }
public int Width { get { throw null; } set { } }
}
public enum ColorAdjustType
{
Any = 6,
Bitmap = 1,
Brush = 2,
Count = 5,
Default = 0,
Pen = 3,
Text = 4,
}
public enum ColorChannelFlag
{
ColorChannelC = 0,
ColorChannelK = 3,
ColorChannelLast = 4,
ColorChannelM = 1,
ColorChannelY = 2,
}
public sealed partial class ColorMap
{
public ColorMap() { }
public System.Drawing.Color NewColor { get { throw null; } set { } }
public System.Drawing.Color OldColor { get { throw null; } set { } }
}
public enum ColorMapType
{
Brush = 1,
Default = 0,
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class ColorMatrix
{
public ColorMatrix() { }
[System.CLSCompliantAttribute(false)]
public ColorMatrix(float[][] newColorMatrix) { }
public float this[int row, int column] { get { throw null; } set { } }
public float Matrix00 { get { throw null; } set { } }
public float Matrix01 { get { throw null; } set { } }
public float Matrix02 { get { throw null; } set { } }
public float Matrix03 { get { throw null; } set { } }
public float Matrix04 { get { throw null; } set { } }
public float Matrix10 { get { throw null; } set { } }
public float Matrix11 { get { throw null; } set { } }
public float Matrix12 { get { throw null; } set { } }
public float Matrix13 { get { throw null; } set { } }
public float Matrix14 { get { throw null; } set { } }
public float Matrix20 { get { throw null; } set { } }
public float Matrix21 { get { throw null; } set { } }
public float Matrix22 { get { throw null; } set { } }
public float Matrix23 { get { throw null; } set { } }
public float Matrix24 { get { throw null; } set { } }
public float Matrix30 { get { throw null; } set { } }
public float Matrix31 { get { throw null; } set { } }
public float Matrix32 { get { throw null; } set { } }
public float Matrix33 { get { throw null; } set { } }
public float Matrix34 { get { throw null; } set { } }
public float Matrix40 { get { throw null; } set { } }
public float Matrix41 { get { throw null; } set { } }
public float Matrix42 { get { throw null; } set { } }
public float Matrix43 { get { throw null; } set { } }
public float Matrix44 { get { throw null; } set { } }
}
public enum ColorMatrixFlag
{
AltGrays = 2,
Default = 0,
SkipGrays = 1,
}
public enum ColorMode
{
Argb32Mode = 0,
Argb64Mode = 1,
}
public sealed partial class ColorPalette
{
internal ColorPalette() { }
public System.Drawing.Color[] Entries { get { throw null; } }
public int Flags { get { throw null; } }
}
public enum EmfPlusRecordType
{
BeginContainer = 16423,
BeginContainerNoParams = 16424,
Clear = 16393,
Comment = 16387,
DrawArc = 16402,
DrawBeziers = 16409,
DrawClosedCurve = 16407,
DrawCurve = 16408,
DrawDriverString = 16438,
DrawEllipse = 16399,
DrawImage = 16410,
DrawImagePoints = 16411,
DrawLines = 16397,
DrawPath = 16405,
DrawPie = 16401,
DrawRects = 16395,
DrawString = 16412,
EmfAbortPath = 68,
EmfAlphaBlend = 114,
EmfAngleArc = 41,
EmfArcTo = 55,
EmfBeginPath = 59,
EmfBitBlt = 76,
EmfChord = 46,
EmfCloseFigure = 61,
EmfColorCorrectPalette = 111,
EmfColorMatchToTargetW = 121,
EmfCreateBrushIndirect = 39,
EmfCreateColorSpace = 99,
EmfCreateColorSpaceW = 122,
EmfCreateDibPatternBrushPt = 94,
EmfCreateMonoBrush = 93,
EmfCreatePalette = 49,
EmfCreatePen = 38,
EmfDeleteColorSpace = 101,
EmfDeleteObject = 40,
EmfDrawEscape = 105,
EmfEllipse = 42,
EmfEndPath = 60,
EmfEof = 14,
EmfExcludeClipRect = 29,
EmfExtCreateFontIndirect = 82,
EmfExtCreatePen = 95,
EmfExtEscape = 106,
EmfExtFloodFill = 53,
EmfExtSelectClipRgn = 75,
EmfExtTextOutA = 83,
EmfExtTextOutW = 84,
EmfFillPath = 62,
EmfFillRgn = 71,
EmfFlattenPath = 65,
EmfForceUfiMapping = 109,
EmfFrameRgn = 72,
EmfGdiComment = 70,
EmfGlsBoundedRecord = 103,
EmfGlsRecord = 102,
EmfGradientFill = 118,
EmfHeader = 1,
EmfIntersectClipRect = 30,
EmfInvertRgn = 73,
EmfLineTo = 54,
EmfMaskBlt = 78,
EmfMax = 122,
EmfMin = 1,
EmfModifyWorldTransform = 36,
EmfMoveToEx = 27,
EmfNamedEscpae = 110,
EmfOffsetClipRgn = 26,
EmfPaintRgn = 74,
EmfPie = 47,
EmfPixelFormat = 104,
EmfPlgBlt = 79,
EmfPlusRecordBase = 16384,
EmfPolyBezier = 2,
EmfPolyBezier16 = 85,
EmfPolyBezierTo = 5,
EmfPolyBezierTo16 = 88,
EmfPolyDraw = 56,
EmfPolyDraw16 = 92,
EmfPolygon = 3,
EmfPolygon16 = 86,
EmfPolyline = 4,
EmfPolyline16 = 87,
EmfPolyLineTo = 6,
EmfPolylineTo16 = 89,
EmfPolyPolygon = 8,
EmfPolyPolygon16 = 91,
EmfPolyPolyline = 7,
EmfPolyPolyline16 = 90,
EmfPolyTextOutA = 96,
EmfPolyTextOutW = 97,
EmfRealizePalette = 52,
EmfRectangle = 43,
EmfReserved069 = 69,
EmfReserved117 = 117,
EmfResizePalette = 51,
EmfRestoreDC = 34,
EmfRoundArc = 45,
EmfRoundRect = 44,
EmfSaveDC = 33,
EmfScaleViewportExtEx = 31,
EmfScaleWindowExtEx = 32,
EmfSelectClipPath = 67,
EmfSelectObject = 37,
EmfSelectPalette = 48,
EmfSetArcDirection = 57,
EmfSetBkColor = 25,
EmfSetBkMode = 18,
EmfSetBrushOrgEx = 13,
EmfSetColorAdjustment = 23,
EmfSetColorSpace = 100,
EmfSetDIBitsToDevice = 80,
EmfSetIcmMode = 98,
EmfSetIcmProfileA = 112,
EmfSetIcmProfileW = 113,
EmfSetLayout = 115,
EmfSetLinkedUfis = 119,
EmfSetMapMode = 17,
EmfSetMapperFlags = 16,
EmfSetMetaRgn = 28,
EmfSetMiterLimit = 58,
EmfSetPaletteEntries = 50,
EmfSetPixelV = 15,
EmfSetPolyFillMode = 19,
EmfSetROP2 = 20,
EmfSetStretchBltMode = 21,
EmfSetTextAlign = 22,
EmfSetTextColor = 24,
EmfSetTextJustification = 120,
EmfSetViewportExtEx = 11,
EmfSetViewportOrgEx = 12,
EmfSetWindowExtEx = 9,
EmfSetWindowOrgEx = 10,
EmfSetWorldTransform = 35,
EmfSmallTextOut = 108,
EmfStartDoc = 107,
EmfStretchBlt = 77,
EmfStretchDIBits = 81,
EmfStrokeAndFillPath = 63,
EmfStrokePath = 64,
EmfTransparentBlt = 116,
EmfWidenPath = 66,
EndContainer = 16425,
EndOfFile = 16386,
FillClosedCurve = 16406,
FillEllipse = 16398,
FillPath = 16404,
FillPie = 16400,
FillPolygon = 16396,
FillRects = 16394,
FillRegion = 16403,
GetDC = 16388,
Header = 16385,
Invalid = 16384,
Max = 16438,
Min = 16385,
MultiFormatEnd = 16391,
MultiFormatSection = 16390,
MultiFormatStart = 16389,
MultiplyWorldTransform = 16428,
Object = 16392,
OffsetClip = 16437,
ResetClip = 16433,
ResetWorldTransform = 16427,
Restore = 16422,
RotateWorldTransform = 16431,
Save = 16421,
ScaleWorldTransform = 16430,
SetAntiAliasMode = 16414,
SetClipPath = 16435,
SetClipRect = 16434,
SetClipRegion = 16436,
SetCompositingMode = 16419,
SetCompositingQuality = 16420,
SetInterpolationMode = 16417,
SetPageTransform = 16432,
SetPixelOffsetMode = 16418,
SetRenderingOrigin = 16413,
SetTextContrast = 16416,
SetTextRenderingHint = 16415,
SetWorldTransform = 16426,
Total = 16439,
TranslateWorldTransform = 16429,
WmfAnimatePalette = 66614,
WmfArc = 67607,
WmfBitBlt = 67874,
WmfChord = 67632,
WmfCreateBrushIndirect = 66300,
WmfCreateFontIndirect = 66299,
WmfCreatePalette = 65783,
WmfCreatePatternBrush = 66041,
WmfCreatePenIndirect = 66298,
WmfCreateRegion = 67327,
WmfDeleteObject = 66032,
WmfDibBitBlt = 67904,
WmfDibCreatePatternBrush = 65858,
WmfDibStretchBlt = 68417,
WmfEllipse = 66584,
WmfEscape = 67110,
WmfExcludeClipRect = 66581,
WmfExtFloodFill = 66888,
WmfExtTextOut = 68146,
WmfFillRegion = 66088,
WmfFloodFill = 66585,
WmfFrameRegion = 66601,
WmfIntersectClipRect = 66582,
WmfInvertRegion = 65834,
WmfLineTo = 66067,
WmfMoveTo = 66068,
WmfOffsetCilpRgn = 66080,
WmfOffsetViewportOrg = 66065,
WmfOffsetWindowOrg = 66063,
WmfPaintRegion = 65835,
WmfPatBlt = 67101,
WmfPie = 67610,
WmfPolygon = 66340,
WmfPolyline = 66341,
WmfPolyPolygon = 66872,
WmfRealizePalette = 65589,
WmfRecordBase = 65536,
WmfRectangle = 66587,
WmfResizePalette = 65849,
WmfRestoreDC = 65831,
WmfRoundRect = 67100,
WmfSaveDC = 65566,
WmfScaleViewportExt = 66578,
WmfScaleWindowExt = 66576,
WmfSelectClipRegion = 65836,
WmfSelectObject = 65837,
WmfSelectPalette = 66100,
WmfSetBkColor = 66049,
WmfSetBkMode = 65794,
WmfSetDibToDev = 68915,
WmfSetLayout = 65865,
WmfSetMapMode = 65795,
WmfSetMapperFlags = 66097,
WmfSetPalEntries = 65591,
WmfSetPixel = 66591,
WmfSetPolyFillMode = 65798,
WmfSetRelAbs = 65797,
WmfSetROP2 = 65796,
WmfSetStretchBltMode = 65799,
WmfSetTextAlign = 65838,
WmfSetTextCharExtra = 65800,
WmfSetTextColor = 66057,
WmfSetTextJustification = 66058,
WmfSetViewportExt = 66062,
WmfSetViewportOrg = 66061,
WmfSetWindowExt = 66060,
WmfSetWindowOrg = 66059,
WmfStretchBlt = 68387,
WmfStretchDib = 69443,
WmfTextOut = 66849,
}
public enum EmfType
{
EmfOnly = 3,
EmfPlusDual = 5,
EmfPlusOnly = 4,
}
public sealed partial class Encoder
{
public static readonly System.Drawing.Imaging.Encoder ChrominanceTable;
public static readonly System.Drawing.Imaging.Encoder ColorDepth;
public static readonly System.Drawing.Imaging.Encoder Compression;
public static readonly System.Drawing.Imaging.Encoder LuminanceTable;
public static readonly System.Drawing.Imaging.Encoder Quality;
public static readonly System.Drawing.Imaging.Encoder RenderMethod;
public static readonly System.Drawing.Imaging.Encoder SaveFlag;
public static readonly System.Drawing.Imaging.Encoder ScanMethod;
public static readonly System.Drawing.Imaging.Encoder Transformation;
public static readonly System.Drawing.Imaging.Encoder Version;
public Encoder(System.Guid guid) { }
public System.Guid Guid { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class EncoderParameter : System.IDisposable
{
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, byte value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, byte value, bool undefined) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, byte[] value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, byte[] value, bool undefined) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, short value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, short[] value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int numberValues, System.Drawing.Imaging.EncoderParameterValueType type, System.IntPtr value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int numerator, int denominator) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use EncoderParameter(Encoder encoder, int numberValues, EncoderParameterValueType type, IntPtr value) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int NumberOfValues, int Type, int Value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int[] numerator, int[] denominator) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, long value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, long rangebegin, long rangeend) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, long[] value) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, long[] rangebegin, long[] rangeend) { }
public EncoderParameter(System.Drawing.Imaging.Encoder encoder, string value) { }
public System.Drawing.Imaging.Encoder Encoder { get { throw null; } set { } }
public int NumberOfValues { get { throw null; } }
public System.Drawing.Imaging.EncoderParameterValueType Type { get { throw null; } }
public System.Drawing.Imaging.EncoderParameterValueType ValueType { get { throw null; } }
public void Dispose() { }
~EncoderParameter() { }
}
public sealed partial class EncoderParameters : System.IDisposable
{
public EncoderParameters() { }
public EncoderParameters(int count) { }
public System.Drawing.Imaging.EncoderParameter[] Param { get { throw null; } set { } }
public void Dispose() { }
}
public enum EncoderParameterValueType
{
ValueTypeAscii = 2,
ValueTypeByte = 1,
ValueTypeLong = 4,
ValueTypeLongRange = 6,
ValueTypeRational = 5,
ValueTypeRationalRange = 8,
ValueTypeShort = 3,
ValueTypeUndefined = 7,
}
public enum EncoderValue
{
ColorTypeCMYK = 0,
ColorTypeYCCK = 1,
CompressionCCITT3 = 3,
CompressionCCITT4 = 4,
CompressionLZW = 2,
CompressionNone = 6,
CompressionRle = 5,
Flush = 20,
FrameDimensionPage = 23,
FrameDimensionResolution = 22,
FrameDimensionTime = 21,
LastFrame = 19,
MultiFrame = 18,
RenderNonProgressive = 12,
RenderProgressive = 11,
ScanMethodInterlaced = 7,
ScanMethodNonInterlaced = 8,
TransformFlipHorizontal = 16,
TransformFlipVertical = 17,
TransformRotate180 = 14,
TransformRotate270 = 15,
TransformRotate90 = 13,
VersionGif87 = 9,
VersionGif89 = 10,
}
public sealed partial class FrameDimension
{
public FrameDimension(System.Guid guid) { }
public System.Guid Guid { get { throw null; } }
public static System.Drawing.Imaging.FrameDimension Page { get { throw null; } }
public static System.Drawing.Imaging.FrameDimension Resolution { get { throw null; } }
public static System.Drawing.Imaging.FrameDimension Time { get { throw null; } }
public override bool Equals(object o) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class ImageAttributes : System.ICloneable, System.IDisposable
{
public ImageAttributes() { }
public void ClearBrushRemapTable() { }
public void ClearColorKey() { }
public void ClearColorKey(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearColorMatrix() { }
public void ClearColorMatrix(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearGamma() { }
public void ClearGamma(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearNoOp() { }
public void ClearNoOp(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearOutputChannel() { }
public void ClearOutputChannel(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearOutputChannelColorProfile() { }
public void ClearOutputChannelColorProfile(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearRemapTable() { }
public void ClearRemapTable(System.Drawing.Imaging.ColorAdjustType type) { }
public void ClearThreshold() { }
public void ClearThreshold(System.Drawing.Imaging.ColorAdjustType type) { }
public object Clone() { throw null; }
public void Dispose() { }
~ImageAttributes() { }
public void GetAdjustedPalette(System.Drawing.Imaging.ColorPalette palette, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetBrushRemapTable(System.Drawing.Imaging.ColorMap[] map) { }
public void SetColorKey(System.Drawing.Color colorLow, System.Drawing.Color colorHigh) { }
public void SetColorKey(System.Drawing.Color colorLow, System.Drawing.Color colorHigh, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetColorMatrices(System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix) { }
public void SetColorMatrices(System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix, System.Drawing.Imaging.ColorMatrixFlag flags) { }
public void SetColorMatrices(System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix, System.Drawing.Imaging.ColorMatrixFlag mode, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetColorMatrix(System.Drawing.Imaging.ColorMatrix newColorMatrix) { }
public void SetColorMatrix(System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrixFlag flags) { }
public void SetColorMatrix(System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrixFlag mode, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetGamma(float gamma) { }
public void SetGamma(float gamma, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetNoOp() { }
public void SetNoOp(System.Drawing.Imaging.ColorAdjustType type) { }
public void SetOutputChannel(System.Drawing.Imaging.ColorChannelFlag flags) { }
public void SetOutputChannel(System.Drawing.Imaging.ColorChannelFlag flags, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetOutputChannelColorProfile(string colorProfileFilename) { }
public void SetOutputChannelColorProfile(string colorProfileFilename, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetRemapTable(System.Drawing.Imaging.ColorMap[] map) { }
public void SetRemapTable(System.Drawing.Imaging.ColorMap[] map, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetThreshold(float threshold) { }
public void SetThreshold(float threshold, System.Drawing.Imaging.ColorAdjustType type) { }
public void SetWrapMode(System.Drawing.Drawing2D.WrapMode mode) { }
public void SetWrapMode(System.Drawing.Drawing2D.WrapMode mode, System.Drawing.Color color) { }
public void SetWrapMode(System.Drawing.Drawing2D.WrapMode mode, System.Drawing.Color color, bool clamp) { }
}
[System.FlagsAttribute]
public enum ImageCodecFlags
{
BlockingDecode = 32,
Builtin = 65536,
Decoder = 2,
Encoder = 1,
SeekableEncode = 16,
SupportBitmap = 4,
SupportVector = 8,
System = 131072,
User = 262144,
}
public sealed partial class ImageCodecInfo
{
internal ImageCodecInfo() { }
public System.Guid Clsid { get { throw null; } set { } }
public string CodecName { get { throw null; } set { } }
public string DllName { get { throw null; } set { } }
public string FilenameExtension { get { throw null; } set { } }
public System.Drawing.Imaging.ImageCodecFlags Flags { get { throw null; } set { } }
public string FormatDescription { get { throw null; } set { } }
public System.Guid FormatID { get { throw null; } set { } }
public string MimeType { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
public byte[][] SignatureMasks { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
public byte[][] SignaturePatterns { get { throw null; } set { } }
public int Version { get { throw null; } set { } }
public static System.Drawing.Imaging.ImageCodecInfo[] GetImageDecoders() { throw null; }
public static System.Drawing.Imaging.ImageCodecInfo[] GetImageEncoders() { throw null; }
}
[System.FlagsAttribute]
public enum ImageFlags
{
Caching = 131072,
ColorSpaceCmyk = 32,
ColorSpaceGray = 64,
ColorSpaceRgb = 16,
ColorSpaceYcbcr = 128,
ColorSpaceYcck = 256,
HasAlpha = 2,
HasRealDpi = 4096,
HasRealPixelSize = 8192,
HasTranslucent = 4,
None = 0,
PartiallyScalable = 8,
ReadOnly = 65536,
Scalable = 1,
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.ImageFormatConverter))]
public sealed partial class ImageFormat
{
public ImageFormat(System.Guid guid) { }
public static System.Drawing.Imaging.ImageFormat Bmp { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Emf { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Exif { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Gif { get { throw null; } }
public System.Guid Guid { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Icon { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Jpeg { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat MemoryBmp { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Png { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Tiff { get { throw null; } }
public static System.Drawing.Imaging.ImageFormat Wmf { get { throw null; } }
public override bool Equals(object o) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public enum ImageLockMode
{
ReadOnly = 1,
ReadWrite = 3,
UserInputBuffer = 4,
WriteOnly = 2,
}
[System.ComponentModel.EditorAttribute("System.Drawing.Design.MetafileEditor, System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.SerializableAttribute]
public sealed partial class Metafile : System.Drawing.Image
{
public Metafile(System.IntPtr henhmetafile, bool deleteEmf) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType, string description) { }
public Metafile(System.IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader) { }
public Metafile(System.IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader, bool deleteWmf) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string desc) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(System.IO.Stream stream) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType type) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(System.IO.Stream stream, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(string filename) { }
public Metafile(string fileName, System.IntPtr referenceHdc) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType type) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string description) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description) { }
public Metafile(string fileName, System.IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string desc) { }
public System.IntPtr GetHenhmetafile() { throw null; }
public System.Drawing.Imaging.MetafileHeader GetMetafileHeader() { throw null; }
public static System.Drawing.Imaging.MetafileHeader GetMetafileHeader(System.IntPtr henhmetafile) { throw null; }
public static System.Drawing.Imaging.MetafileHeader GetMetafileHeader(System.IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader) { throw null; }
public static System.Drawing.Imaging.MetafileHeader GetMetafileHeader(System.IO.Stream stream) { throw null; }
public static System.Drawing.Imaging.MetafileHeader GetMetafileHeader(string fileName) { throw null; }
public void PlayRecord(System.Drawing.Imaging.EmfPlusRecordType recordType, int flags, int dataSize, byte[] data) { }
}
public enum MetafileFrameUnit
{
Document = 5,
GdiCompatible = 7,
Inch = 4,
Millimeter = 6,
Pixel = 2,
Point = 3,
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class MetafileHeader
{
internal MetafileHeader() { }
public System.Drawing.Rectangle Bounds { get { throw null; } }
public float DpiX { get { throw null; } }
public float DpiY { get { throw null; } }
public int EmfPlusHeaderSize { get { throw null; } }
public int LogicalDpiX { get { throw null; } }
public int LogicalDpiY { get { throw null; } }
public int MetafileSize { get { throw null; } }
public System.Drawing.Imaging.MetafileType Type { get { throw null; } }
public int Version { get { throw null; } }
public System.Drawing.Imaging.MetaHeader WmfHeader { get { throw null; } }
public bool IsDisplay() { throw null; }
public bool IsEmf() { throw null; }
public bool IsEmfOrEmfPlus() { throw null; }
public bool IsEmfPlus() { throw null; }
public bool IsEmfPlusDual() { throw null; }
public bool IsEmfPlusOnly() { throw null; }
public bool IsWmf() { throw null; }
public bool IsWmfPlaceable() { throw null; }
}
public enum MetafileType
{
Emf = 3,
EmfPlusDual = 5,
EmfPlusOnly = 4,
Invalid = 0,
Wmf = 1,
WmfPlaceable = 2,
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack=2)]
public sealed partial class MetaHeader
{
public MetaHeader() { }
public short HeaderSize { get { throw null; } set { } }
public int MaxRecord { get { throw null; } set { } }
public short NoObjects { get { throw null; } set { } }
public short NoParameters { get { throw null; } set { } }
public int Size { get { throw null; } set { } }
public short Type { get { throw null; } set { } }
public short Version { get { throw null; } set { } }
}
[System.FlagsAttribute]
public enum PaletteFlags
{
GrayScale = 2,
Halftone = 4,
HasAlpha = 1,
}
public enum PixelFormat
{
Alpha = 262144,
Canonical = 2097152,
DontCare = 0,
Extended = 1048576,
Format16bppArgb1555 = 397319,
Format16bppGrayScale = 1052676,
Format16bppRgb555 = 135173,
Format16bppRgb565 = 135174,
Format1bppIndexed = 196865,
Format24bppRgb = 137224,
Format32bppArgb = 2498570,
Format32bppPArgb = 925707,
Format32bppRgb = 139273,
Format48bppRgb = 1060876,
Format4bppIndexed = 197634,
Format64bppArgb = 3424269,
Format64bppPArgb = 1851406,
Format8bppIndexed = 198659,
Gdi = 131072,
Indexed = 65536,
Max = 15,
PAlpha = 524288,
Undefined = 0,
}
public delegate void PlayRecordCallback(System.Drawing.Imaging.EmfPlusRecordType recordType, int flags, int dataSize, System.IntPtr recordData);
public sealed partial class PropertyItem
{
internal PropertyItem() { }
public int Id { get { throw null; } set { } }
public int Len { get { throw null; } set { } }
public short Type { get { throw null; } set { } }
public byte[] Value { get { throw null; } set { } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public sealed partial class WmfPlaceableFileHeader
{
public WmfPlaceableFileHeader() { }
public short BboxBottom { get { throw null; } set { } }
public short BboxLeft { get { throw null; } set { } }
public short BboxRight { get { throw null; } set { } }
public short BboxTop { get { throw null; } set { } }
public short Checksum { get { throw null; } set { } }
public short Hmf { get { throw null; } set { } }
public short Inch { get { throw null; } set { } }
public int Key { get { throw null; } set { } }
public int Reserved { get { throw null; } set { } }
}
}
namespace System.Drawing.Printing
{
[System.SerializableAttribute]
public enum Duplex
{
Default = -1,
Horizontal = 3,
Simplex = 1,
Vertical = 2,
}
[System.SerializableAttribute]
public partial class InvalidPrinterException : System.SystemException
{
public InvalidPrinterException(System.Drawing.Printing.PrinterSettings settings) { }
protected InvalidPrinterException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.Demand, SerializationFormatter=true)]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.ComponentModel.TypeConverterAttribute(typeof(System.Drawing.Printing.MarginsConverter))]
[System.SerializableAttribute]
public partial class Margins : System.ICloneable
{
public Margins() { }
public Margins(int left, int right, int top, int bottom) { }
public int Bottom { get { throw null; } set { } }
public int Left { get { throw null; } set { } }
public int Right { get { throw null; } set { } }
public int Top { get { throw null; } set { } }
public object Clone() { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Drawing.Printing.Margins m1, System.Drawing.Printing.Margins m2) { throw null; }
public static bool operator !=(System.Drawing.Printing.Margins m1, System.Drawing.Printing.Margins m2) { throw null; }
public override string ToString() { throw null; }
}
public partial class MarginsConverter : System.ComponentModel.ExpandableObjectConverter
{
public MarginsConverter() { }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { throw null; }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
[System.SerializableAttribute]
public partial class PageSettings : System.ICloneable
{
public PageSettings() { }
public PageSettings(System.Drawing.Printing.PrinterSettings printerSettings) { }
public System.Drawing.Rectangle Bounds { get { throw null; } }
public bool Color { get { throw null; } set { } }
public float HardMarginX { get { throw null; } }
public float HardMarginY { get { throw null; } }
public bool Landscape { get { throw null; } set { } }
public System.Drawing.Printing.Margins Margins { get { throw null; } set { } }
public System.Drawing.Printing.PaperSize PaperSize { get { throw null; } set { } }
public System.Drawing.Printing.PaperSource PaperSource { get { throw null; } set { } }
public System.Drawing.RectangleF PrintableArea { get { throw null; } }
public System.Drawing.Printing.PrinterResolution PrinterResolution { get { throw null; } set { } }
public System.Drawing.Printing.PrinterSettings PrinterSettings { get { throw null; } set { } }
public object Clone() { throw null; }
public void CopyToHdevmode(System.IntPtr hdevmode) { }
public void SetHdevmode(System.IntPtr hdevmode) { }
public override string ToString() { throw null; }
}
[System.SerializableAttribute]
public enum PaperKind
{
A2 = 66,
A3 = 8,
A3Extra = 63,
A3ExtraTransverse = 68,
A3Rotated = 76,
A3Transverse = 67,
A4 = 9,
A4Extra = 53,
A4Plus = 60,
A4Rotated = 77,
A4Small = 10,
A4Transverse = 55,
A5 = 11,
A5Extra = 64,
A5Rotated = 78,
A5Transverse = 61,
A6 = 70,
A6Rotated = 83,
APlus = 57,
B4 = 12,
B4Envelope = 33,
B4JisRotated = 79,
B5 = 13,
B5Envelope = 34,
B5Extra = 65,
B5JisRotated = 80,
B5Transverse = 62,
B6Envelope = 35,
B6Jis = 88,
B6JisRotated = 89,
BPlus = 58,
C3Envelope = 29,
C4Envelope = 30,
C5Envelope = 28,
C65Envelope = 32,
C6Envelope = 31,
CSheet = 24,
Custom = 0,
DLEnvelope = 27,
DSheet = 25,
ESheet = 26,
Executive = 7,
Folio = 14,
GermanLegalFanfold = 41,
GermanStandardFanfold = 40,
InviteEnvelope = 47,
IsoB4 = 42,
ItalyEnvelope = 36,
JapaneseDoublePostcard = 69,
JapaneseDoublePostcardRotated = 82,
JapaneseEnvelopeChouNumber3 = 73,
JapaneseEnvelopeChouNumber3Rotated = 86,
JapaneseEnvelopeChouNumber4 = 74,
JapaneseEnvelopeChouNumber4Rotated = 87,
JapaneseEnvelopeKakuNumber2 = 71,
JapaneseEnvelopeKakuNumber2Rotated = 84,
JapaneseEnvelopeKakuNumber3 = 72,
JapaneseEnvelopeKakuNumber3Rotated = 85,
JapaneseEnvelopeYouNumber4 = 91,
JapaneseEnvelopeYouNumber4Rotated = 92,
JapanesePostcard = 43,
JapanesePostcardRotated = 81,
Ledger = 4,
Legal = 5,
LegalExtra = 51,
Letter = 1,
LetterExtra = 50,
LetterExtraTransverse = 56,
LetterPlus = 59,
LetterRotated = 75,
LetterSmall = 2,
LetterTransverse = 54,
MonarchEnvelope = 37,
Note = 18,
Number10Envelope = 20,
Number11Envelope = 21,
Number12Envelope = 22,
Number14Envelope = 23,
Number9Envelope = 19,
PersonalEnvelope = 38,
Prc16K = 93,
Prc16KRotated = 106,
Prc32K = 94,
Prc32KBig = 95,
Prc32KBigRotated = 108,
Prc32KRotated = 107,
PrcEnvelopeNumber1 = 96,
PrcEnvelopeNumber10 = 105,
PrcEnvelopeNumber10Rotated = 118,
PrcEnvelopeNumber1Rotated = 109,
PrcEnvelopeNumber2 = 97,
PrcEnvelopeNumber2Rotated = 110,
PrcEnvelopeNumber3 = 98,
PrcEnvelopeNumber3Rotated = 111,
PrcEnvelopeNumber4 = 99,
PrcEnvelopeNumber4Rotated = 112,
PrcEnvelopeNumber5 = 100,
PrcEnvelopeNumber5Rotated = 113,
PrcEnvelopeNumber6 = 101,
PrcEnvelopeNumber6Rotated = 114,
PrcEnvelopeNumber7 = 102,
PrcEnvelopeNumber7Rotated = 115,
PrcEnvelopeNumber8 = 103,
PrcEnvelopeNumber8Rotated = 116,
PrcEnvelopeNumber9 = 104,
PrcEnvelopeNumber9Rotated = 117,
Quarto = 15,
Standard10x11 = 45,
Standard10x14 = 16,
Standard11x17 = 17,
Standard12x11 = 90,
Standard15x11 = 46,
Standard9x11 = 44,
Statement = 6,
Tabloid = 3,
TabloidExtra = 52,
USStandardFanfold = 39,
}
[System.SerializableAttribute]
public partial class PaperSize
{
public PaperSize() { }
public PaperSize(string name, int width, int height) { }
public int Height { get { throw null; } set { } }
public System.Drawing.Printing.PaperKind Kind { get { throw null; } }
public string PaperName { get { throw null; } set { } }
public int RawKind { get { throw null; } set { } }
public int Width { get { throw null; } set { } }
public override string ToString() { throw null; }
}
[System.SerializableAttribute]
public partial class PaperSource
{
public PaperSource() { }
public System.Drawing.Printing.PaperSourceKind Kind { get { throw null; } }
public int RawKind { get { throw null; } set { } }
public string SourceName { get { throw null; } set { } }
public override string ToString() { throw null; }
}
[System.SerializableAttribute]
public enum PaperSourceKind
{
AutomaticFeed = 7,
Cassette = 14,
Custom = 257,
Envelope = 5,
FormSource = 15,
LargeCapacity = 11,
LargeFormat = 10,
Lower = 2,
Manual = 4,
ManualFeed = 6,
Middle = 3,
SmallFormat = 9,
TractorFeed = 8,
Upper = 1,
}
public sealed partial class PreviewPageInfo
{
public PreviewPageInfo(System.Drawing.Image image, System.Drawing.Size physicalSize) { }
public System.Drawing.Image Image { get { throw null; } }
public System.Drawing.Size PhysicalSize { get { throw null; } }
}
public partial class PreviewPrintController : System.Drawing.Printing.PrintController
{
public PreviewPrintController() { }
public override bool IsPreview { get { throw null; } }
public virtual bool UseAntiAlias { get { throw null; } set { } }
public System.Drawing.Printing.PreviewPageInfo[] GetPreviewPageInfo() { throw null; }
public override void OnEndPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { }
public override void OnEndPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
public override System.Drawing.Graphics OnStartPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { throw null; }
public override void OnStartPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
}
public enum PrintAction
{
PrintToFile = 0,
PrintToPreview = 1,
PrintToPrinter = 2,
}
public abstract partial class PrintController
{
protected PrintController() { }
public virtual bool IsPreview { get { throw null; } }
public virtual void OnEndPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { }
public virtual void OnEndPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
public virtual System.Drawing.Graphics OnStartPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { throw null; }
public virtual void OnStartPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
}
[System.ComponentModel.DefaultEventAttribute("PrintPage")]
[System.ComponentModel.DefaultPropertyAttribute("DocumentName")]
[System.ComponentModel.ToolboxItemFilterAttribute("System.Drawing.Printing")]
public partial class PrintDocument : System.ComponentModel.Component
{
public PrintDocument() { }
[System.ComponentModel.BrowsableAttribute(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public System.Drawing.Printing.PageSettings DefaultPageSettings { get { throw null; } set { } }
[System.ComponentModel.DefaultValueAttribute("document")]
public string DocumentName { get { throw null; } set { } }
[System.ComponentModel.DefaultValueAttribute(false)]
public bool OriginAtMargins { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public System.Drawing.Printing.PrintController PrintController { get { throw null; } set { } }
[System.ComponentModel.BrowsableAttribute(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
public System.Drawing.Printing.PrinterSettings PrinterSettings { get { throw null; } set { } }
public event System.Drawing.Printing.PrintEventHandler BeginPrint { add { } remove { } }
public event System.Drawing.Printing.PrintEventHandler EndPrint { add { } remove { } }
public event System.Drawing.Printing.PrintPageEventHandler PrintPage { add { } remove { } }
public event System.Drawing.Printing.QueryPageSettingsEventHandler QueryPageSettings { add { } remove { } }
protected virtual void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e) { }
protected virtual void OnEndPrint(System.Drawing.Printing.PrintEventArgs e) { }
protected virtual void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e) { }
protected virtual void OnQueryPageSettings(System.Drawing.Printing.QueryPageSettingsEventArgs e) { }
public void Print() { }
public override string ToString() { throw null; }
}
[System.SerializableAttribute]
public partial class PrinterResolution
{
public PrinterResolution() { }
public System.Drawing.Printing.PrinterResolutionKind Kind { get { throw null; } set { } }
public int X { get { throw null; } set { } }
public int Y { get { throw null; } set { } }
public override string ToString() { throw null; }
}
[System.SerializableAttribute]
public enum PrinterResolutionKind
{
Custom = 0,
Draft = -1,
High = -4,
Low = -2,
Medium = -3,
}
[System.SerializableAttribute]
public partial class PrinterSettings : System.ICloneable
{
public PrinterSettings() { }
public bool CanDuplex { get { throw null; } }
public bool Collate { get { throw null; } set { } }
public short Copies { get { throw null; } set { } }
public System.Drawing.Printing.PageSettings DefaultPageSettings { get { throw null; } }
public System.Drawing.Printing.Duplex Duplex { get { throw null; } set { } }
public int FromPage { get { throw null; } set { } }
public static System.Drawing.Printing.PrinterSettings.StringCollection InstalledPrinters { get { throw null; } }
public bool IsDefaultPrinter { get { throw null; } }
public bool IsPlotter { get { throw null; } }
public bool IsValid { get { throw null; } }
public int LandscapeAngle { get { throw null; } }
public int MaximumCopies { get { throw null; } }
public int MaximumPage { get { throw null; } set { } }
public int MinimumPage { get { throw null; } set { } }
public System.Drawing.Printing.PrinterSettings.PaperSizeCollection PaperSizes { get { throw null; } }
public System.Drawing.Printing.PrinterSettings.PaperSourceCollection PaperSources { get { throw null; } }
public string PrinterName { get { throw null; } set { } }
public System.Drawing.Printing.PrinterSettings.PrinterResolutionCollection PrinterResolutions { get { throw null; } }
public string PrintFileName { get { throw null; } set { } }
public System.Drawing.Printing.PrintRange PrintRange { get { throw null; } set { } }
public bool PrintToFile { get { throw null; } set { } }
public bool SupportsColor { get { throw null; } }
public int ToPage { get { throw null; } set { } }
public object Clone() { throw null; }
public System.Drawing.Graphics CreateMeasurementGraphics() { throw null; }
public System.Drawing.Graphics CreateMeasurementGraphics(bool honorOriginAtMargins) { throw null; }
public System.Drawing.Graphics CreateMeasurementGraphics(System.Drawing.Printing.PageSettings pageSettings) { throw null; }
public System.Drawing.Graphics CreateMeasurementGraphics(System.Drawing.Printing.PageSettings pageSettings, bool honorOriginAtMargins) { throw null; }
public System.IntPtr GetHdevmode() { throw null; }
public System.IntPtr GetHdevmode(System.Drawing.Printing.PageSettings pageSettings) { throw null; }
public System.IntPtr GetHdevnames() { throw null; }
public bool IsDirectPrintingSupported(System.Drawing.Image image) { throw null; }
public bool IsDirectPrintingSupported(System.Drawing.Imaging.ImageFormat imageFormat) { throw null; }
public void SetHdevmode(System.IntPtr hdevmode) { }
public void SetHdevnames(System.IntPtr hdevnames) { }
public override string ToString() { throw null; }
public partial class PaperSizeCollection : System.Collections.ICollection, System.Collections.IEnumerable
{
public PaperSizeCollection(System.Drawing.Printing.PaperSize[] array) { }
public int Count { get { throw null; } }
public virtual System.Drawing.Printing.PaperSize this[int index] { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public int Add(System.Drawing.Printing.PaperSize paperSize) { throw null; }
public void CopyTo(System.Drawing.Printing.PaperSize[] paperSizes, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial class PaperSourceCollection : System.Collections.ICollection, System.Collections.IEnumerable
{
public PaperSourceCollection(System.Drawing.Printing.PaperSource[] array) { }
public int Count { get { throw null; } }
public virtual System.Drawing.Printing.PaperSource this[int index] { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public int Add(System.Drawing.Printing.PaperSource paperSource) { throw null; }
public void CopyTo(System.Drawing.Printing.PaperSource[] paperSources, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial class PrinterResolutionCollection : System.Collections.ICollection, System.Collections.IEnumerable
{
public PrinterResolutionCollection(System.Drawing.Printing.PrinterResolution[] array) { }
public int Count { get { throw null; } }
public virtual System.Drawing.Printing.PrinterResolution this[int index] { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public int Add(System.Drawing.Printing.PrinterResolution printerResolution) { throw null; }
public void CopyTo(System.Drawing.Printing.PrinterResolution[] printerResolutions, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial class StringCollection : System.Collections.ICollection, System.Collections.IEnumerable
{
public StringCollection(string[] array) { }
public int Count { get { throw null; } }
public virtual string this[int index] { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public int Add(string value) { throw null; }
public void CopyTo(string[] strings, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
}
public enum PrinterUnit
{
Display = 0,
HundredthsOfAMillimeter = 2,
TenthsOfAMillimeter = 3,
ThousandthsOfAnInch = 1,
}
public sealed partial class PrinterUnitConvert
{
internal PrinterUnitConvert() { }
public static double Convert(double value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
public static System.Drawing.Point Convert(System.Drawing.Point value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
public static System.Drawing.Printing.Margins Convert(System.Drawing.Printing.Margins value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
public static System.Drawing.Rectangle Convert(System.Drawing.Rectangle value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
public static System.Drawing.Size Convert(System.Drawing.Size value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
public static int Convert(int value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw null; }
}
public partial class PrintEventArgs : System.ComponentModel.CancelEventArgs
{
public PrintEventArgs() { }
public System.Drawing.Printing.PrintAction PrintAction { get { throw null; } }
}
public delegate void PrintEventHandler(object sender, System.Drawing.Printing.PrintEventArgs e);
[System.SerializableAttribute]
public sealed partial class PrintingPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission
{
public PrintingPermission(System.Drawing.Printing.PrintingPermissionLevel printingLevel) { }
public PrintingPermission(System.Security.Permissions.PermissionState state) { }
public System.Drawing.Printing.PrintingPermissionLevel Level { get { throw null; } set { } }
public override System.Security.IPermission Copy() { throw null; }
public override void FromXml(System.Security.SecurityElement esd) { }
public override System.Security.IPermission Intersect(System.Security.IPermission target) { throw null; }
public override bool IsSubsetOf(System.Security.IPermission target) { throw null; }
public bool IsUnrestricted() { throw null; }
public override System.Security.SecurityElement ToXml() { throw null; }
public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(32767), AllowMultiple=true)]
public sealed partial class PrintingPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
{
public PrintingPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
public System.Drawing.Printing.PrintingPermissionLevel Level { get { throw null; } set { } }
public override System.Security.IPermission CreatePermission() { throw null; }
}
[System.SerializableAttribute]
public enum PrintingPermissionLevel
{
AllPrinting = 3,
DefaultPrinting = 2,
NoPrinting = 0,
SafePrinting = 1,
}
public partial class PrintPageEventArgs : System.EventArgs
{
public PrintPageEventArgs(System.Drawing.Graphics graphics, System.Drawing.Rectangle marginBounds, System.Drawing.Rectangle pageBounds, System.Drawing.Printing.PageSettings pageSettings) { }
public bool Cancel { get { throw null; } set { } }
public System.Drawing.Graphics Graphics { get { throw null; } }
public bool HasMorePages { get { throw null; } set { } }
public System.Drawing.Rectangle MarginBounds { get { throw null; } }
public System.Drawing.Rectangle PageBounds { get { throw null; } }
public System.Drawing.Printing.PageSettings PageSettings { get { throw null; } }
}
public delegate void PrintPageEventHandler(object sender, System.Drawing.Printing.PrintPageEventArgs e);
[System.SerializableAttribute]
public enum PrintRange
{
AllPages = 0,
CurrentPage = 4194304,
Selection = 1,
SomePages = 2,
}
public partial class QueryPageSettingsEventArgs : System.Drawing.Printing.PrintEventArgs
{
public QueryPageSettingsEventArgs(System.Drawing.Printing.PageSettings pageSettings) { }
public System.Drawing.Printing.PageSettings PageSettings { get { throw null; } set { } }
}
public delegate void QueryPageSettingsEventHandler(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e);
public partial class StandardPrintController : System.Drawing.Printing.PrintController
{
public StandardPrintController() { }
public override void OnEndPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { }
public override void OnEndPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
public override System.Drawing.Graphics OnStartPage(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e) { throw null; }
public override void OnStartPrint(System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e) { }
}
}
namespace System.Drawing.Text
{
public abstract partial class FontCollection : System.IDisposable
{
internal FontCollection() { }
public System.Drawing.FontFamily[] Families { get { throw null; } }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~FontCollection() { }
}
public enum GenericFontFamilies
{
Monospace = 2,
SansSerif = 1,
Serif = 0,
}
public enum HotkeyPrefix
{
Hide = 2,
None = 0,
Show = 1,
}
public sealed partial class InstalledFontCollection : System.Drawing.Text.FontCollection
{
public InstalledFontCollection() { }
}
public sealed partial class PrivateFontCollection : System.Drawing.Text.FontCollection
{
public PrivateFontCollection() { }
public void AddFontFile(string filename) { }
public void AddMemoryFont(System.IntPtr memory, int length) { }
protected override void Dispose(bool disposing) { }
}
public enum TextRenderingHint
{
AntiAlias = 4,
AntiAliasGridFit = 3,
ClearTypeGridFit = 5,
SingleBitPerPixel = 2,
SingleBitPerPixelGridFit = 1,
SystemDefault = 0,
}
}
| 65.042388
| 322
| 0.696889
|
[
"MIT"
] |
marek-safar/reference-assemblies
|
src/v4.7/System.Drawing.cs
| 259,324
|
C#
|
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using TicketReservationSystem.Data;
using TicketReservationSystem.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace TicketReservationSystem.Pages.Performances
{
public class IndexModel : BasePageModel
{
public IndexModel(
ApplicationDbContext context,
IAuthorizationService authorizationService,
UserManager<IdentityUser> userManager
) : base(context, authorizationService, userManager)
{
}
public IList<Models.Performances> Performances { get;set; }
[BindProperty(SupportsGet = true)]
public string SearchString { get; set; }
public SelectList Categories { get; set; }
[BindProperty(SupportsGet = true)]
public string PerformanceCategory { get; set; }
public async Task OnGetAsync()
{
IQueryable<IEnumerable<string>> categoryQuery = from p in Context.Performances
orderby p.Name
select (from c in p.PerformanceCategories
select c.Category.Name);
var performances = Context.Performances
.Include(p => p.PerformanceDates)
.Include(p => p.Theatre).AsQueryable();
if (!string.IsNullOrEmpty(SearchString))
{
performances = performances.Where(t => t.Name.Contains(SearchString));
}
if (!string.IsNullOrEmpty(PerformanceCategory))
{
performances = performances.Where(t => t.PerformanceCategories.Any(p => p.Category.Name == PerformanceCategory));
}
List<string> result = new List<string>();
await categoryQuery.Distinct().ForEachAsync(c => result.AddRange(c));
Categories = new SelectList(result.Distinct());
Performances = await performances.ToListAsync();
}
}
}
| 36.758065
| 129
| 0.597631
|
[
"MIT"
] |
zingmars/TicketReservationSystem
|
Pages/Performances/Index.cshtml.cs
| 2,281
|
C#
|
/* Copyright 2013-present MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver.Core.Bindings;
using MongoDB.Driver.Core.Connections;
using MongoDB.Driver.Core.Misc;
using MongoDB.Driver.Core.WireProtocol.Messages.Encoders;
namespace MongoDB.Driver.Core.Operations
{
/// <summary>
/// Represents a map-reduce operation.
/// </summary>
public class MapReduceLegacyOperation : MapReduceOperationBase, IReadOperation<BsonDocument>
{
// fields
private ReadConcern _readConcern = ReadConcern.Default;
// constructors
/// <summary>
/// Initializes a new instance of the <see cref="MapReduceLegacyOperation"/> class.
/// </summary>
/// <param name="collectionNamespace">The collection namespace.</param>
/// <param name="mapFunction">The map function.</param>
/// <param name="reduceFunction">The reduce function.</param>
/// <param name="messageEncoderSettings">The message encoder settings.</param>
public MapReduceLegacyOperation(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, MessageEncoderSettings messageEncoderSettings)
: base(
collectionNamespace,
mapFunction,
reduceFunction,
messageEncoderSettings)
{
}
// properties
/// <summary>
/// Gets or sets the read concern.
/// </summary>
/// <value>
/// The read concern.
/// </value>
public ReadConcern ReadConcern
{
get { return _readConcern; }
set { _readConcern = Ensure.IsNotNull(value, nameof(value)); }
}
// methods
/// <inheritdoc/>
protected override BsonDocument CreateOutputOptions()
{
return new BsonDocument("inline", 1);
}
/// <inheritdoc/>
public BsonDocument Execute(IReadBinding binding, CancellationToken cancellationToken)
{
Ensure.IsNotNull(binding, nameof(binding));
using (var channelSource = binding.GetReadChannelSource(cancellationToken))
using (var channel = channelSource.GetChannel(cancellationToken))
using (var channelBinding = new ChannelReadBinding(channelSource.Server, channel, binding.ReadPreference, binding.Session.Fork()))
{
var operation = CreateOperation(channelBinding.Session, channel.ConnectionDescription);
return operation.Execute(channelBinding, cancellationToken);
}
}
/// <inheritdoc/>
public async Task<BsonDocument> ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
{
Ensure.IsNotNull(binding, nameof(binding));
using (var channelSource = await binding.GetReadChannelSourceAsync(cancellationToken).ConfigureAwait(false))
using (var channel = await channelSource.GetChannelAsync(cancellationToken).ConfigureAwait(false))
using (var channelBinding = new ChannelReadBinding(channelSource.Server, channel, binding.ReadPreference, binding.Session.Fork()))
{
var operation = CreateOperation(channelBinding.Session, channel.ConnectionDescription);
return await operation.ExecuteAsync(channelBinding, cancellationToken).ConfigureAwait(false);
}
}
/// <inheritdoc/>
protected internal override BsonDocument CreateCommand(ICoreSessionHandle session, ConnectionDescription connectionDescription)
{
Feature.ReadConcern.ThrowIfNotSupported(connectionDescription.ServerVersion, _readConcern);
var command = base.CreateCommand(session, connectionDescription);
var readConcern = ReadConcernHelper.GetReadConcernForCommand(session, connectionDescription, _readConcern);
if (readConcern != null)
{
command.Add("readConcern", readConcern);
}
return command;
}
private ReadCommandOperation<BsonDocument> CreateOperation(ICoreSessionHandle session, ConnectionDescription connectionDescription)
{
var command = CreateCommand(session, connectionDescription);
var operation = new ReadCommandOperation<BsonDocument>(CollectionNamespace.DatabaseNamespace, command, BsonDocumentSerializer.Instance, MessageEncoderSettings);
return operation;
}
}
}
| 43.04
| 187
| 0.663197
|
[
"MIT"
] |
naivetang/2019MiniGame22
|
Server/ThirdParty/MongoDBDriver/MongoDB.Driver.Core/Core/Operations/MapReduceLegacyOperation.cs
| 5,382
|
C#
|
using System.Text.Json.Serialization;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// AlipayCommerceCityfacilitatorScriptQueryModel Data Structure.
/// </summary>
public class AlipayCommerceCityfacilitatorScriptQueryModel : AlipayObject
{
/// <summary>
/// 卡类型,智能卡中心的内部编码规则
/// </summary>
[JsonPropertyName("card_type")]
public string CardType { get; set; }
/// <summary>
/// 脚本类型,目前支持两种 readCardType:判定卡是什么城市的交通卡 readCardInfo:读取卡中的余额等信息
/// </summary>
[JsonPropertyName("script_type")]
public string ScriptType { get; set; }
}
}
| 28.869565
| 77
| 0.638554
|
[
"MIT"
] |
LuohuaRain/payment
|
src/Essensoft.AspNetCore.Payment.Alipay/Domain/AlipayCommerceCityfacilitatorScriptQueryModel.cs
| 768
|
C#
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Dcomms
{
public class ActionsQueue : IDisposable
{
bool _isDisposing;
readonly Action<Exception> _onException;
readonly ExecutionTimeStatsCollector _etscNullable;
public ActionsQueue(Action<Exception> onException, ExecutionTimeStatsCollector etscNullable = null)
{
if (onException == null) throw new ArgumentNullException(nameof(onException));
_onException = onException;
_etscNullable = etscNullable;
}
class QueuedAction
{
public Action A;
public string ActionVisibleId;
}
readonly Queue<QueuedAction> _queue = new Queue<QueuedAction>(); // locked
public void Enqueue(Action a, string actionVisibleId) // external thread (receiver thread) // must be very fast lock
{
lock (_queue)
{
if (_queue.Count > 5000) throw new InsufficientResourcesException();
_queue.Enqueue(new QueuedAction { A = a, ActionVisibleId = actionVisibleId });
}
}
public int Count
{
get
{
lock (_queue)
return _queue.Count;
}
}
public Task<bool> EnqueueAsync(string actionVisibleId)
{
var tcs = new TaskCompletionSource<bool>();
Enqueue(() =>
{
tcs.SetResult(true);
}, actionVisibleId);
return tcs.Task;
}
public void ExecuteQueued()
{
var x = Thread.CurrentThread.ManagedThreadId;
var sw = Stopwatch.StartNew();
for (; ; )
{
QueuedAction a;
lock (_queue)
{
a = _queue.Count != 0 ? _queue.Dequeue() : null;
}
if (a == null) goto _next;
if (_isDisposing) return;
try
{
if (_etscNullable != null)
{
var startMs = sw.Elapsed.TotalMilliseconds;
a.A();
var stopMs = sw.Elapsed.TotalMilliseconds;
_etscNullable.OnMeasuredExecutionTime(a.ActionVisibleId, stopMs - startMs);
}
else
a.A();
}
catch (Exception exc)
{
_onException(exc);
}
}
_next:
ExecuteDelayedActions();
}
public void Dispose()
{
_isDisposing = true;
}
#region delayed events
static readonly Stopwatch _stopwatch = Stopwatch.StartNew();
private static TimeSpan Time => _stopwatch.Elapsed;
public void EnqueueDelayed(TimeSpan delay, Action a, string actionVisibleId) // is executed only engine thread
{
//if (delay.TotalMinutes > 10)
//{
// Logs.WriteToLog(LogModule.ssk, null, LogLevel.Warning, "adding delayed action '{0}' with timeout '{1}', it can cause memory leak. at {2}",
// eventHandler, delay, new StackTrace()
// );
//}
int eventsSortedByDueTimeIndex = _eventsSortedByDueTimeCounter++ % DelayedActionsSortedByDueTimeArraySize;
var eventsSortedByDueTime = _delayedActionsSortedByDueTime[eventsSortedByDueTimeIndex];
// select one of linked lists (queues), sequentially. using of only 1 linked list is slow
var t = Time + delay;
var e = new DelayedAction(a, actionVisibleId, t);
// linkedlist example: 100sec 102sec 104sec 108sec
// inserting: 105sec 108sec 109sec 99sec
// enumerate linkedlist of events starting from end to find an item where to insert
for (var item = eventsSortedByDueTime.Last; ;)
{
if (item == null) break;
if (item.Value.DueTime < t)
{
eventsSortedByDueTime.AddAfter(item, e);
return;
}
item = item.Previous;
}
eventsSortedByDueTime.AddFirst(e);
}
public Task<bool> WaitAsync(TimeSpan delay, string actionVisibleId) // is executed only engine thread
{
var tcs = new TaskCompletionSource<bool>();
EnqueueDelayed(delay, () =>
{
tcs.SetResult(true);
}, actionVisibleId);
return tcs.Task;
}
private class DelayedAction
{
public readonly Action EventHandler;
public readonly string ActionVisibleId;
public readonly TimeSpan DueTime;
public DelayedAction(Action eventHandler, string actionVisibleId, TimeSpan dueTime)
{
ActionVisibleId = actionVisibleId;
this.EventHandler = eventHandler;
this.DueTime = dueTime;
}
}
private const int DelayedActionsSortedByDueTimeArraySize = 128;
private readonly LinkedList<DelayedAction>[] _delayedActionsSortedByDueTime = CreateEventsSortedByDueTime();
static LinkedList<DelayedAction>[] CreateEventsSortedByDueTime()
{
var r = new LinkedList<DelayedAction>[DelayedActionsSortedByDueTimeArraySize];
for (int i = 0; i < DelayedActionsSortedByDueTimeArraySize; i++)
r[i] = new LinkedList<DelayedAction>();
return r;
}
void ExecuteDelayedActions()
{
// linkedlist example: 100sec 102sec 104sec 108sec
// now: 10sec 102sec
var now = Time;
foreach (var eventsSortedByDueTime in _delayedActionsSortedByDueTime)
{
for (var item = eventsSortedByDueTime.First; ;)
{
if (item == null) break;
var e = item.Value;
if (e.DueTime > now) break;
// go to next item
var itemToRemove = item;
item = item.Next;
// execute item
try
{
if (_etscNullable != null)
{
var sw = Stopwatch.StartNew();
e.EventHandler();
sw.Stop();
_etscNullable?.OnMeasuredExecutionTime(e.ActionVisibleId, sw.Elapsed.TotalMilliseconds);
}
else
e.EventHandler();
}
catch (Exception exc)
{
_onException(exc);
}
if (_isDisposing) return;
// remove executed item
eventsSortedByDueTime.Remove(itemToRemove);
}
}
}
private int _eventsSortedByDueTimeCounter = 0;
#endregion
}
}
| 36.43128
| 157
| 0.489007
|
[
"MIT"
] |
dcomms/dcomms
|
Dcomms.Core/ActionsQueue.cs
| 7,689
|
C#
|
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace API.Migrations
{
public partial class BananaMigration2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "User",
keyColumn: "Id",
keyValue: new Guid("3572bc96-2536-4f22-b69a-ed89ae4f7d66"));
migrationBuilder.AddColumn<Guid>(
name: "PassworResetToken",
table: "User",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.InsertData(
table: "User",
columns: new[] { "Id", "Email", "EmailConfirmationToken", "EmailConfirmed", "PassworResetToken", "Password", "Salt", "Username" },
values: new object[] { new Guid("8cec4b25-4563-463f-a690-498f60c743e9"), "user@email.com", new Guid("a6a46a35-5165-4ab5-9e19-12764cfc2144"), false, new Guid("00000000-0000-0000-0000-000000000000"), "QWZjuWqZvjVItYJyHQc69LHCeYguawJdYgvELNszsdI=", new byte[] { 23, 69, 221, 70, 219, 2, 73, 116, 196, 47, 121, 144, 89, 11, 131, 74 }, "user" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "User",
keyColumn: "Id",
keyValue: new Guid("8cec4b25-4563-463f-a690-498f60c743e9"));
migrationBuilder.DropColumn(
name: "PassworResetToken",
table: "User");
migrationBuilder.InsertData(
table: "User",
columns: new[] { "Id", "Email", "EmailConfirmationToken", "EmailConfirmed", "Password", "Salt", "Username" },
values: new object[] { new Guid("3572bc96-2536-4f22-b69a-ed89ae4f7d66"), "user@email.com", new Guid("a6a46a35-5165-4ab5-9e19-12764cfc2144"), false, "Z+rTKRldeJu7FKNCXwZF41l8I0plylCl2qwd0nxPGNg=", new byte[] { 63, 145, 25, 252, 219, 98, 134, 192, 254, 198, 168, 251, 41, 32, 117, 121 }, "user" });
}
}
}
| 47.733333
| 357
| 0.594041
|
[
"MIT"
] |
Kinaetron/Bulee.Banana
|
API/Migrations/20190903142907_BananaMigration2.cs
| 2,150
|
C#
|
#region copyright
/* * * * * * * * * * * * * * * * * * * * * * * * * */
/* Carl Zeiss Industrielle Messtechnik GmbH */
/* Softwaresystem PiWeb */
/* (c) Carl Zeiss 2013 */
/* * * * * * * * * * * * * * * * * * * * * * * * * */
#endregion
namespace Zeiss.PiWeb.Formplot.FileFormat
{
/// <summary>
/// Geometry types
/// </summary>
public enum GeometryTypes
{
/// <summary>
/// No geometry
/// </summary>
None,
/// <summary>
/// Circle
/// </summary>
Circle,
/// <summary>
/// Plane
/// </summary>
Plane,
/// <summary>
/// Curve
/// </summary>
Curve,
/// <summary>
/// Line
/// </summary>
Line,
/// <summary>
/// Cylinder
/// </summary>
Cylinder,
/// <summary>
/// Circle in a profile
/// </summary>
CircleInProfile,
/// <summary>
/// Flush and Gap
/// </summary>
FlushGap,
/// <summary>
/// Defect
/// </summary>
Defect,
/// <summary>
/// Fillet
/// </summary>
Fillet,
/// <summary>
/// Pitch
/// </summary>
Pitch
}
}
| 14.863014
| 53
| 0.44977
|
[
"BSD-3-Clause"
] |
ZEISS-PiWeb/PiWeb-Formplots
|
src/Formplot/FileFormat/GeometryTypes.cs
| 1,087
|
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 a data store in Amazon Simple Storage Service (Amazon S3).
/// </summary>
public partial class S3Target
{
private string _connectionName;
private List<string> _exclusions = new List<string>();
private string _path;
private int? _sampleSize;
/// <summary>
/// Gets and sets the property ConnectionName.
/// <para>
/// The name of a connection which allows a job or crawler to access data in Amazon S3
/// within an Amazon Virtual Private Cloud environment (Amazon VPC).
/// </para>
/// </summary>
public string ConnectionName
{
get { return this._connectionName; }
set { this._connectionName = value; }
}
// Check to see if ConnectionName property is set
internal bool IsSetConnectionName()
{
return this._connectionName != null;
}
/// <summary>
/// Gets and sets the property Exclusions.
/// <para>
/// A list of glob patterns used to exclude from the crawl. For more information, see
/// <a href="https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html">Catalog Tables
/// with a Crawler</a>.
/// </para>
/// </summary>
public List<string> Exclusions
{
get { return this._exclusions; }
set { this._exclusions = value; }
}
// Check to see if Exclusions property is set
internal bool IsSetExclusions()
{
return this._exclusions != null && this._exclusions.Count > 0;
}
/// <summary>
/// Gets and sets the property Path.
/// <para>
/// The path to the Amazon S3 target.
/// </para>
/// </summary>
public string Path
{
get { return this._path; }
set { this._path = value; }
}
// Check to see if Path property is set
internal bool IsSetPath()
{
return this._path != null;
}
/// <summary>
/// Gets and sets the property SampleSize.
/// <para>
/// Sets the number of files in each leaf folder to be crawled when crawling sample files
/// in a dataset. If not set, all the files are crawled. A valid value is an integer between
/// 1 and 249.
/// </para>
/// </summary>
public int SampleSize
{
get { return this._sampleSize.GetValueOrDefault(); }
set { this._sampleSize = value; }
}
// Check to see if SampleSize property is set
internal bool IsSetSampleSize()
{
return this._sampleSize.HasValue;
}
}
}
| 31.142857
| 102
| 0.588775
|
[
"Apache-2.0"
] |
ChristopherButtars/aws-sdk-net
|
sdk/src/Services/Glue/Generated/Model/S3Target.cs
| 3,706
|
C#
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Sourced from https://github.com/dotnet/core-setup/tree/be8d8e3486b2bf598ed69d39b1629a24caaba45e/tools-local/tasks, needs to be kept in sync
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyModel;
namespace RepoTasks.Utilities
{
internal class RuntimeReference
{
public static List<RuntimeLibrary> RemoveReferences(IReadOnlyList<RuntimeLibrary> runtimeLibraries, IEnumerable<string> packages)
{
List<RuntimeLibrary> result = new List<RuntimeLibrary>();
foreach (var runtimeLib in runtimeLibraries)
{
if (string.IsNullOrEmpty(packages.FirstOrDefault(elem => runtimeLib.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
{
List<Dependency> toRemoveDependecy = new List<Dependency>();
foreach (var dependency in runtimeLib.Dependencies)
{
if (!string.IsNullOrEmpty(packages.FirstOrDefault(elem => dependency.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
{
toRemoveDependecy.Add(dependency);
}
}
if (toRemoveDependecy.Count > 0)
{
List<Dependency> modifiedDependencies = new List<Dependency>();
foreach (var dependency in runtimeLib.Dependencies)
{
if (!toRemoveDependecy.Contains(dependency))
{
modifiedDependencies.Add(dependency);
}
}
result.Add(new RuntimeLibrary(runtimeLib.Type,
runtimeLib.Name,
runtimeLib.Version,
runtimeLib.Hash,
runtimeLib.RuntimeAssemblyGroups,
runtimeLib.NativeLibraryGroups,
runtimeLib.ResourceAssemblies,
modifiedDependencies,
runtimeLib.Serviceable));
}
else if (string.IsNullOrEmpty(packages.FirstOrDefault(elem => runtimeLib.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
{
result.Add(runtimeLib);
}
}
}
return result;
}
}
}
| 46.920635
| 149
| 0.498647
|
[
"Apache-2.0"
] |
aspnet/Universe
|
build/tasks/Utilities/RuntimeReference.cs
| 2,956
|
C#
|
namespace TmLox.Interpreter.Tests;
using NUnit.Framework;
using Errors;
public class StringTests
{
[Test]
public void Test_Creating_String_Without_Termination_Character_Should_Produce_Error_About_Unterminated_String()
{
const string code = @"
var test_variable = ""Hello world;
";
var script = new Script();
var ex = Assert.Throws<SyntaxError>(delegate { script.RunString(code); });
StringAssert.Contains("Unterminated string", ex?.Message);
}
[Test]
public void Test_Creating_String_With_All_Valid_Escape_Symbols_Should_Produce_Valid_String()
{
const string code = @"
var test_variable = ""\' \"" \\ \a \b \f \n \r \t \v"";
";
var script = new Script();
script.RunString(code);
var testVariable = script["test_variable"];
Assert.True(testVariable.IsString());
}
[Test]
public void Test_Creating_String_With_Invalid_Escape_Symbols_Should_Produce_Error_About_Invalid_Escape_Symbol()
{
const string code = @"
var test_variable = ""\m"";
";
var script = new Script();
var ex = Assert.Throws<SyntaxError>(delegate { script.RunString(code); });
StringAssert.Contains("Invalid escape symbol", ex?.Message);
}
[Test]
public void Test_Creating_String_With_Minus_Sign_Before_Literal_Should_Produce_Error_About_Unsupported_Operation()
{
const string code = @"
var value = -""First"";
";
var script = new Script();
var ex = Assert.Throws<ValueError>(delegate { script.RunString(code); });
StringAssert.Contains("Unary - not supported for type String", ex?.Message);
}
}
| 28.349206
| 118
| 0.628219
|
[
"MIT"
] |
GustasG/TmLox
|
TmLox.Interpreter.Tests/src/StringTests.cs
| 1,786
|
C#
|
using System;
using Newtonsoft.Json;
using RestSharp;
namespace Harmony.API
{
public class SearchChainsEntries
{
public HarmonyClient Harmony { get; private set; }
public IRestResponse RestResponse { get; private set; }
public Response DataResponse { get; private set; }
public SearchChainsEntries(HarmonyClient harmony)
{
Harmony = harmony;
}
public bool Get(string ChainID, byte[][] External_ids, int Limit=15, int Offset=0)
{
var idsHex = new string[External_ids.Length];
for (var f=0;f < External_ids.Length; f++)
{
idsHex[f] = External_ids[f].ToHexString();
}
var request = new RestRequest($"v1/chains/{ChainID}/entries/search", Method.POST);
request.AddQueryParameter("limit", $"{Limit}");
request.AddQueryParameter("offset", $"{Offset}");
request.AddParameter("application/json", JsonConvert.SerializeObject(
new
{
external_ids = idsHex
}), ParameterType.RequestBody);
RestResponse = Harmony.MakeRequest(request);
if (RestResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
DataResponse = JsonConvert.DeserializeObject<Response>(RestResponse.Content);
return true;
}
return false;
}
public partial class Response
{
[JsonProperty("offset")]
public long Offset { get; set; }
[JsonProperty("limit")]
public long Limit { get; set; }
[JsonProperty("data")]
public Datum[] Data { get; set; }
[JsonProperty("count")]
public long Count { get; set; }
public partial class Datum
{
[JsonProperty("stage")]
public string Stage { get; set; }
[JsonProperty("href")]
public string Href { get; set; }
[JsonProperty("external_ids")]
public string[] ExternalIds { get; set; }
[JsonProperty("entry_hash")]
public string[] EntryHash { get; set; }
}
}
}
}
| 27.804598
| 94
| 0.505994
|
[
"MIT"
] |
FactoidAuthority/HarmonySharp
|
HarmonySharp/API/Entries/SearchChainsEntries.cs
| 2,421
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.