content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Exam4 { class Program { static void Main(string[] args) { var students = int.Parse(Console.ReadLine()); var topstudents = 0.0; var beetwen4students = 0.0; var beetwen3students = 0.0; var failstudents = 0.0; var average = 0.0; for (int i = 1; i <= students; i++) { var evalution = double.Parse(Console.ReadLine()); average += evalution; if (evalution >= 5) { topstudents++; } else if (evalution >= 4 && evalution < 5) { beetwen4students++; } else if (evalution >= 3 && evalution < 4) { beetwen3students++; } else { failstudents++; } } var p1 = topstudents * 100 / students; var p2 = beetwen4students * 100 / students; var p3 = beetwen3students * 100 / students; var p4 = failstudents * 100 / students; Console.WriteLine("Top students: {0:f2}%",p1); Console.WriteLine("Between 4.00 and 4.99: {0:f2}%",p2); Console.WriteLine("Between 3.00 and 3.99: {0:f2}%",p3); Console.WriteLine("Fail: {0:f2}%",p4); Console.WriteLine("Average: {0:f2}",average / students); } } }
28.016949
68
0.45493
[ "MIT" ]
vasilchavdarov/SoftUniHomework
Projects/Exam/Exam4/Program.cs
1,655
C#
using System; using System.Threading.Tasks; namespace XAMLator.Server.Tests { public class TestTCPCommunicatorServer : ITcpCommunicatorServer { public event EventHandler<object> DataReceived; public event EventHandler ClientConnected; public int ClientsCount { get; private set; } public TestTCPCommunicatorClient Client { get; set; } public Task<bool> Connect(string ip, int port) { ClientsCount++; ClientConnected?.Invoke(this, EventArgs.Empty); return Task.FromResult(true); } public void Disconnect() { ClientsCount--; } public Task<bool> StartListening(int serverPort) { return Task.FromResult(true); } public void StopListening() { } public Task<bool> Send<T>(T obj) { try { Client.EmitDataReceived(obj); return Task.FromResult(true); } catch (Exception ex) { Log.Exception(ex); return Task.FromResult(false); } } public void EmitDataReceived<T>(T obj) { DataReceived?.Invoke(this, Serializer.DeserializeJson(Serializer.SerializeJson(obj))); } } public class TestTCPCommunicatorClient : ITcpCommunicatorClient { public event EventHandler<object> DataReceived; public TestTCPCommunicatorServer Server { get; set; } public Task<bool> Connect(string ip, int port) { Server.Connect(ip, port); return Task.FromResult(true); } public void Disconnect() { } public Task<bool> Send<T>(T obj) { try { Server.EmitDataReceived(obj); return Task.FromResult(true); } catch (Exception ex) { Log.Exception(ex); return Task.FromResult(false); } } public void EmitDataReceived<T>(T obj) { DataReceived?.Invoke(this, Serializer.DeserializeJson(Serializer.SerializeJson(obj))); } } }
18.734043
89
0.691652
[ "MIT" ]
jsuarezruiz/XAMLator
XAMLator.Server.Tests/TestTCPCommunicator.cs
1,763
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18408 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ #pragma warning disable 1591 namespace Requests { /// <summary> ///Represents a strongly typed in-memory cache of data. ///</summary> [global::System.Serializable()] [global::System.ComponentModel.DesignerCategoryAttribute("code")] [global::System.ComponentModel.ToolboxItem(true)] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] [global::System.Xml.Serialization.XmlRootAttribute("DataSet1")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] public partial class DataSet1 : global::System.Data.DataSet { private dtPereocDataTable tabledtPereoc; private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public DataSet1() { this.BeginInit(); this.InitClass(); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); base.Tables.CollectionChanged += schemaChangedHandler; base.Relations.CollectionChanged += schemaChangedHandler; this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected DataSet1(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context, false) { if ((this.IsBinarySerialized(info, context) == true)) { this.InitVars(false); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); this.Tables.CollectionChanged += schemaChangedHandler1; this.Relations.CollectionChanged += schemaChangedHandler1; return; } string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { global::System.Data.DataSet ds = new global::System.Data.DataSet(); ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); if ((ds.Tables["dtPereoc"] != null)) { base.Tables.Add(new dtPereocDataTable(ds.Tables["dtPereoc"])); } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; this.Locale = ds.Locale; this.CaseSensitive = ds.CaseSensitive; this.EnforceConstraints = ds.EnforceConstraints; this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); this.InitVars(); } else { this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); } this.GetSerializationData(info, context); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); base.Tables.CollectionChanged += schemaChangedHandler; this.Relations.CollectionChanged += schemaChangedHandler; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public dtPereocDataTable dtPereoc { get { return this.tabledtPereoc; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { get { return this._schemaSerializationMode; } set { this._schemaSerializationMode = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataTableCollection Tables { get { return base.Tables; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataRelationCollection Relations { get { return base.Relations; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void InitializeDerivedDataSet() { this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataSet Clone() { DataSet1 cln = ((DataSet1)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override bool ShouldSerializeTables() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override bool ShouldSerializeRelations() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { this.Reset(); global::System.Data.DataSet ds = new global::System.Data.DataSet(); ds.ReadXml(reader); if ((ds.Tables["dtPereoc"] != null)) { base.Tables.Add(new dtPereocDataTable(ds.Tables["dtPereoc"])); } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; this.Locale = ds.Locale; this.CaseSensitive = ds.CaseSensitive; this.EnforceConstraints = ds.EnforceConstraints; this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); this.InitVars(); } else { this.ReadXml(reader); this.InitVars(); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); stream.Position = 0; return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.InitVars(true); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars(bool initTable) { this.tabledtPereoc = ((dtPereocDataTable)(base.Tables["dtPereoc"])); if ((initTable == true)) { if ((this.tabledtPereoc != null)) { this.tabledtPereoc.InitVars(); } } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.DataSetName = "DataSet1"; this.Prefix = ""; this.Namespace = "http://tempuri.org/DataSet1.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tabledtPereoc = new dtPereocDataTable(); base.Tables.Add(this.tabledtPereoc); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializedtPereoc() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { DataSet1 ds = new DataSet1(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void dtPereocRowChangeEventHandler(object sender, dtPereocRowChangeEvent e); /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class dtPereocDataTable : global::System.Data.TypedTableBase<dtPereocRow> { private global::System.Data.DataColumn columncName; private global::System.Data.DataColumn columnean; private global::System.Data.DataColumn columnostOnDate; private global::System.Data.DataColumn columnrcena; private global::System.Data.DataColumn columnzcena; private global::System.Data.DataColumn columnzcenabnds; private global::System.Data.DataColumn columnnumber; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocDataTable() { this.TableName = "dtPereoc"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal dtPereocDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected dtPereocDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn cNameColumn { get { return this.columncName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn eanColumn { get { return this.columnean; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn ostOnDateColumn { get { return this.columnostOnDate; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn rcenaColumn { get { return this.columnrcena; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn zcenaColumn { get { return this.columnzcena; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn zcenabndsColumn { get { return this.columnzcenabnds; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn numberColumn { get { return this.columnnumber; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocRow this[int index] { get { return ((dtPereocRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event dtPereocRowChangeEventHandler dtPereocRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event dtPereocRowChangeEventHandler dtPereocRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event dtPereocRowChangeEventHandler dtPereocRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event dtPereocRowChangeEventHandler dtPereocRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AdddtPereocRow(dtPereocRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocRow AdddtPereocRow(string cName, string ean, string ostOnDate, string rcena, string zcena, string zcenabnds, string number) { dtPereocRow rowdtPereocRow = ((dtPereocRow)(this.NewRow())); object[] columnValuesArray = new object[] { cName, ean, ostOnDate, rcena, zcena, zcenabnds, number}; rowdtPereocRow.ItemArray = columnValuesArray; this.Rows.Add(rowdtPereocRow); return rowdtPereocRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { dtPereocDataTable cln = ((dtPereocDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new dtPereocDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columncName = base.Columns["cName"]; this.columnean = base.Columns["ean"]; this.columnostOnDate = base.Columns["ostOnDate"]; this.columnrcena = base.Columns["rcena"]; this.columnzcena = base.Columns["zcena"]; this.columnzcenabnds = base.Columns["zcenabnds"]; this.columnnumber = base.Columns["number"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columncName = new global::System.Data.DataColumn("cName", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columncName); this.columnean = new global::System.Data.DataColumn("ean", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnean); this.columnostOnDate = new global::System.Data.DataColumn("ostOnDate", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnostOnDate); this.columnrcena = new global::System.Data.DataColumn("rcena", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnrcena); this.columnzcena = new global::System.Data.DataColumn("zcena", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnzcena); this.columnzcenabnds = new global::System.Data.DataColumn("zcenabnds", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnzcenabnds); this.columnnumber = new global::System.Data.DataColumn("number", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnnumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocRow NewdtPereocRow() { return ((dtPereocRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new dtPereocRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(dtPereocRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.dtPereocRowChanged != null)) { this.dtPereocRowChanged(this, new dtPereocRowChangeEvent(((dtPereocRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.dtPereocRowChanging != null)) { this.dtPereocRowChanging(this, new dtPereocRowChangeEvent(((dtPereocRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.dtPereocRowDeleted != null)) { this.dtPereocRowDeleted(this, new dtPereocRowChangeEvent(((dtPereocRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.dtPereocRowDeleting != null)) { this.dtPereocRowDeleting(this, new dtPereocRowChangeEvent(((dtPereocRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemovedtPereocRow(dtPereocRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); DataSet1 ds = new DataSet1(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "dtPereocDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class dtPereocRow : global::System.Data.DataRow { private dtPereocDataTable tabledtPereoc; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal dtPereocRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tabledtPereoc = ((dtPereocDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string cName { get { try { return ((string)(this[this.tabledtPereoc.cNameColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'cName\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.cNameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string ean { get { try { return ((string)(this[this.tabledtPereoc.eanColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'ean\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.eanColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string ostOnDate { get { try { return ((string)(this[this.tabledtPereoc.ostOnDateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'ostOnDate\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.ostOnDateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string rcena { get { try { return ((string)(this[this.tabledtPereoc.rcenaColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'rcena\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.rcenaColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string zcena { get { try { return ((string)(this[this.tabledtPereoc.zcenaColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'zcena\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.zcenaColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string zcenabnds { get { try { return ((string)(this[this.tabledtPereoc.zcenabndsColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'zcenabnds\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.zcenabndsColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string number { get { try { return ((string)(this[this.tabledtPereoc.numberColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'number\' in table \'dtPereoc\' is DBNull.", e); } } set { this[this.tabledtPereoc.numberColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IscNameNull() { return this.IsNull(this.tabledtPereoc.cNameColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetcNameNull() { this[this.tabledtPereoc.cNameColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IseanNull() { return this.IsNull(this.tabledtPereoc.eanColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SeteanNull() { this[this.tabledtPereoc.eanColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsostOnDateNull() { return this.IsNull(this.tabledtPereoc.ostOnDateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetostOnDateNull() { this[this.tabledtPereoc.ostOnDateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsrcenaNull() { return this.IsNull(this.tabledtPereoc.rcenaColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetrcenaNull() { this[this.tabledtPereoc.rcenaColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IszcenaNull() { return this.IsNull(this.tabledtPereoc.zcenaColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetzcenaNull() { this[this.tabledtPereoc.zcenaColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IszcenabndsNull() { return this.IsNull(this.tabledtPereoc.zcenabndsColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetzcenabndsNull() { this[this.tabledtPereoc.zcenabndsColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsnumberNull() { return this.IsNull(this.tabledtPereoc.numberColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetnumberNull() { this[this.tabledtPereoc.numberColumn] = global::System.Convert.DBNull; } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class dtPereocRowChangeEvent : global::System.EventArgs { private dtPereocRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocRowChangeEvent(dtPereocRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public dtPereocRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } } } #pragma warning restore 1591
53.622509
182
0.585636
[ "Apache-2.0" ]
nonenane/requests
src/Requests/dsReport.Designer.cs
45,742
C#
/* The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is "EncodingCharacters.java". Description: "Represents the set of special characters used to encode traditionally encoded HL7 messages" The Initial Developer of the Original Code is University Health Network. Copyright (C) 2001. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the GNU General Public License (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the GPL. */ namespace NHapi.Base.Parser { using System; using System.Linq; using NHapi.Base.Model; /// <summary> /// Represents the set of special characters used to encode traditionally /// encoded HL7 messages. /// </summary> /// <author>Bryan Tripp (bryan_tripp@sourceforge.net).</author> public class EncodingCharacters : object, ICloneable { private readonly char[] encChars; /// <summary> /// Creates new EncodingCharacters object with the given character /// values. If the encodingCharacters argument is null, the default /// values are used. /// </summary> /// <param name="fieldSeparator">The field separator.</param> /// <param name="encodingCharacters"> /// Consists of the characters that appear in /// MSH-2 (see section 2.8 of the HL7 spec). The characters are /// Component Separator, Repetition Separator, Escape Character, and /// Subcomponent Separator (in that order). /// </param> /// <exception cref="HL7Exception">If encoding characters are not unique.</exception> public EncodingCharacters(char fieldSeparator, string encodingCharacters) { if (char.IsWhiteSpace(fieldSeparator) || fieldSeparator == char.MinValue) { throw new HL7Exception("Field Seperator must be a printable character."); } FieldSeparator = fieldSeparator; encChars = new char[4]; #if NET35 if (string.IsNullOrEmpty(encodingCharacters) || encodingCharacters.Trim().Length == 0) #else if (string.IsNullOrWhiteSpace(encodingCharacters)) #endif { encChars[0] = '^'; encChars[1] = '~'; encChars[2] = '\\'; encChars[3] = '&'; } else { if (encodingCharacters.Any(@char => char.IsWhiteSpace(@char) || @char == char.MinValue)) { throw new HL7Exception("Encoding characters must be printable characters."); } if (!SupportClass.CharsAreUnique(encodingCharacters)) { throw new HL7Exception("Encoding characters must be unique."); } SupportClass.GetCharsFromString(encodingCharacters, 0, 4, encChars, 0); } } public EncodingCharacters( char fieldSeparator, char componentSeparator, char repetitionSeparator, char escapeCharacter, char subcomponentSeparator) : this( fieldSeparator, new string(new[] { componentSeparator, repetitionSeparator, escapeCharacter, subcomponentSeparator })) { } /// <summary>copies contents of "other". </summary> public EncodingCharacters(EncodingCharacters other) { FieldSeparator = other.FieldSeparator; encChars = new char[4]; encChars[0] = other.ComponentSeparator; encChars[1] = other.RepetitionSeparator; encChars[2] = other.EscapeCharacter; encChars[3] = other.SubcomponentSeparator; } /// <summary> /// Returns the field separator. /// </summary> public virtual char FieldSeparator { get; set; } /// <summary> /// Returns the component separator. /// </summary> public virtual char ComponentSeparator { get { return encChars[0]; } set { encChars[0] = value; } } /// <summary> /// Returns the repetition separator. /// </summary> public virtual char RepetitionSeparator { get { return encChars[1]; } set { encChars[1] = value; } } /// <summary> /// Returns the escape character. /// </summary> public virtual char EscapeCharacter { get { return encChars[2]; } set { encChars[2] = value; } } /// <summary> /// Returns the subcomponent separator. /// </summary> public virtual char SubcomponentSeparator { get { return encChars[3]; } set { encChars[3] = value; } } /// <summary> /// Returns an instance using the MSH-1 and MSH-2 values of the given message. /// </summary> /// <param name="message">The message.</param> /// <returns>the encoding characters for this message.</returns> /// <exception cref="HL7Exception">If either MSH-1 or MSH-2 are not populated.</exception> public static EncodingCharacters FromMessage(IMessage message) { var firstSegment = (ISegment)message.GetStructure(message.Names[0]); var msh2 = (IPrimitive)firstSegment.GetField(2, 0); var encodingCharactersValue = msh2.Value; if (string.IsNullOrEmpty(encodingCharactersValue)) { throw new HL7Exception("encoding characters not populated"); } var msh1 = (IPrimitive)firstSegment.GetField(1, 0); var fieldSeparatorValue = msh1.Value; if (fieldSeparatorValue == null) { throw new HL7Exception("Field separator not populated"); } return new EncodingCharacters(fieldSeparatorValue[0], encodingCharactersValue); } /// <summary> /// Returns the encoding characters (not including field separator) /// as a string. /// </summary> public override string ToString() { return new string(encChars); } public virtual object Clone() { return new EncodingCharacters(this); } public override bool Equals(object o) { if (o is EncodingCharacters other) { return FieldSeparator == other.FieldSeparator && ComponentSeparator == other.ComponentSeparator && EscapeCharacter == other.EscapeCharacter && RepetitionSeparator == other.RepetitionSeparator && SubcomponentSeparator == other.SubcomponentSeparator; } return false; } public override int GetHashCode() { return 7 * ComponentSeparator * EscapeCharacter * FieldSeparator * RepetitionSeparator * SubcomponentSeparator; } } }
34.99569
118
0.595024
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Base/Parser/EncodingCharacters.cs
8,119
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 iotwireless-2020-11-22.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.IoTWireless.Model; using Amazon.IoTWireless.Model.Internal.MarshallTransformations; using Amazon.IoTWireless.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.IoTWireless { /// <summary> /// Implementation for accessing IoTWireless /// /// AWS IoT Wireless provides bi-directional communication between internet-connected /// wireless devices and the AWS Cloud. To onboard both LoRaWAN and Sidewalk devices to /// AWS IoT, use the IoT Wireless API. These wireless devices use the Low Power Wide Area /// Networking (LPWAN) communication protocol to communicate with AWS IoT. /// /// /// <para> /// Using the API, you can perform create, read, update, and delete operations for your /// wireless devices, gateways, destinations, and profiles. After onboarding your devices, /// you can use the API operations to set log levels and monitor your devices with CloudWatch. /// </para> /// /// <para> /// You can also use the API operations to create multicast groups and schedule a multicast /// session for sending a downlink message to devices in the group. By using Firmware /// Updates Over-The-Air (FUOTA) API operations, you can create a FUOTA task and schedule /// a session to update the firmware of individual devices or an entire group of devices /// in a multicast group. /// </para> /// </summary> public partial class AmazonIoTWirelessClient : AmazonServiceClient, IAmazonIoTWireless { private static IServiceMetadata serviceMetadata = new AmazonIoTWirelessMetadata(); #region Constructors /// <summary> /// Constructs AmazonIoTWirelessClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonIoTWirelessClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonIoTWirelessConfig()) { } /// <summary> /// Constructs AmazonIoTWirelessClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonIoTWirelessClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonIoTWirelessConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTWirelessClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonIoTWirelessClient Configuration Object</param> public AmazonIoTWirelessClient(AmazonIoTWirelessConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonIoTWirelessClient(AWSCredentials credentials) : this(credentials, new AmazonIoTWirelessConfig()) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonIoTWirelessClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonIoTWirelessConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Credentials and an /// AmazonIoTWirelessClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonIoTWirelessClient Configuration Object</param> public AmazonIoTWirelessClient(AWSCredentials credentials, AmazonIoTWirelessConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonIoTWirelessConfig()) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="region">The region to connect.</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonIoTWirelessConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID, AWS Secret Key and an /// AmazonIoTWirelessClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonIoTWirelessClient Configuration Object</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonIoTWirelessConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonIoTWirelessConfig()) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="region">The region to connect.</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonIoTWirelessConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTWirelessClient with AWS Access Key ID, AWS Secret Key and an /// AmazonIoTWirelessClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="clientConfig">The AmazonIoTWirelessClient Configuration Object</param> public AmazonIoTWirelessClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonIoTWirelessConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #if AWS_ASYNC_ENUMERABLES_API private IIoTWirelessPaginatorFactory _paginators; /// <summary> /// Paginators for the service /// </summary> public IIoTWirelessPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new IoTWirelessPaginatorFactory(this); } return this._paginators; } } #endif #region Overrides /// <summary> /// Creates the signer for the service. /// </summary> protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// <summary> /// Capture metadata for the service. /// </summary> protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// <summary> /// Disposes the service client. /// </summary> protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region AssociateAwsAccountWithPartnerAccount internal virtual AssociateAwsAccountWithPartnerAccountResponse AssociateAwsAccountWithPartnerAccount(AssociateAwsAccountWithPartnerAccountRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateAwsAccountWithPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateAwsAccountWithPartnerAccountResponseUnmarshaller.Instance; return Invoke<AssociateAwsAccountWithPartnerAccountResponse>(request, options); } /// <summary> /// Associates a partner account with your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateAwsAccountWithPartnerAccount service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateAwsAccountWithPartnerAccount service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateAwsAccountWithPartnerAccount">REST API Reference for AssociateAwsAccountWithPartnerAccount Operation</seealso> public virtual Task<AssociateAwsAccountWithPartnerAccountResponse> AssociateAwsAccountWithPartnerAccountAsync(AssociateAwsAccountWithPartnerAccountRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateAwsAccountWithPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateAwsAccountWithPartnerAccountResponseUnmarshaller.Instance; return InvokeAsync<AssociateAwsAccountWithPartnerAccountResponse>(request, options, cancellationToken); } #endregion #region AssociateMulticastGroupWithFuotaTask internal virtual AssociateMulticastGroupWithFuotaTaskResponse AssociateMulticastGroupWithFuotaTask(AssociateMulticastGroupWithFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateMulticastGroupWithFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateMulticastGroupWithFuotaTaskResponseUnmarshaller.Instance; return Invoke<AssociateMulticastGroupWithFuotaTaskResponse>(request, options); } /// <summary> /// Associate a multicast group with a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateMulticastGroupWithFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateMulticastGroupWithFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateMulticastGroupWithFuotaTask">REST API Reference for AssociateMulticastGroupWithFuotaTask Operation</seealso> public virtual Task<AssociateMulticastGroupWithFuotaTaskResponse> AssociateMulticastGroupWithFuotaTaskAsync(AssociateMulticastGroupWithFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateMulticastGroupWithFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateMulticastGroupWithFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<AssociateMulticastGroupWithFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region AssociateWirelessDeviceWithFuotaTask internal virtual AssociateWirelessDeviceWithFuotaTaskResponse AssociateWirelessDeviceWithFuotaTask(AssociateWirelessDeviceWithFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithFuotaTaskResponseUnmarshaller.Instance; return Invoke<AssociateWirelessDeviceWithFuotaTaskResponse>(request, options); } /// <summary> /// Associate a wireless device with a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateWirelessDeviceWithFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateWirelessDeviceWithFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateWirelessDeviceWithFuotaTask">REST API Reference for AssociateWirelessDeviceWithFuotaTask Operation</seealso> public virtual Task<AssociateWirelessDeviceWithFuotaTaskResponse> AssociateWirelessDeviceWithFuotaTaskAsync(AssociateWirelessDeviceWithFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<AssociateWirelessDeviceWithFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region AssociateWirelessDeviceWithMulticastGroup internal virtual AssociateWirelessDeviceWithMulticastGroupResponse AssociateWirelessDeviceWithMulticastGroup(AssociateWirelessDeviceWithMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithMulticastGroupResponseUnmarshaller.Instance; return Invoke<AssociateWirelessDeviceWithMulticastGroupResponse>(request, options); } /// <summary> /// Associates a wireless device with a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateWirelessDeviceWithMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateWirelessDeviceWithMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateWirelessDeviceWithMulticastGroup">REST API Reference for AssociateWirelessDeviceWithMulticastGroup Operation</seealso> public virtual Task<AssociateWirelessDeviceWithMulticastGroupResponse> AssociateWirelessDeviceWithMulticastGroupAsync(AssociateWirelessDeviceWithMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<AssociateWirelessDeviceWithMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region AssociateWirelessDeviceWithThing internal virtual AssociateWirelessDeviceWithThingResponse AssociateWirelessDeviceWithThing(AssociateWirelessDeviceWithThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithThingRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithThingResponseUnmarshaller.Instance; return Invoke<AssociateWirelessDeviceWithThingResponse>(request, options); } /// <summary> /// Associates a wireless device with a thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateWirelessDeviceWithThing service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateWirelessDeviceWithThing service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateWirelessDeviceWithThing">REST API Reference for AssociateWirelessDeviceWithThing Operation</seealso> public virtual Task<AssociateWirelessDeviceWithThingResponse> AssociateWirelessDeviceWithThingAsync(AssociateWirelessDeviceWithThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessDeviceWithThingRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessDeviceWithThingResponseUnmarshaller.Instance; return InvokeAsync<AssociateWirelessDeviceWithThingResponse>(request, options, cancellationToken); } #endregion #region AssociateWirelessGatewayWithCertificate internal virtual AssociateWirelessGatewayWithCertificateResponse AssociateWirelessGatewayWithCertificate(AssociateWirelessGatewayWithCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessGatewayWithCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessGatewayWithCertificateResponseUnmarshaller.Instance; return Invoke<AssociateWirelessGatewayWithCertificateResponse>(request, options); } /// <summary> /// Associates a wireless gateway with a certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateWirelessGatewayWithCertificate service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateWirelessGatewayWithCertificate service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateWirelessGatewayWithCertificate">REST API Reference for AssociateWirelessGatewayWithCertificate Operation</seealso> public virtual Task<AssociateWirelessGatewayWithCertificateResponse> AssociateWirelessGatewayWithCertificateAsync(AssociateWirelessGatewayWithCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessGatewayWithCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessGatewayWithCertificateResponseUnmarshaller.Instance; return InvokeAsync<AssociateWirelessGatewayWithCertificateResponse>(request, options, cancellationToken); } #endregion #region AssociateWirelessGatewayWithThing internal virtual AssociateWirelessGatewayWithThingResponse AssociateWirelessGatewayWithThing(AssociateWirelessGatewayWithThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessGatewayWithThingRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessGatewayWithThingResponseUnmarshaller.Instance; return Invoke<AssociateWirelessGatewayWithThingResponse>(request, options); } /// <summary> /// Associates a wireless gateway with a thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateWirelessGatewayWithThing service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the AssociateWirelessGatewayWithThing service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/AssociateWirelessGatewayWithThing">REST API Reference for AssociateWirelessGatewayWithThing Operation</seealso> public virtual Task<AssociateWirelessGatewayWithThingResponse> AssociateWirelessGatewayWithThingAsync(AssociateWirelessGatewayWithThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateWirelessGatewayWithThingRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateWirelessGatewayWithThingResponseUnmarshaller.Instance; return InvokeAsync<AssociateWirelessGatewayWithThingResponse>(request, options, cancellationToken); } #endregion #region CancelMulticastGroupSession internal virtual CancelMulticastGroupSessionResponse CancelMulticastGroupSession(CancelMulticastGroupSessionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelMulticastGroupSessionResponseUnmarshaller.Instance; return Invoke<CancelMulticastGroupSessionResponse>(request, options); } /// <summary> /// Cancels an existing multicast group session. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelMulticastGroupSession service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CancelMulticastGroupSession service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CancelMulticastGroupSession">REST API Reference for CancelMulticastGroupSession Operation</seealso> public virtual Task<CancelMulticastGroupSessionResponse> CancelMulticastGroupSessionAsync(CancelMulticastGroupSessionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelMulticastGroupSessionResponseUnmarshaller.Instance; return InvokeAsync<CancelMulticastGroupSessionResponse>(request, options, cancellationToken); } #endregion #region CreateDestination internal virtual CreateDestinationResponse CreateDestination(CreateDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDestinationResponseUnmarshaller.Instance; return Invoke<CreateDestinationResponse>(request, options); } /// <summary> /// Creates a new destination that maps a device message to an AWS IoT rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDestination service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateDestination service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateDestination">REST API Reference for CreateDestination Operation</seealso> public virtual Task<CreateDestinationResponse> CreateDestinationAsync(CreateDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDestinationResponseUnmarshaller.Instance; return InvokeAsync<CreateDestinationResponse>(request, options, cancellationToken); } #endregion #region CreateDeviceProfile internal virtual CreateDeviceProfileResponse CreateDeviceProfile(CreateDeviceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDeviceProfileResponseUnmarshaller.Instance; return Invoke<CreateDeviceProfileResponse>(request, options); } /// <summary> /// Creates a new device profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDeviceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateDeviceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateDeviceProfile">REST API Reference for CreateDeviceProfile Operation</seealso> public virtual Task<CreateDeviceProfileResponse> CreateDeviceProfileAsync(CreateDeviceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDeviceProfileResponseUnmarshaller.Instance; return InvokeAsync<CreateDeviceProfileResponse>(request, options, cancellationToken); } #endregion #region CreateFuotaTask internal virtual CreateFuotaTaskResponse CreateFuotaTask(CreateFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateFuotaTaskResponseUnmarshaller.Instance; return Invoke<CreateFuotaTaskResponse>(request, options); } /// <summary> /// Creates a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateFuotaTask">REST API Reference for CreateFuotaTask Operation</seealso> public virtual Task<CreateFuotaTaskResponse> CreateFuotaTaskAsync(CreateFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<CreateFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region CreateMulticastGroup internal virtual CreateMulticastGroupResponse CreateMulticastGroup(CreateMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMulticastGroupResponseUnmarshaller.Instance; return Invoke<CreateMulticastGroupResponse>(request, options); } /// <summary> /// Creates a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateMulticastGroup">REST API Reference for CreateMulticastGroup Operation</seealso> public virtual Task<CreateMulticastGroupResponse> CreateMulticastGroupAsync(CreateMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region CreateServiceProfile internal virtual CreateServiceProfileResponse CreateServiceProfile(CreateServiceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateServiceProfileResponseUnmarshaller.Instance; return Invoke<CreateServiceProfileResponse>(request, options); } /// <summary> /// Creates a new service profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateServiceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateServiceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateServiceProfile">REST API Reference for CreateServiceProfile Operation</seealso> public virtual Task<CreateServiceProfileResponse> CreateServiceProfileAsync(CreateServiceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateServiceProfileResponseUnmarshaller.Instance; return InvokeAsync<CreateServiceProfileResponse>(request, options, cancellationToken); } #endregion #region CreateWirelessDevice internal virtual CreateWirelessDeviceResponse CreateWirelessDevice(CreateWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessDeviceResponseUnmarshaller.Instance; return Invoke<CreateWirelessDeviceResponse>(request, options); } /// <summary> /// Provisions a wireless device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateWirelessDevice">REST API Reference for CreateWirelessDevice Operation</seealso> public virtual Task<CreateWirelessDeviceResponse> CreateWirelessDeviceAsync(CreateWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<CreateWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region CreateWirelessGateway internal virtual CreateWirelessGatewayResponse CreateWirelessGateway(CreateWirelessGatewayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayResponseUnmarshaller.Instance; return Invoke<CreateWirelessGatewayResponse>(request, options); } /// <summary> /// Provisions a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateWirelessGateway service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateWirelessGateway service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateWirelessGateway">REST API Reference for CreateWirelessGateway Operation</seealso> public virtual Task<CreateWirelessGatewayResponse> CreateWirelessGatewayAsync(CreateWirelessGatewayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayResponseUnmarshaller.Instance; return InvokeAsync<CreateWirelessGatewayResponse>(request, options, cancellationToken); } #endregion #region CreateWirelessGatewayTask internal virtual CreateWirelessGatewayTaskResponse CreateWirelessGatewayTask(CreateWirelessGatewayTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayTaskResponseUnmarshaller.Instance; return Invoke<CreateWirelessGatewayTaskResponse>(request, options); } /// <summary> /// Creates a task for a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateWirelessGatewayTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateWirelessGatewayTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateWirelessGatewayTask">REST API Reference for CreateWirelessGatewayTask Operation</seealso> public virtual Task<CreateWirelessGatewayTaskResponse> CreateWirelessGatewayTaskAsync(CreateWirelessGatewayTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayTaskResponseUnmarshaller.Instance; return InvokeAsync<CreateWirelessGatewayTaskResponse>(request, options, cancellationToken); } #endregion #region CreateWirelessGatewayTaskDefinition internal virtual CreateWirelessGatewayTaskDefinitionResponse CreateWirelessGatewayTaskDefinition(CreateWirelessGatewayTaskDefinitionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return Invoke<CreateWirelessGatewayTaskDefinitionResponse>(request, options); } /// <summary> /// Creates a gateway task definition. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateWirelessGatewayTaskDefinition service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateWirelessGatewayTaskDefinition service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/CreateWirelessGatewayTaskDefinition">REST API Reference for CreateWirelessGatewayTaskDefinition Operation</seealso> public virtual Task<CreateWirelessGatewayTaskDefinitionResponse> CreateWirelessGatewayTaskDefinitionAsync(CreateWirelessGatewayTaskDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return InvokeAsync<CreateWirelessGatewayTaskDefinitionResponse>(request, options, cancellationToken); } #endregion #region DeleteDestination internal virtual DeleteDestinationResponse DeleteDestination(DeleteDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDestinationResponseUnmarshaller.Instance; return Invoke<DeleteDestinationResponse>(request, options); } /// <summary> /// Deletes a destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDestination service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteDestination service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteDestination">REST API Reference for DeleteDestination Operation</seealso> public virtual Task<DeleteDestinationResponse> DeleteDestinationAsync(DeleteDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDestinationResponseUnmarshaller.Instance; return InvokeAsync<DeleteDestinationResponse>(request, options, cancellationToken); } #endregion #region DeleteDeviceProfile internal virtual DeleteDeviceProfileResponse DeleteDeviceProfile(DeleteDeviceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDeviceProfileResponseUnmarshaller.Instance; return Invoke<DeleteDeviceProfileResponse>(request, options); } /// <summary> /// Deletes a device profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDeviceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteDeviceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteDeviceProfile">REST API Reference for DeleteDeviceProfile Operation</seealso> public virtual Task<DeleteDeviceProfileResponse> DeleteDeviceProfileAsync(DeleteDeviceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDeviceProfileResponseUnmarshaller.Instance; return InvokeAsync<DeleteDeviceProfileResponse>(request, options, cancellationToken); } #endregion #region DeleteFuotaTask internal virtual DeleteFuotaTaskResponse DeleteFuotaTask(DeleteFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteFuotaTaskResponseUnmarshaller.Instance; return Invoke<DeleteFuotaTaskResponse>(request, options); } /// <summary> /// Deletes a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteFuotaTask">REST API Reference for DeleteFuotaTask Operation</seealso> public virtual Task<DeleteFuotaTaskResponse> DeleteFuotaTaskAsync(DeleteFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<DeleteFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region DeleteMulticastGroup internal virtual DeleteMulticastGroupResponse DeleteMulticastGroup(DeleteMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMulticastGroupResponseUnmarshaller.Instance; return Invoke<DeleteMulticastGroupResponse>(request, options); } /// <summary> /// Deletes a multicast group if it is not in use by a fuota task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteMulticastGroup">REST API Reference for DeleteMulticastGroup Operation</seealso> public virtual Task<DeleteMulticastGroupResponse> DeleteMulticastGroupAsync(DeleteMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region DeleteQueuedMessages internal virtual DeleteQueuedMessagesResponse DeleteQueuedMessages(DeleteQueuedMessagesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteQueuedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteQueuedMessagesResponseUnmarshaller.Instance; return Invoke<DeleteQueuedMessagesResponse>(request, options); } /// <summary> /// The operation to delete queued messages. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteQueuedMessages service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteQueuedMessages service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteQueuedMessages">REST API Reference for DeleteQueuedMessages Operation</seealso> public virtual Task<DeleteQueuedMessagesResponse> DeleteQueuedMessagesAsync(DeleteQueuedMessagesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteQueuedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteQueuedMessagesResponseUnmarshaller.Instance; return InvokeAsync<DeleteQueuedMessagesResponse>(request, options, cancellationToken); } #endregion #region DeleteServiceProfile internal virtual DeleteServiceProfileResponse DeleteServiceProfile(DeleteServiceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteServiceProfileResponseUnmarshaller.Instance; return Invoke<DeleteServiceProfileResponse>(request, options); } /// <summary> /// Deletes a service profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteServiceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteServiceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteServiceProfile">REST API Reference for DeleteServiceProfile Operation</seealso> public virtual Task<DeleteServiceProfileResponse> DeleteServiceProfileAsync(DeleteServiceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteServiceProfileResponseUnmarshaller.Instance; return InvokeAsync<DeleteServiceProfileResponse>(request, options, cancellationToken); } #endregion #region DeleteWirelessDevice internal virtual DeleteWirelessDeviceResponse DeleteWirelessDevice(DeleteWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessDeviceResponseUnmarshaller.Instance; return Invoke<DeleteWirelessDeviceResponse>(request, options); } /// <summary> /// Deletes a wireless device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteWirelessDevice">REST API Reference for DeleteWirelessDevice Operation</seealso> public virtual Task<DeleteWirelessDeviceResponse> DeleteWirelessDeviceAsync(DeleteWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<DeleteWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region DeleteWirelessGateway internal virtual DeleteWirelessGatewayResponse DeleteWirelessGateway(DeleteWirelessGatewayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayResponseUnmarshaller.Instance; return Invoke<DeleteWirelessGatewayResponse>(request, options); } /// <summary> /// Deletes a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWirelessGateway service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteWirelessGateway service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteWirelessGateway">REST API Reference for DeleteWirelessGateway Operation</seealso> public virtual Task<DeleteWirelessGatewayResponse> DeleteWirelessGatewayAsync(DeleteWirelessGatewayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayResponseUnmarshaller.Instance; return InvokeAsync<DeleteWirelessGatewayResponse>(request, options, cancellationToken); } #endregion #region DeleteWirelessGatewayTask internal virtual DeleteWirelessGatewayTaskResponse DeleteWirelessGatewayTask(DeleteWirelessGatewayTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayTaskResponseUnmarshaller.Instance; return Invoke<DeleteWirelessGatewayTaskResponse>(request, options); } /// <summary> /// Deletes a wireless gateway task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWirelessGatewayTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteWirelessGatewayTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteWirelessGatewayTask">REST API Reference for DeleteWirelessGatewayTask Operation</seealso> public virtual Task<DeleteWirelessGatewayTaskResponse> DeleteWirelessGatewayTaskAsync(DeleteWirelessGatewayTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayTaskResponseUnmarshaller.Instance; return InvokeAsync<DeleteWirelessGatewayTaskResponse>(request, options, cancellationToken); } #endregion #region DeleteWirelessGatewayTaskDefinition internal virtual DeleteWirelessGatewayTaskDefinitionResponse DeleteWirelessGatewayTaskDefinition(DeleteWirelessGatewayTaskDefinitionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return Invoke<DeleteWirelessGatewayTaskDefinitionResponse>(request, options); } /// <summary> /// Deletes a wireless gateway task definition. Deleting this task definition does not /// affect tasks that are currently in progress. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWirelessGatewayTaskDefinition service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteWirelessGatewayTaskDefinition service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DeleteWirelessGatewayTaskDefinition">REST API Reference for DeleteWirelessGatewayTaskDefinition Operation</seealso> public virtual Task<DeleteWirelessGatewayTaskDefinitionResponse> DeleteWirelessGatewayTaskDefinitionAsync(DeleteWirelessGatewayTaskDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return InvokeAsync<DeleteWirelessGatewayTaskDefinitionResponse>(request, options, cancellationToken); } #endregion #region DisassociateAwsAccountFromPartnerAccount internal virtual DisassociateAwsAccountFromPartnerAccountResponse DisassociateAwsAccountFromPartnerAccount(DisassociateAwsAccountFromPartnerAccountRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateAwsAccountFromPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateAwsAccountFromPartnerAccountResponseUnmarshaller.Instance; return Invoke<DisassociateAwsAccountFromPartnerAccountResponse>(request, options); } /// <summary> /// Disassociates your AWS account from a partner account. If <code>PartnerAccountId</code> /// and <code>PartnerType</code> are <code>null</code>, disassociates your AWS account /// from all partner accounts. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateAwsAccountFromPartnerAccount service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateAwsAccountFromPartnerAccount service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateAwsAccountFromPartnerAccount">REST API Reference for DisassociateAwsAccountFromPartnerAccount Operation</seealso> public virtual Task<DisassociateAwsAccountFromPartnerAccountResponse> DisassociateAwsAccountFromPartnerAccountAsync(DisassociateAwsAccountFromPartnerAccountRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateAwsAccountFromPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateAwsAccountFromPartnerAccountResponseUnmarshaller.Instance; return InvokeAsync<DisassociateAwsAccountFromPartnerAccountResponse>(request, options, cancellationToken); } #endregion #region DisassociateMulticastGroupFromFuotaTask internal virtual DisassociateMulticastGroupFromFuotaTaskResponse DisassociateMulticastGroupFromFuotaTask(DisassociateMulticastGroupFromFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateMulticastGroupFromFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateMulticastGroupFromFuotaTaskResponseUnmarshaller.Instance; return Invoke<DisassociateMulticastGroupFromFuotaTaskResponse>(request, options); } /// <summary> /// Disassociates a multicast group from a fuota task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateMulticastGroupFromFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateMulticastGroupFromFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateMulticastGroupFromFuotaTask">REST API Reference for DisassociateMulticastGroupFromFuotaTask Operation</seealso> public virtual Task<DisassociateMulticastGroupFromFuotaTaskResponse> DisassociateMulticastGroupFromFuotaTaskAsync(DisassociateMulticastGroupFromFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateMulticastGroupFromFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateMulticastGroupFromFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<DisassociateMulticastGroupFromFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region DisassociateWirelessDeviceFromFuotaTask internal virtual DisassociateWirelessDeviceFromFuotaTaskResponse DisassociateWirelessDeviceFromFuotaTask(DisassociateWirelessDeviceFromFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromFuotaTaskResponseUnmarshaller.Instance; return Invoke<DisassociateWirelessDeviceFromFuotaTaskResponse>(request, options); } /// <summary> /// Disassociates a wireless device from a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateWirelessDeviceFromFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateWirelessDeviceFromFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateWirelessDeviceFromFuotaTask">REST API Reference for DisassociateWirelessDeviceFromFuotaTask Operation</seealso> public virtual Task<DisassociateWirelessDeviceFromFuotaTaskResponse> DisassociateWirelessDeviceFromFuotaTaskAsync(DisassociateWirelessDeviceFromFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<DisassociateWirelessDeviceFromFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region DisassociateWirelessDeviceFromMulticastGroup internal virtual DisassociateWirelessDeviceFromMulticastGroupResponse DisassociateWirelessDeviceFromMulticastGroup(DisassociateWirelessDeviceFromMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromMulticastGroupResponseUnmarshaller.Instance; return Invoke<DisassociateWirelessDeviceFromMulticastGroupResponse>(request, options); } /// <summary> /// Disassociates a wireless device from a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateWirelessDeviceFromMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateWirelessDeviceFromMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateWirelessDeviceFromMulticastGroup">REST API Reference for DisassociateWirelessDeviceFromMulticastGroup Operation</seealso> public virtual Task<DisassociateWirelessDeviceFromMulticastGroupResponse> DisassociateWirelessDeviceFromMulticastGroupAsync(DisassociateWirelessDeviceFromMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<DisassociateWirelessDeviceFromMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region DisassociateWirelessDeviceFromThing internal virtual DisassociateWirelessDeviceFromThingResponse DisassociateWirelessDeviceFromThing(DisassociateWirelessDeviceFromThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromThingResponseUnmarshaller.Instance; return Invoke<DisassociateWirelessDeviceFromThingResponse>(request, options); } /// <summary> /// Disassociates a wireless device from its currently associated thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateWirelessDeviceFromThing service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateWirelessDeviceFromThing service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateWirelessDeviceFromThing">REST API Reference for DisassociateWirelessDeviceFromThing Operation</seealso> public virtual Task<DisassociateWirelessDeviceFromThingResponse> DisassociateWirelessDeviceFromThingAsync(DisassociateWirelessDeviceFromThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessDeviceFromThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessDeviceFromThingResponseUnmarshaller.Instance; return InvokeAsync<DisassociateWirelessDeviceFromThingResponse>(request, options, cancellationToken); } #endregion #region DisassociateWirelessGatewayFromCertificate internal virtual DisassociateWirelessGatewayFromCertificateResponse DisassociateWirelessGatewayFromCertificate(DisassociateWirelessGatewayFromCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessGatewayFromCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessGatewayFromCertificateResponseUnmarshaller.Instance; return Invoke<DisassociateWirelessGatewayFromCertificateResponse>(request, options); } /// <summary> /// Disassociates a wireless gateway from its currently associated certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateWirelessGatewayFromCertificate service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateWirelessGatewayFromCertificate service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateWirelessGatewayFromCertificate">REST API Reference for DisassociateWirelessGatewayFromCertificate Operation</seealso> public virtual Task<DisassociateWirelessGatewayFromCertificateResponse> DisassociateWirelessGatewayFromCertificateAsync(DisassociateWirelessGatewayFromCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessGatewayFromCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessGatewayFromCertificateResponseUnmarshaller.Instance; return InvokeAsync<DisassociateWirelessGatewayFromCertificateResponse>(request, options, cancellationToken); } #endregion #region DisassociateWirelessGatewayFromThing internal virtual DisassociateWirelessGatewayFromThingResponse DisassociateWirelessGatewayFromThing(DisassociateWirelessGatewayFromThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessGatewayFromThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessGatewayFromThingResponseUnmarshaller.Instance; return Invoke<DisassociateWirelessGatewayFromThingResponse>(request, options); } /// <summary> /// Disassociates a wireless gateway from its currently associated thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateWirelessGatewayFromThing service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DisassociateWirelessGatewayFromThing service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/DisassociateWirelessGatewayFromThing">REST API Reference for DisassociateWirelessGatewayFromThing Operation</seealso> public virtual Task<DisassociateWirelessGatewayFromThingResponse> DisassociateWirelessGatewayFromThingAsync(DisassociateWirelessGatewayFromThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisassociateWirelessGatewayFromThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DisassociateWirelessGatewayFromThingResponseUnmarshaller.Instance; return InvokeAsync<DisassociateWirelessGatewayFromThingResponse>(request, options, cancellationToken); } #endregion #region GetDestination internal virtual GetDestinationResponse GetDestination(GetDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDestinationResponseUnmarshaller.Instance; return Invoke<GetDestinationResponse>(request, options); } /// <summary> /// Gets information about a destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetDestination service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetDestination service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetDestination">REST API Reference for GetDestination Operation</seealso> public virtual Task<GetDestinationResponse> GetDestinationAsync(GetDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDestinationResponseUnmarshaller.Instance; return InvokeAsync<GetDestinationResponse>(request, options, cancellationToken); } #endregion #region GetDeviceProfile internal virtual GetDeviceProfileResponse GetDeviceProfile(GetDeviceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDeviceProfileResponseUnmarshaller.Instance; return Invoke<GetDeviceProfileResponse>(request, options); } /// <summary> /// Gets information about a device profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetDeviceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetDeviceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetDeviceProfile">REST API Reference for GetDeviceProfile Operation</seealso> public virtual Task<GetDeviceProfileResponse> GetDeviceProfileAsync(GetDeviceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetDeviceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDeviceProfileResponseUnmarshaller.Instance; return InvokeAsync<GetDeviceProfileResponse>(request, options, cancellationToken); } #endregion #region GetFuotaTask internal virtual GetFuotaTaskResponse GetFuotaTask(GetFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFuotaTaskResponseUnmarshaller.Instance; return Invoke<GetFuotaTaskResponse>(request, options); } /// <summary> /// Gets information about a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetFuotaTask">REST API Reference for GetFuotaTask Operation</seealso> public virtual Task<GetFuotaTaskResponse> GetFuotaTaskAsync(GetFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<GetFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region GetLogLevelsByResourceTypes internal virtual GetLogLevelsByResourceTypesResponse GetLogLevelsByResourceTypes(GetLogLevelsByResourceTypesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetLogLevelsByResourceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetLogLevelsByResourceTypesResponseUnmarshaller.Instance; return Invoke<GetLogLevelsByResourceTypesResponse>(request, options); } /// <summary> /// Returns current default log levels or log levels by resource types. Based on resource /// types, log levels can be for wireless device log options or wireless gateway log options. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetLogLevelsByResourceTypes service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetLogLevelsByResourceTypes service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetLogLevelsByResourceTypes">REST API Reference for GetLogLevelsByResourceTypes Operation</seealso> public virtual Task<GetLogLevelsByResourceTypesResponse> GetLogLevelsByResourceTypesAsync(GetLogLevelsByResourceTypesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetLogLevelsByResourceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetLogLevelsByResourceTypesResponseUnmarshaller.Instance; return InvokeAsync<GetLogLevelsByResourceTypesResponse>(request, options, cancellationToken); } #endregion #region GetMulticastGroup internal virtual GetMulticastGroupResponse GetMulticastGroup(GetMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMulticastGroupResponseUnmarshaller.Instance; return Invoke<GetMulticastGroupResponse>(request, options); } /// <summary> /// Gets information about a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetMulticastGroup">REST API Reference for GetMulticastGroup Operation</seealso> public virtual Task<GetMulticastGroupResponse> GetMulticastGroupAsync(GetMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<GetMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region GetMulticastGroupSession internal virtual GetMulticastGroupSessionResponse GetMulticastGroupSession(GetMulticastGroupSessionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMulticastGroupSessionResponseUnmarshaller.Instance; return Invoke<GetMulticastGroupSessionResponse>(request, options); } /// <summary> /// Gets information about a multicast group session. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMulticastGroupSession service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetMulticastGroupSession service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetMulticastGroupSession">REST API Reference for GetMulticastGroupSession Operation</seealso> public virtual Task<GetMulticastGroupSessionResponse> GetMulticastGroupSessionAsync(GetMulticastGroupSessionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMulticastGroupSessionResponseUnmarshaller.Instance; return InvokeAsync<GetMulticastGroupSessionResponse>(request, options, cancellationToken); } #endregion #region GetNetworkAnalyzerConfiguration internal virtual GetNetworkAnalyzerConfigurationResponse GetNetworkAnalyzerConfiguration(GetNetworkAnalyzerConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetNetworkAnalyzerConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetNetworkAnalyzerConfigurationResponseUnmarshaller.Instance; return Invoke<GetNetworkAnalyzerConfigurationResponse>(request, options); } /// <summary> /// Get NetworkAnalyzer configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetNetworkAnalyzerConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetNetworkAnalyzerConfiguration service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetNetworkAnalyzerConfiguration">REST API Reference for GetNetworkAnalyzerConfiguration Operation</seealso> public virtual Task<GetNetworkAnalyzerConfigurationResponse> GetNetworkAnalyzerConfigurationAsync(GetNetworkAnalyzerConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetNetworkAnalyzerConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetNetworkAnalyzerConfigurationResponseUnmarshaller.Instance; return InvokeAsync<GetNetworkAnalyzerConfigurationResponse>(request, options, cancellationToken); } #endregion #region GetPartnerAccount internal virtual GetPartnerAccountResponse GetPartnerAccount(GetPartnerAccountRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPartnerAccountResponseUnmarshaller.Instance; return Invoke<GetPartnerAccountResponse>(request, options); } /// <summary> /// Gets information about a partner account. If <code>PartnerAccountId</code> and <code>PartnerType</code> /// are <code>null</code>, returns all partner accounts. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPartnerAccount service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetPartnerAccount service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetPartnerAccount">REST API Reference for GetPartnerAccount Operation</seealso> public virtual Task<GetPartnerAccountResponse> GetPartnerAccountAsync(GetPartnerAccountRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPartnerAccountResponseUnmarshaller.Instance; return InvokeAsync<GetPartnerAccountResponse>(request, options, cancellationToken); } #endregion #region GetResourceEventConfiguration internal virtual GetResourceEventConfigurationResponse GetResourceEventConfiguration(GetResourceEventConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceEventConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceEventConfigurationResponseUnmarshaller.Instance; return Invoke<GetResourceEventConfigurationResponse>(request, options); } /// <summary> /// Get the event configuration for a particular resource identifier. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetResourceEventConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetResourceEventConfiguration service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetResourceEventConfiguration">REST API Reference for GetResourceEventConfiguration Operation</seealso> public virtual Task<GetResourceEventConfigurationResponse> GetResourceEventConfigurationAsync(GetResourceEventConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceEventConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceEventConfigurationResponseUnmarshaller.Instance; return InvokeAsync<GetResourceEventConfigurationResponse>(request, options, cancellationToken); } #endregion #region GetResourceLogLevel internal virtual GetResourceLogLevelResponse GetResourceLogLevel(GetResourceLogLevelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceLogLevelResponseUnmarshaller.Instance; return Invoke<GetResourceLogLevelResponse>(request, options); } /// <summary> /// Fetches the log-level override, if any, for a given resource-ID and resource-type. /// It can be used for a wireless device or a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetResourceLogLevel service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetResourceLogLevel service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetResourceLogLevel">REST API Reference for GetResourceLogLevel Operation</seealso> public virtual Task<GetResourceLogLevelResponse> GetResourceLogLevelAsync(GetResourceLogLevelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceLogLevelResponseUnmarshaller.Instance; return InvokeAsync<GetResourceLogLevelResponse>(request, options, cancellationToken); } #endregion #region GetServiceEndpoint internal virtual GetServiceEndpointResponse GetServiceEndpoint(GetServiceEndpointRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetServiceEndpointRequestMarshaller.Instance; options.ResponseUnmarshaller = GetServiceEndpointResponseUnmarshaller.Instance; return Invoke<GetServiceEndpointResponse>(request, options); } /// <summary> /// Gets the account-specific endpoint for Configuration and Update Server (CUPS) protocol /// or LoRaWAN Network Server (LNS) connections. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetServiceEndpoint service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetServiceEndpoint service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetServiceEndpoint">REST API Reference for GetServiceEndpoint Operation</seealso> public virtual Task<GetServiceEndpointResponse> GetServiceEndpointAsync(GetServiceEndpointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetServiceEndpointRequestMarshaller.Instance; options.ResponseUnmarshaller = GetServiceEndpointResponseUnmarshaller.Instance; return InvokeAsync<GetServiceEndpointResponse>(request, options, cancellationToken); } #endregion #region GetServiceProfile internal virtual GetServiceProfileResponse GetServiceProfile(GetServiceProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetServiceProfileResponseUnmarshaller.Instance; return Invoke<GetServiceProfileResponse>(request, options); } /// <summary> /// Gets information about a service profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetServiceProfile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetServiceProfile service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetServiceProfile">REST API Reference for GetServiceProfile Operation</seealso> public virtual Task<GetServiceProfileResponse> GetServiceProfileAsync(GetServiceProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetServiceProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetServiceProfileResponseUnmarshaller.Instance; return InvokeAsync<GetServiceProfileResponse>(request, options, cancellationToken); } #endregion #region GetWirelessDevice internal virtual GetWirelessDeviceResponse GetWirelessDevice(GetWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessDeviceResponseUnmarshaller.Instance; return Invoke<GetWirelessDeviceResponse>(request, options); } /// <summary> /// Gets information about a wireless device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessDevice">REST API Reference for GetWirelessDevice Operation</seealso> public virtual Task<GetWirelessDeviceResponse> GetWirelessDeviceAsync(GetWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region GetWirelessDeviceStatistics internal virtual GetWirelessDeviceStatisticsResponse GetWirelessDeviceStatistics(GetWirelessDeviceStatisticsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessDeviceStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessDeviceStatisticsResponseUnmarshaller.Instance; return Invoke<GetWirelessDeviceStatisticsResponse>(request, options); } /// <summary> /// Gets operating information about a wireless device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessDeviceStatistics service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessDeviceStatistics service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessDeviceStatistics">REST API Reference for GetWirelessDeviceStatistics Operation</seealso> public virtual Task<GetWirelessDeviceStatisticsResponse> GetWirelessDeviceStatisticsAsync(GetWirelessDeviceStatisticsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessDeviceStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessDeviceStatisticsResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessDeviceStatisticsResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGateway internal virtual GetWirelessGatewayResponse GetWirelessGateway(GetWirelessGatewayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayResponse>(request, options); } /// <summary> /// Gets information about a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGateway service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGateway service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGateway">REST API Reference for GetWirelessGateway Operation</seealso> public virtual Task<GetWirelessGatewayResponse> GetWirelessGatewayAsync(GetWirelessGatewayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGatewayCertificate internal virtual GetWirelessGatewayCertificateResponse GetWirelessGatewayCertificate(GetWirelessGatewayCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayCertificateResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayCertificateResponse>(request, options); } /// <summary> /// Gets the ID of the certificate that is currently associated with a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGatewayCertificate service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGatewayCertificate service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGatewayCertificate">REST API Reference for GetWirelessGatewayCertificate Operation</seealso> public virtual Task<GetWirelessGatewayCertificateResponse> GetWirelessGatewayCertificateAsync(GetWirelessGatewayCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayCertificateResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayCertificateResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGatewayFirmwareInformation internal virtual GetWirelessGatewayFirmwareInformationResponse GetWirelessGatewayFirmwareInformation(GetWirelessGatewayFirmwareInformationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayFirmwareInformationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayFirmwareInformationResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayFirmwareInformationResponse>(request, options); } /// <summary> /// Gets the firmware version and other information about a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGatewayFirmwareInformation service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGatewayFirmwareInformation service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGatewayFirmwareInformation">REST API Reference for GetWirelessGatewayFirmwareInformation Operation</seealso> public virtual Task<GetWirelessGatewayFirmwareInformationResponse> GetWirelessGatewayFirmwareInformationAsync(GetWirelessGatewayFirmwareInformationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayFirmwareInformationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayFirmwareInformationResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayFirmwareInformationResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGatewayStatistics internal virtual GetWirelessGatewayStatisticsResponse GetWirelessGatewayStatistics(GetWirelessGatewayStatisticsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayStatisticsResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayStatisticsResponse>(request, options); } /// <summary> /// Gets operating information about a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGatewayStatistics service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGatewayStatistics service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGatewayStatistics">REST API Reference for GetWirelessGatewayStatistics Operation</seealso> public virtual Task<GetWirelessGatewayStatisticsResponse> GetWirelessGatewayStatisticsAsync(GetWirelessGatewayStatisticsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayStatisticsResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayStatisticsResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGatewayTask internal virtual GetWirelessGatewayTaskResponse GetWirelessGatewayTask(GetWirelessGatewayTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayTaskResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayTaskResponse>(request, options); } /// <summary> /// Gets information about a wireless gateway task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGatewayTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGatewayTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGatewayTask">REST API Reference for GetWirelessGatewayTask Operation</seealso> public virtual Task<GetWirelessGatewayTaskResponse> GetWirelessGatewayTaskAsync(GetWirelessGatewayTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayTaskResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayTaskResponse>(request, options, cancellationToken); } #endregion #region GetWirelessGatewayTaskDefinition internal virtual GetWirelessGatewayTaskDefinitionResponse GetWirelessGatewayTaskDefinition(GetWirelessGatewayTaskDefinitionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return Invoke<GetWirelessGatewayTaskDefinitionResponse>(request, options); } /// <summary> /// Gets information about a wireless gateway task definition. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetWirelessGatewayTaskDefinition service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetWirelessGatewayTaskDefinition service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/GetWirelessGatewayTaskDefinition">REST API Reference for GetWirelessGatewayTaskDefinition Operation</seealso> public virtual Task<GetWirelessGatewayTaskDefinitionResponse> GetWirelessGatewayTaskDefinitionAsync(GetWirelessGatewayTaskDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetWirelessGatewayTaskDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetWirelessGatewayTaskDefinitionResponseUnmarshaller.Instance; return InvokeAsync<GetWirelessGatewayTaskDefinitionResponse>(request, options, cancellationToken); } #endregion #region ListDestinations internal virtual ListDestinationsResponse ListDestinations(ListDestinationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDestinationsResponseUnmarshaller.Instance; return Invoke<ListDestinationsResponse>(request, options); } /// <summary> /// Lists the destinations registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDestinations service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListDestinations service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListDestinations">REST API Reference for ListDestinations Operation</seealso> public virtual Task<ListDestinationsResponse> ListDestinationsAsync(ListDestinationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDestinationsResponseUnmarshaller.Instance; return InvokeAsync<ListDestinationsResponse>(request, options, cancellationToken); } #endregion #region ListDeviceProfiles internal virtual ListDeviceProfilesResponse ListDeviceProfiles(ListDeviceProfilesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDeviceProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDeviceProfilesResponseUnmarshaller.Instance; return Invoke<ListDeviceProfilesResponse>(request, options); } /// <summary> /// Lists the device profiles registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDeviceProfiles service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListDeviceProfiles service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListDeviceProfiles">REST API Reference for ListDeviceProfiles Operation</seealso> public virtual Task<ListDeviceProfilesResponse> ListDeviceProfilesAsync(ListDeviceProfilesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListDeviceProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDeviceProfilesResponseUnmarshaller.Instance; return InvokeAsync<ListDeviceProfilesResponse>(request, options, cancellationToken); } #endregion #region ListFuotaTasks internal virtual ListFuotaTasksResponse ListFuotaTasks(ListFuotaTasksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListFuotaTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListFuotaTasksResponseUnmarshaller.Instance; return Invoke<ListFuotaTasksResponse>(request, options); } /// <summary> /// Lists the FUOTA tasks registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListFuotaTasks service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListFuotaTasks service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListFuotaTasks">REST API Reference for ListFuotaTasks Operation</seealso> public virtual Task<ListFuotaTasksResponse> ListFuotaTasksAsync(ListFuotaTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListFuotaTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListFuotaTasksResponseUnmarshaller.Instance; return InvokeAsync<ListFuotaTasksResponse>(request, options, cancellationToken); } #endregion #region ListMulticastGroups internal virtual ListMulticastGroupsResponse ListMulticastGroups(ListMulticastGroupsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListMulticastGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMulticastGroupsResponseUnmarshaller.Instance; return Invoke<ListMulticastGroupsResponse>(request, options); } /// <summary> /// Lists the multicast groups registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListMulticastGroups service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListMulticastGroups service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListMulticastGroups">REST API Reference for ListMulticastGroups Operation</seealso> public virtual Task<ListMulticastGroupsResponse> ListMulticastGroupsAsync(ListMulticastGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListMulticastGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMulticastGroupsResponseUnmarshaller.Instance; return InvokeAsync<ListMulticastGroupsResponse>(request, options, cancellationToken); } #endregion #region ListMulticastGroupsByFuotaTask internal virtual ListMulticastGroupsByFuotaTaskResponse ListMulticastGroupsByFuotaTask(ListMulticastGroupsByFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListMulticastGroupsByFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMulticastGroupsByFuotaTaskResponseUnmarshaller.Instance; return Invoke<ListMulticastGroupsByFuotaTaskResponse>(request, options); } /// <summary> /// List all multicast groups associated with a fuota task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListMulticastGroupsByFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListMulticastGroupsByFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListMulticastGroupsByFuotaTask">REST API Reference for ListMulticastGroupsByFuotaTask Operation</seealso> public virtual Task<ListMulticastGroupsByFuotaTaskResponse> ListMulticastGroupsByFuotaTaskAsync(ListMulticastGroupsByFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListMulticastGroupsByFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMulticastGroupsByFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<ListMulticastGroupsByFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region ListPartnerAccounts internal virtual ListPartnerAccountsResponse ListPartnerAccounts(ListPartnerAccountsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPartnerAccountsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPartnerAccountsResponseUnmarshaller.Instance; return Invoke<ListPartnerAccountsResponse>(request, options); } /// <summary> /// Lists the partner accounts associated with your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPartnerAccounts service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListPartnerAccounts service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListPartnerAccounts">REST API Reference for ListPartnerAccounts Operation</seealso> public virtual Task<ListPartnerAccountsResponse> ListPartnerAccountsAsync(ListPartnerAccountsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPartnerAccountsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPartnerAccountsResponseUnmarshaller.Instance; return InvokeAsync<ListPartnerAccountsResponse>(request, options, cancellationToken); } #endregion #region ListQueuedMessages internal virtual ListQueuedMessagesResponse ListQueuedMessages(ListQueuedMessagesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListQueuedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListQueuedMessagesResponseUnmarshaller.Instance; return Invoke<ListQueuedMessagesResponse>(request, options); } /// <summary> /// The operation to list queued messages. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListQueuedMessages service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListQueuedMessages service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListQueuedMessages">REST API Reference for ListQueuedMessages Operation</seealso> public virtual Task<ListQueuedMessagesResponse> ListQueuedMessagesAsync(ListQueuedMessagesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListQueuedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListQueuedMessagesResponseUnmarshaller.Instance; return InvokeAsync<ListQueuedMessagesResponse>(request, options, cancellationToken); } #endregion #region ListServiceProfiles internal virtual ListServiceProfilesResponse ListServiceProfiles(ListServiceProfilesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListServiceProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListServiceProfilesResponseUnmarshaller.Instance; return Invoke<ListServiceProfilesResponse>(request, options); } /// <summary> /// Lists the service profiles registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListServiceProfiles service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListServiceProfiles service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListServiceProfiles">REST API Reference for ListServiceProfiles Operation</seealso> public virtual Task<ListServiceProfilesResponse> ListServiceProfilesAsync(ListServiceProfilesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListServiceProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListServiceProfilesResponseUnmarshaller.Instance; return InvokeAsync<ListServiceProfilesResponse>(request, options, cancellationToken); } #endregion #region ListTagsForResource internal virtual ListTagsForResourceResponse ListTagsForResource(ListTagsForResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return Invoke<ListTagsForResourceResponse>(request, options); } /// <summary> /// Lists the tags (metadata) you have assigned to the resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTagsForResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListTagsForResource service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso> public virtual Task<ListTagsForResourceResponse> ListTagsForResourceAsync(ListTagsForResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return InvokeAsync<ListTagsForResourceResponse>(request, options, cancellationToken); } #endregion #region ListWirelessDevices internal virtual ListWirelessDevicesResponse ListWirelessDevices(ListWirelessDevicesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessDevicesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessDevicesResponseUnmarshaller.Instance; return Invoke<ListWirelessDevicesResponse>(request, options); } /// <summary> /// Lists the wireless devices registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListWirelessDevices service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListWirelessDevices service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListWirelessDevices">REST API Reference for ListWirelessDevices Operation</seealso> public virtual Task<ListWirelessDevicesResponse> ListWirelessDevicesAsync(ListWirelessDevicesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessDevicesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessDevicesResponseUnmarshaller.Instance; return InvokeAsync<ListWirelessDevicesResponse>(request, options, cancellationToken); } #endregion #region ListWirelessGateways internal virtual ListWirelessGatewaysResponse ListWirelessGateways(ListWirelessGatewaysRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessGatewaysRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessGatewaysResponseUnmarshaller.Instance; return Invoke<ListWirelessGatewaysResponse>(request, options); } /// <summary> /// Lists the wireless gateways registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListWirelessGateways service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListWirelessGateways service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListWirelessGateways">REST API Reference for ListWirelessGateways Operation</seealso> public virtual Task<ListWirelessGatewaysResponse> ListWirelessGatewaysAsync(ListWirelessGatewaysRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessGatewaysRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessGatewaysResponseUnmarshaller.Instance; return InvokeAsync<ListWirelessGatewaysResponse>(request, options, cancellationToken); } #endregion #region ListWirelessGatewayTaskDefinitions internal virtual ListWirelessGatewayTaskDefinitionsResponse ListWirelessGatewayTaskDefinitions(ListWirelessGatewayTaskDefinitionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessGatewayTaskDefinitionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessGatewayTaskDefinitionsResponseUnmarshaller.Instance; return Invoke<ListWirelessGatewayTaskDefinitionsResponse>(request, options); } /// <summary> /// List the wireless gateway tasks definitions registered to your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListWirelessGatewayTaskDefinitions service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListWirelessGatewayTaskDefinitions service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ListWirelessGatewayTaskDefinitions">REST API Reference for ListWirelessGatewayTaskDefinitions Operation</seealso> public virtual Task<ListWirelessGatewayTaskDefinitionsResponse> ListWirelessGatewayTaskDefinitionsAsync(ListWirelessGatewayTaskDefinitionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListWirelessGatewayTaskDefinitionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListWirelessGatewayTaskDefinitionsResponseUnmarshaller.Instance; return InvokeAsync<ListWirelessGatewayTaskDefinitionsResponse>(request, options, cancellationToken); } #endregion #region PutResourceLogLevel internal virtual PutResourceLogLevelResponse PutResourceLogLevel(PutResourceLogLevelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = PutResourceLogLevelResponseUnmarshaller.Instance; return Invoke<PutResourceLogLevelResponse>(request, options); } /// <summary> /// Sets the log-level override for a resource-ID and resource-type. This option can be /// specified for a wireless gateway or a wireless device. A limit of 200 log level override /// can be set per account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutResourceLogLevel service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutResourceLogLevel service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/PutResourceLogLevel">REST API Reference for PutResourceLogLevel Operation</seealso> public virtual Task<PutResourceLogLevelResponse> PutResourceLogLevelAsync(PutResourceLogLevelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = PutResourceLogLevelResponseUnmarshaller.Instance; return InvokeAsync<PutResourceLogLevelResponse>(request, options, cancellationToken); } #endregion #region ResetAllResourceLogLevels internal virtual ResetAllResourceLogLevelsResponse ResetAllResourceLogLevels(ResetAllResourceLogLevelsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ResetAllResourceLogLevelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ResetAllResourceLogLevelsResponseUnmarshaller.Instance; return Invoke<ResetAllResourceLogLevelsResponse>(request, options); } /// <summary> /// Removes the log-level overrides for all resources; both wireless devices and wireless /// gateways. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ResetAllResourceLogLevels service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ResetAllResourceLogLevels service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ResetAllResourceLogLevels">REST API Reference for ResetAllResourceLogLevels Operation</seealso> public virtual Task<ResetAllResourceLogLevelsResponse> ResetAllResourceLogLevelsAsync(ResetAllResourceLogLevelsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ResetAllResourceLogLevelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ResetAllResourceLogLevelsResponseUnmarshaller.Instance; return InvokeAsync<ResetAllResourceLogLevelsResponse>(request, options, cancellationToken); } #endregion #region ResetResourceLogLevel internal virtual ResetResourceLogLevelResponse ResetResourceLogLevel(ResetResourceLogLevelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ResetResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = ResetResourceLogLevelResponseUnmarshaller.Instance; return Invoke<ResetResourceLogLevelResponse>(request, options); } /// <summary> /// Removes the log-level override, if any, for a specific resource-ID and resource-type. /// It can be used for a wireless device or a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ResetResourceLogLevel service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ResetResourceLogLevel service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/ResetResourceLogLevel">REST API Reference for ResetResourceLogLevel Operation</seealso> public virtual Task<ResetResourceLogLevelResponse> ResetResourceLogLevelAsync(ResetResourceLogLevelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ResetResourceLogLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = ResetResourceLogLevelResponseUnmarshaller.Instance; return InvokeAsync<ResetResourceLogLevelResponse>(request, options, cancellationToken); } #endregion #region SendDataToMulticastGroup internal virtual SendDataToMulticastGroupResponse SendDataToMulticastGroup(SendDataToMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SendDataToMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = SendDataToMulticastGroupResponseUnmarshaller.Instance; return Invoke<SendDataToMulticastGroupResponse>(request, options); } /// <summary> /// Sends the specified data to a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SendDataToMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the SendDataToMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/SendDataToMulticastGroup">REST API Reference for SendDataToMulticastGroup Operation</seealso> public virtual Task<SendDataToMulticastGroupResponse> SendDataToMulticastGroupAsync(SendDataToMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SendDataToMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = SendDataToMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<SendDataToMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region SendDataToWirelessDevice internal virtual SendDataToWirelessDeviceResponse SendDataToWirelessDevice(SendDataToWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SendDataToWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = SendDataToWirelessDeviceResponseUnmarshaller.Instance; return Invoke<SendDataToWirelessDeviceResponse>(request, options); } /// <summary> /// Sends a decrypted application data frame to a device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SendDataToWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the SendDataToWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/SendDataToWirelessDevice">REST API Reference for SendDataToWirelessDevice Operation</seealso> public virtual Task<SendDataToWirelessDeviceResponse> SendDataToWirelessDeviceAsync(SendDataToWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SendDataToWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = SendDataToWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<SendDataToWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region StartBulkAssociateWirelessDeviceWithMulticastGroup internal virtual StartBulkAssociateWirelessDeviceWithMulticastGroupResponse StartBulkAssociateWirelessDeviceWithMulticastGroup(StartBulkAssociateWirelessDeviceWithMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartBulkAssociateWirelessDeviceWithMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = StartBulkAssociateWirelessDeviceWithMulticastGroupResponseUnmarshaller.Instance; return Invoke<StartBulkAssociateWirelessDeviceWithMulticastGroupResponse>(request, options); } /// <summary> /// Starts a bulk association of all qualifying wireless devices with a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartBulkAssociateWirelessDeviceWithMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the StartBulkAssociateWirelessDeviceWithMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/StartBulkAssociateWirelessDeviceWithMulticastGroup">REST API Reference for StartBulkAssociateWirelessDeviceWithMulticastGroup Operation</seealso> public virtual Task<StartBulkAssociateWirelessDeviceWithMulticastGroupResponse> StartBulkAssociateWirelessDeviceWithMulticastGroupAsync(StartBulkAssociateWirelessDeviceWithMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartBulkAssociateWirelessDeviceWithMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = StartBulkAssociateWirelessDeviceWithMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<StartBulkAssociateWirelessDeviceWithMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region StartBulkDisassociateWirelessDeviceFromMulticastGroup internal virtual StartBulkDisassociateWirelessDeviceFromMulticastGroupResponse StartBulkDisassociateWirelessDeviceFromMulticastGroup(StartBulkDisassociateWirelessDeviceFromMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartBulkDisassociateWirelessDeviceFromMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = StartBulkDisassociateWirelessDeviceFromMulticastGroupResponseUnmarshaller.Instance; return Invoke<StartBulkDisassociateWirelessDeviceFromMulticastGroupResponse>(request, options); } /// <summary> /// Starts a bulk disassociatin of all qualifying wireless devices from a multicast group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartBulkDisassociateWirelessDeviceFromMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the StartBulkDisassociateWirelessDeviceFromMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/StartBulkDisassociateWirelessDeviceFromMulticastGroup">REST API Reference for StartBulkDisassociateWirelessDeviceFromMulticastGroup Operation</seealso> public virtual Task<StartBulkDisassociateWirelessDeviceFromMulticastGroupResponse> StartBulkDisassociateWirelessDeviceFromMulticastGroupAsync(StartBulkDisassociateWirelessDeviceFromMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartBulkDisassociateWirelessDeviceFromMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = StartBulkDisassociateWirelessDeviceFromMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<StartBulkDisassociateWirelessDeviceFromMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region StartFuotaTask internal virtual StartFuotaTaskResponse StartFuotaTask(StartFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartFuotaTaskResponseUnmarshaller.Instance; return Invoke<StartFuotaTaskResponse>(request, options); } /// <summary> /// Starts a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the StartFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/StartFuotaTask">REST API Reference for StartFuotaTask Operation</seealso> public virtual Task<StartFuotaTaskResponse> StartFuotaTaskAsync(StartFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<StartFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region StartMulticastGroupSession internal virtual StartMulticastGroupSessionResponse StartMulticastGroupSession(StartMulticastGroupSessionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = StartMulticastGroupSessionResponseUnmarshaller.Instance; return Invoke<StartMulticastGroupSessionResponse>(request, options); } /// <summary> /// Starts a multicast group session. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartMulticastGroupSession service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the StartMulticastGroupSession service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/StartMulticastGroupSession">REST API Reference for StartMulticastGroupSession Operation</seealso> public virtual Task<StartMulticastGroupSessionResponse> StartMulticastGroupSessionAsync(StartMulticastGroupSessionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartMulticastGroupSessionRequestMarshaller.Instance; options.ResponseUnmarshaller = StartMulticastGroupSessionResponseUnmarshaller.Instance; return InvokeAsync<StartMulticastGroupSessionResponse>(request, options, cancellationToken); } #endregion #region TagResource internal virtual TagResourceResponse TagResource(TagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return Invoke<TagResourceResponse>(request, options); } /// <summary> /// Adds a tag to a resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TagResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the TagResource service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.TooManyTagsException"> /// The request was denied because the resource can't have any more tags. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/TagResource">REST API Reference for TagResource Operation</seealso> public virtual Task<TagResourceResponse> TagResourceAsync(TagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return InvokeAsync<TagResourceResponse>(request, options, cancellationToken); } #endregion #region TestWirelessDevice internal virtual TestWirelessDeviceResponse TestWirelessDevice(TestWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = TestWirelessDeviceResponseUnmarshaller.Instance; return Invoke<TestWirelessDeviceResponse>(request, options); } /// <summary> /// Simulates a provisioned device by sending an uplink data payload of <code>Hello</code>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the TestWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/TestWirelessDevice">REST API Reference for TestWirelessDevice Operation</seealso> public virtual Task<TestWirelessDeviceResponse> TestWirelessDeviceAsync(TestWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = TestWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<TestWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region UntagResource internal virtual UntagResourceResponse UntagResource(UntagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return Invoke<UntagResourceResponse>(request, options); } /// <summary> /// Removes one or more tags from a resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UntagResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UntagResource service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UntagResource">REST API Reference for UntagResource Operation</seealso> public virtual Task<UntagResourceResponse> UntagResourceAsync(UntagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return InvokeAsync<UntagResourceResponse>(request, options, cancellationToken); } #endregion #region UpdateDestination internal virtual UpdateDestinationResponse UpdateDestination(UpdateDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDestinationResponseUnmarshaller.Instance; return Invoke<UpdateDestinationResponse>(request, options); } /// <summary> /// Updates properties of a destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDestination service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateDestination service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateDestination">REST API Reference for UpdateDestination Operation</seealso> public virtual Task<UpdateDestinationResponse> UpdateDestinationAsync(UpdateDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDestinationResponseUnmarshaller.Instance; return InvokeAsync<UpdateDestinationResponse>(request, options, cancellationToken); } #endregion #region UpdateFuotaTask internal virtual UpdateFuotaTaskResponse UpdateFuotaTask(UpdateFuotaTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateFuotaTaskResponseUnmarshaller.Instance; return Invoke<UpdateFuotaTaskResponse>(request, options); } /// <summary> /// Updates properties of a FUOTA task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateFuotaTask service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateFuotaTask service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateFuotaTask">REST API Reference for UpdateFuotaTask Operation</seealso> public virtual Task<UpdateFuotaTaskResponse> UpdateFuotaTaskAsync(UpdateFuotaTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateFuotaTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateFuotaTaskResponseUnmarshaller.Instance; return InvokeAsync<UpdateFuotaTaskResponse>(request, options, cancellationToken); } #endregion #region UpdateLogLevelsByResourceTypes internal virtual UpdateLogLevelsByResourceTypesResponse UpdateLogLevelsByResourceTypes(UpdateLogLevelsByResourceTypesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateLogLevelsByResourceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateLogLevelsByResourceTypesResponseUnmarshaller.Instance; return Invoke<UpdateLogLevelsByResourceTypesResponse>(request, options); } /// <summary> /// Set default log level, or log levels by resource types. This can be for wireless device /// log options or wireless gateways log options and is used to control the log messages /// that'll be displayed in CloudWatch. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateLogLevelsByResourceTypes service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateLogLevelsByResourceTypes service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateLogLevelsByResourceTypes">REST API Reference for UpdateLogLevelsByResourceTypes Operation</seealso> public virtual Task<UpdateLogLevelsByResourceTypesResponse> UpdateLogLevelsByResourceTypesAsync(UpdateLogLevelsByResourceTypesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateLogLevelsByResourceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateLogLevelsByResourceTypesResponseUnmarshaller.Instance; return InvokeAsync<UpdateLogLevelsByResourceTypesResponse>(request, options, cancellationToken); } #endregion #region UpdateMulticastGroup internal virtual UpdateMulticastGroupResponse UpdateMulticastGroup(UpdateMulticastGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMulticastGroupResponseUnmarshaller.Instance; return Invoke<UpdateMulticastGroupResponse>(request, options); } /// <summary> /// Updates properties of a multicast group session. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateMulticastGroup service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateMulticastGroup service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateMulticastGroup">REST API Reference for UpdateMulticastGroup Operation</seealso> public virtual Task<UpdateMulticastGroupResponse> UpdateMulticastGroupAsync(UpdateMulticastGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMulticastGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMulticastGroupResponseUnmarshaller.Instance; return InvokeAsync<UpdateMulticastGroupResponse>(request, options, cancellationToken); } #endregion #region UpdateNetworkAnalyzerConfiguration internal virtual UpdateNetworkAnalyzerConfigurationResponse UpdateNetworkAnalyzerConfiguration(UpdateNetworkAnalyzerConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateNetworkAnalyzerConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateNetworkAnalyzerConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateNetworkAnalyzerConfigurationResponse>(request, options); } /// <summary> /// Update NetworkAnalyzer configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateNetworkAnalyzerConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateNetworkAnalyzerConfiguration service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateNetworkAnalyzerConfiguration">REST API Reference for UpdateNetworkAnalyzerConfiguration Operation</seealso> public virtual Task<UpdateNetworkAnalyzerConfigurationResponse> UpdateNetworkAnalyzerConfigurationAsync(UpdateNetworkAnalyzerConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateNetworkAnalyzerConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateNetworkAnalyzerConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateNetworkAnalyzerConfigurationResponse>(request, options, cancellationToken); } #endregion #region UpdatePartnerAccount internal virtual UpdatePartnerAccountResponse UpdatePartnerAccount(UpdatePartnerAccountRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePartnerAccountResponseUnmarshaller.Instance; return Invoke<UpdatePartnerAccountResponse>(request, options); } /// <summary> /// Updates properties of a partner account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePartnerAccount service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdatePartnerAccount service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdatePartnerAccount">REST API Reference for UpdatePartnerAccount Operation</seealso> public virtual Task<UpdatePartnerAccountResponse> UpdatePartnerAccountAsync(UpdatePartnerAccountRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePartnerAccountRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePartnerAccountResponseUnmarshaller.Instance; return InvokeAsync<UpdatePartnerAccountResponse>(request, options, cancellationToken); } #endregion #region UpdateResourceEventConfiguration internal virtual UpdateResourceEventConfigurationResponse UpdateResourceEventConfiguration(UpdateResourceEventConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateResourceEventConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateResourceEventConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateResourceEventConfigurationResponse>(request, options); } /// <summary> /// Update the event configuration for a particular resource identifier. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateResourceEventConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateResourceEventConfiguration service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ConflictException"> /// Adding, updating, or deleting the resource can cause an inconsistent state. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateResourceEventConfiguration">REST API Reference for UpdateResourceEventConfiguration Operation</seealso> public virtual Task<UpdateResourceEventConfigurationResponse> UpdateResourceEventConfigurationAsync(UpdateResourceEventConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateResourceEventConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateResourceEventConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateResourceEventConfigurationResponse>(request, options, cancellationToken); } #endregion #region UpdateWirelessDevice internal virtual UpdateWirelessDeviceResponse UpdateWirelessDevice(UpdateWirelessDeviceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateWirelessDeviceResponseUnmarshaller.Instance; return Invoke<UpdateWirelessDeviceResponse>(request, options); } /// <summary> /// Updates properties of a wireless device. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateWirelessDevice service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateWirelessDevice service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateWirelessDevice">REST API Reference for UpdateWirelessDevice Operation</seealso> public virtual Task<UpdateWirelessDeviceResponse> UpdateWirelessDeviceAsync(UpdateWirelessDeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateWirelessDeviceRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateWirelessDeviceResponseUnmarshaller.Instance; return InvokeAsync<UpdateWirelessDeviceResponse>(request, options, cancellationToken); } #endregion #region UpdateWirelessGateway internal virtual UpdateWirelessGatewayResponse UpdateWirelessGateway(UpdateWirelessGatewayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateWirelessGatewayResponseUnmarshaller.Instance; return Invoke<UpdateWirelessGatewayResponse>(request, options); } /// <summary> /// Updates properties of a wireless gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateWirelessGateway service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateWirelessGateway service method, as returned by IoTWireless.</returns> /// <exception cref="Amazon.IoTWireless.Model.AccessDeniedException"> /// User does not have permission to perform this action. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.InternalServerException"> /// An unexpected error occurred while processing a request. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ResourceNotFoundException"> /// Resource does not exist. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ThrottlingException"> /// The request was denied because it exceeded the allowed API request rate. /// </exception> /// <exception cref="Amazon.IoTWireless.Model.ValidationException"> /// The input did not meet the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotwireless-2020-11-22/UpdateWirelessGateway">REST API Reference for UpdateWirelessGateway Operation</seealso> public virtual Task<UpdateWirelessGatewayResponse> UpdateWirelessGatewayAsync(UpdateWirelessGatewayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateWirelessGatewayRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateWirelessGatewayResponseUnmarshaller.Instance; return InvokeAsync<UpdateWirelessGatewayResponse>(request, options, cancellationToken); } #endregion } }
54.699652
302
0.696218
[ "Apache-2.0" ]
andyhopp/aws-sdk-net
sdk/src/Services/IoTWireless/Generated/_netstandard/AmazonIoTWirelessClient.cs
251,509
C#
using System; using UnityEngine; using UnityEngine.UI; namespace Xsolla.Demo { public class BattlePassLevelUpPopup : BaseBattlePassBuyPopup { [SerializeField] private BattlePassLevelUpPopupItemsShowcase ItemsShowcase = default; [SerializeField] private UserPlusMinusCounter Counter = default; [SerializeField] private Text Message = default; private const int COUNTER_LOWER_LIMIT = 1; private const string MESSAGE_TEMPLATE = "Upgrading to level {0} will unlock the following rewards:"; private int _userCurrentLevel; public event Action<int> UserInput; public void Initialize(int userCurrentLevel, int levelUpLimit) { _userCurrentLevel = userCurrentLevel; Counter.Initialize( initialValue: COUNTER_LOWER_LIMIT, lowerLimit: COUNTER_LOWER_LIMIT, upperLimit: levelUpLimit); Counter.CounterChanged += OnCounterChange; OnCounterChange(COUNTER_LOWER_LIMIT); } public override void ShowPrice(string currencyImageUrl, string currencyName, int price, int userCurrency) { base.ShowPrice(currencyImageUrl, currencyName, price, userCurrency); Counter.ShowCounter(false); } public override void ShowPrice(string formattedPrice) { base.ShowPrice(formattedPrice); Counter.ShowCounter(true); } public void ShowItems(BattlePassItemDescription[] items) { ItemsShowcase.ShowItems(items); } private void OnCounterChange(int newCounterValue) { Message.text = string.Format(MESSAGE_TEMPLATE, _userCurrentLevel + newCounterValue); UserInput?.Invoke(newCounterValue); } } }
27.714286
107
0.775773
[ "Apache-2.0" ]
xsolla/store-unity-sdk
Assets/Xsolla/Store/Scripts/BattlePass/UI/BattlePassPopups/LevelUpPopup/BattlePassLevelUpPopup.cs
1,552
C#
using System.Diagnostics; namespace Calitha.GoldParser { /// <summary> /// Abstract class representing both terminal and nonterminal tokens. /// </summary> public abstract class Token { protected Token() { UserObject = null; } public abstract Symbol Symbol { get; } /// <summary> /// This can be user for storing an object during the reduce /// event. This makes it possible to create a tree when the /// source is being parsed. /// </summary> public object UserObject { get; set; } } /// <summary> /// Terminal token objects are retrieved from the tokenizer. /// </summary> public class TerminalToken : Token { /// <summary> /// Creates a new terminal token object. /// </summary> /// <param name="symbol">The symbol that this token represents.</param> /// <param name="text">The text from the input that is the token.</param> /// <param name="location">The location in the input that this token /// has been found.</param> public TerminalToken(Symbol symbol, string text, Location location) { this.symbol = symbol; Text = text; Location = location; } /// <summary> /// String representation of the token. /// </summary> /// <returns></returns> public override string ToString() { return Text; } /// <summary> /// The symbol that this token represents. /// </summary> public override Symbol Symbol { [DebuggerStepThrough] get { return symbol; } } private Symbol symbol; /// <summary> /// The text from the input that is this token. /// </summary> public string Text { get; private set; } /// <summary> /// The location in the input that this token was found. /// </summary> public Location Location { get; private set; } } /// <summary> /// The nonterminal token is created when tokens are reduced by a rule. /// </summary> public class NonterminalToken : Token { /// <summary> /// Creates a new nonterminal token. /// </summary> /// <param name="rule">The reduction rule.</param> /// <param name="tokens">The tokens that are reduced.</param> public NonterminalToken(Rule rule, Token[] tokens) { Rule = rule; Tokens = tokens; } public void ClearTokens() { Tokens = new Token[0]; } /// <summary> /// String representation of the nonterminal token. /// </summary> /// <returns>The string.</returns> public override string ToString() { var str = Rule.Lhs + " = ["; for (var i = 0; i < Tokens.Length; i++) { str += Tokens[i] + "]"; } return str; } /// <summary> /// The symbol that this nonterminal token represents. /// </summary> public override Symbol Symbol { [DebuggerStepThrough] get { return Rule.Lhs; } } /// <summary> /// The tokens that are reduced. /// </summary> public Token[] Tokens { get; private set; } /// <summary> /// The rule that caused the reduction. /// </summary> public Rule Rule { get; private set; } } }
23.444444
80
0.634394
[ "MIT" ]
jbosh/calculator
Calculator 3/Calitha/GoldParser/Token.cs
2,954
C#
// Copyright (c) rubicon IT GmbH, www.rubicon.eu // // See the NOTICE file distributed with this work for additional information // regarding copyright ownership. rubicon licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may not use this // file except in compliance with the License. You may obtain a copy of the // License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. // using System; #if NET_3_5 using System.Diagnostics; #endif using System.Linq; using System.Linq.Expressions; using Remotion.Linq.Clauses.Expressions; using Remotion.Linq.Clauses.StreamedData; using Remotion.Linq.Utilities; using Remotion.Utilities; namespace Remotion.Linq.Clauses { /// <summary> /// Represents the select part of a query, projecting data items according to some <see cref="Selector"/>. /// </summary> /// <example> /// In C#, the "select" clause in the following sample corresponds to a <see cref="SelectClause"/>. "s" (a reference to the query source "s", see /// <see cref="QuerySourceReferenceExpression"/>) is the <see cref="Selector"/> expression: /// <code> /// var query = from s in Students /// where s.First == "Hugo" /// select s; /// </code> /// </example> public sealed class SelectClause : IClause { private Expression _selector; /// <summary> /// Initializes a new instance of the <see cref="SelectClause"/> class. /// </summary> /// <param name="selector">The selector that projects the data items.</param> public SelectClause (Expression selector) { ArgumentUtility.CheckNotNull ("selector", selector); _selector = selector; } /// <summary> /// Gets the selector defining what parts of the data items are returned by the query. /// </summary> #if NET_3_5 [DebuggerDisplay ("{Remotion.Linq.Clauses.ExpressionVisitors.FormattingExpressionVisitor.Format (Selector),nq}")] #endif public Expression Selector { get { return _selector; } set { _selector = ArgumentUtility.CheckNotNull ("value", value); } } /// <summary> /// Accepts the specified visitor by calling its <see cref="IQueryModelVisitor.VisitSelectClause"/> method. /// </summary> /// <param name="visitor">The visitor to accept.</param> /// <param name="queryModel">The query model in whose context this clause is visited.</param> public void Accept (IQueryModelVisitor visitor, QueryModel queryModel) { ArgumentUtility.CheckNotNull ("visitor", visitor); ArgumentUtility.CheckNotNull ("queryModel", queryModel); visitor.VisitSelectClause (this, queryModel); } /// <summary> /// Clones this clause. /// </summary> /// <param name="cloneContext">The clones of all query source clauses are registered with this <see cref="CloneContext"/>.</param> /// <returns>A clone of this clause.</returns> public SelectClause Clone (CloneContext cloneContext) { ArgumentUtility.CheckNotNull ("cloneContext", cloneContext); var result = new SelectClause (Selector); return result; } /// <summary> /// Transforms all the expressions in this clause and its child objects via the given <paramref name="transformation"/> delegate. /// </summary> /// <param name="transformation">The transformation object. This delegate is called for each <see cref="Expression"/> within this /// clause, and those expressions will be replaced with what the delegate returns.</param> public void TransformExpressions (Func<Expression, Expression> transformation) { ArgumentUtility.CheckNotNull ("transformation", transformation); Selector = transformation (Selector); } public override string ToString () { return "select " + Selector.BuildString(); } /// <summary> /// Gets an <see cref="StreamedSequenceInfo"/> object describing the data streaming out of this <see cref="SelectClause"/>. If a query ends with /// the <see cref="SelectClause"/>, this corresponds to the query's output data. If a query has <see cref="QueryModel.ResultOperators"/>, the data /// is further modified by those operators. Use <see cref="QueryModel.GetOutputDataInfo"/> to obtain the real result type of /// a query model, including the <see cref="QueryModel.ResultOperators"/>. /// </summary> /// <returns>Gets a <see cref="StreamedSequenceInfo"/> object describing the data streaming out of this <see cref="SelectClause"/>.</returns> /// <remarks> /// The data streamed from a <see cref="SelectClause"/> is always of type <see cref="IQueryable{T}"/> instantiated /// with the type of <see cref="Selector"/> as its generic parameter. Its <see cref="StreamedSequenceInfo.ItemExpression"/> corresponds to the /// <see cref="Selector"/>. /// </remarks> public StreamedSequenceInfo GetOutputDataInfo () { return new StreamedSequenceInfo (typeof (IQueryable<>).MakeGenericType (Selector.Type), Selector); } } }
41.635659
150
0.69205
[ "ECL-2.0", "Apache-2.0" ]
biohazard999/Relinq
Core/Clauses/SelectClause.cs
5,371
C#
/* * Farseer Physics Engine based on Box2D.XNA port: * Copyright (c) 2010 Ian Qvist * * Box2D.XNA port of Box2D: * Copyright (c) 2009 Brandon Furtwangler, Nathan Furtwangler * * Original source Box2D: * Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ using System; using System.Diagnostics; using System.Runtime.InteropServices; using Microsoft.Xna.Framework; namespace FarseerPhysics.Common { public static class MathUtils { public static float Cross(Vector2 a, Vector2 b) { return a.X * b.Y - a.Y * b.X; } public static Vector2 Cross(Vector2 a, float s) { return new Vector2(s * a.Y, -s * a.X); } public static Vector2 Cross(float s, Vector2 a) { return new Vector2(-s * a.Y, s * a.X); } public static Vector2 Abs(Vector2 v) { return new Vector2(Math.Abs(v.X), Math.Abs(v.Y)); } public static Vector2 Multiply(ref Mat22 A, Vector2 v) { return Multiply(ref A, ref v); } public static Vector2 Multiply(ref Mat22 A, ref Vector2 v) { return new Vector2(A.Col1.X * v.X + A.Col2.X * v.Y, A.Col1.Y * v.X + A.Col2.Y * v.Y); } public static Vector2 MultiplyT(ref Mat22 A, Vector2 v) { return MultiplyT(ref A, ref v); } public static Vector2 MultiplyT(ref Mat22 A, ref Vector2 v) { return new Vector2(v.X * A.Col1.X + v.Y * A.Col1.Y, v.X * A.Col2.X + v.Y * A.Col2.Y); } public static Vector2 Multiply(ref Transform T, Vector2 v) { return Multiply(ref T, ref v); } public static Vector2 Multiply(ref Transform T, ref Vector2 v) { return new Vector2(T.Position.X + T.R.Col1.X * v.X + T.R.Col2.X * v.Y, T.Position.Y + T.R.Col1.Y * v.X + T.R.Col2.Y * v.Y); } public static Vector2 MultiplyT(ref Transform T, Vector2 v) { return MultiplyT(ref T, ref v); } public static Vector2 MultiplyT(ref Transform T, ref Vector2 v) { Vector2 tmp = Vector2.Zero; tmp.X = v.X - T.Position.X; tmp.Y = v.Y - T.Position.Y; return MultiplyT(ref T.R, ref tmp); } // A^T * B public static void MultiplyT(ref Mat22 A, ref Mat22 B, out Mat22 C) { C = new Mat22(); C.Col1.X = A.Col1.X * B.Col1.X + A.Col1.Y * B.Col1.Y; C.Col1.Y = A.Col2.X * B.Col1.X + A.Col2.Y * B.Col1.Y; C.Col2.X = A.Col1.X * B.Col2.X + A.Col1.Y * B.Col2.Y; C.Col2.Y = A.Col2.X * B.Col2.X + A.Col2.Y * B.Col2.Y; } public static void MultiplyT(ref Transform A, ref Transform B, out Transform C) { C = new Transform(); MultiplyT(ref A.R, ref B.R, out C.R); C.Position.X = B.Position.X - A.Position.X; C.Position.Y = B.Position.Y - A.Position.Y; } public static void Swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; } /// <summary> /// This function is used to ensure that a floating point number is /// not a NaN or infinity. /// </summary> /// <param name="x">The x.</param> /// <returns> /// <c>true</c> if the specified x is valid; otherwise, <c>false</c>. /// </returns> public static bool IsValid(float x) { if (float.IsNaN(x)) { // NaN. return false; } return !float.IsInfinity(x); } public static bool IsValid(this Vector2 x) { return IsValid(x.X) && IsValid(x.Y); } /// <summary> /// This is a approximate yet fast inverse square-root. /// </summary> /// <param name="x">The x.</param> /// <returns></returns> public static float InvSqrt(float x) { FloatConverter convert = new FloatConverter(); convert.x = x; float xhalf = 0.5f * x; convert.i = 0x5f3759df - (convert.i >> 1); x = convert.x; x = x * (1.5f - xhalf * x * x); return x; } public static int Clamp(int a, int low, int high) { return Math.Max(low, Math.Min(a, high)); } public static float Clamp(float a, float low, float high) { return Math.Max(low, Math.Min(a, high)); } public static Vector2 Clamp(Vector2 a, Vector2 low, Vector2 high) { return Vector2.Max(low, Vector2.Min(a, high)); } public static void Cross(ref Vector2 a, ref Vector2 b, out float c) { c = a.X * b.Y - a.Y * b.X; } /// <summary> /// Return the angle between two vectors on a plane /// The angle is from vector 1 to vector 2, positive anticlockwise /// The result is between -pi -> pi /// </summary> public static double VectorAngle(ref Vector2 p1, ref Vector2 p2) { double theta1 = Math.Atan2(p1.Y, p1.X); double theta2 = Math.Atan2(p2.Y, p2.X); double dtheta = theta2 - theta1; while (dtheta > Math.PI) dtheta -= (2 * Math.PI); while (dtheta < -Math.PI) dtheta += (2 * Math.PI); return (dtheta); } /// <summary> /// Returns a positive number if c is to the left of the line going from a to b. /// </summary> /// <returns>Positive number if point is left, negative if point is right, /// and 0 if points are collinear.</returns> public static float Area(Vector2 a, Vector2 b, Vector2 c) { return Area(ref a, ref b, ref c); } /// <summary> /// Returns a positive number if c is to the left of the line going from a to b. /// </summary> /// <returns>Positive number if point is left, negative if point is right, /// and 0 if points are collinear.</returns> public static float Area(ref Vector2 a, ref Vector2 b, ref Vector2 c) { return a.X * (b.Y - c.Y) + b.X * (c.Y - a.Y) + c.X * (a.Y - b.Y); } /// <summary> /// Determines if three vertices are collinear (ie. on a straight line) /// </summary> /// <param name="a">First vertex</param> /// <param name="b">Second vertex</param> /// <param name="c">Third vertex</param> /// <returns></returns> public static bool Collinear(ref Vector2 a, ref Vector2 b, ref Vector2 c) { return Collinear(ref a, ref b, ref c, 0); } public static bool Collinear(ref Vector2 a, ref Vector2 b, ref Vector2 c, float tolerance) { return FloatInRange(Area(ref a, ref b, ref c), -tolerance, tolerance); } public static void Cross(float s, ref Vector2 a, out Vector2 b) { b = new Vector2(-s * a.Y, s * a.X); } public static bool FloatEquals(float value1, float value2) { return Math.Abs(value1 - value2) <= Settings.Epsilon; } /// <summary> /// Checks if a floating point Value is equal to another, /// within a certain tolerance. /// </summary> /// <param name="value1">The first floating point Value.</param> /// <param name="value2">The second floating point Value.</param> /// <param name="delta">The floating point tolerance.</param> /// <returns>True if the values are "equal", false otherwise.</returns> public static bool FloatEquals(float value1, float value2, float delta) { return FloatInRange(value1, value2 - delta, value2 + delta); } /// <summary> /// Checks if a floating point Value is within a specified /// range of values (inclusive). /// </summary> /// <param name="value">The Value to check.</param> /// <param name="min">The minimum Value.</param> /// <param name="max">The maximum Value.</param> /// <returns>True if the Value is within the range specified, /// false otherwise.</returns> public static bool FloatInRange(float value, float min, float max) { return (value >= min && value <= max); } #region Nested type: FloatConverter [StructLayout(LayoutKind.Explicit)] private struct FloatConverter { [FieldOffset(0)] public float x; [FieldOffset(0)] public int i; } #endregion } /// <summary> /// A 2-by-2 matrix. Stored in column-major order. /// </summary> public struct Mat22 { public Vector2 Col1, Col2; /// <summary> /// Construct this matrix using columns. /// </summary> /// <param name="c1">The c1.</param> /// <param name="c2">The c2.</param> public Mat22(Vector2 c1, Vector2 c2) { Col1 = c1; Col2 = c2; } /// <summary> /// Construct this matrix using scalars. /// </summary> /// <param name="a11">The a11.</param> /// <param name="a12">The a12.</param> /// <param name="a21">The a21.</param> /// <param name="a22">The a22.</param> public Mat22(float a11, float a12, float a21, float a22) { Col1 = new Vector2(a11, a21); Col2 = new Vector2(a12, a22); } /// <summary> /// Construct this matrix using an angle. This matrix becomes /// an orthonormal rotation matrix. /// </summary> /// <param name="angle">The angle.</param> public Mat22(float angle) { // TODO_ERIN compute sin+cos together. float c = (float)Math.Cos(angle), s = (float)Math.Sin(angle); Col1 = new Vector2(c, s); Col2 = new Vector2(-s, c); } /// <summary> /// Extract the angle from this matrix (assumed to be /// a rotation matrix). /// </summary> /// <value></value> public float Angle { get { return (float)Math.Atan2(Col1.Y, Col1.X); } } public Mat22 Inverse { get { float a = Col1.X, b = Col2.X, c = Col1.Y, d = Col2.Y; float det = a * d - b * c; if (det != 0.0f) { det = 1.0f / det; } return new Mat22(new Vector2(det * d, -det * c), new Vector2(-det * b, det * a)); } } /// <summary> /// Initialize this matrix using columns. /// </summary> /// <param name="c1">The c1.</param> /// <param name="c2">The c2.</param> public void Set(Vector2 c1, Vector2 c2) { Col1 = c1; Col2 = c2; } /// <summary> /// Initialize this matrix using an angle. This matrix becomes /// an orthonormal rotation matrix. /// </summary> /// <param name="angle">The angle.</param> public void Set(float angle) { float c = (float)Math.Cos(angle), s = (float)Math.Sin(angle); Col1.X = c; Col2.X = -s; Col1.Y = s; Col2.Y = c; } /// <summary> /// Set this to the identity matrix. /// </summary> public void SetIdentity() { Col1.X = 1.0f; Col2.X = 0.0f; Col1.Y = 0.0f; Col2.Y = 1.0f; } /// <summary> /// Set this matrix to all zeros. /// </summary> public void SetZero() { Col1.X = 0.0f; Col2.X = 0.0f; Col1.Y = 0.0f; Col2.Y = 0.0f; } /// <summary> /// Solve A * x = b, where b is a column vector. This is more efficient /// than computing the inverse in one-shot cases. /// </summary> /// <param name="b">The b.</param> /// <returns></returns> public Vector2 Solve(Vector2 b) { float a11 = Col1.X, a12 = Col2.X, a21 = Col1.Y, a22 = Col2.Y; float det = a11 * a22 - a12 * a21; if (det != 0.0f) { det = 1.0f / det; } return new Vector2(det * (a22 * b.X - a12 * b.Y), det * (a11 * b.Y - a21 * b.X)); } public static void Add(ref Mat22 A, ref Mat22 B, out Mat22 R) { R = new Mat22(A.Col1 + B.Col1, A.Col2 + B.Col2); } } /// <summary> /// A 3-by-3 matrix. Stored in column-major order. /// </summary> public struct Mat33 { public Vector3 Col1, Col2, Col3; /// <summary> /// Construct this matrix using columns. /// </summary> /// <param name="c1">The c1.</param> /// <param name="c2">The c2.</param> /// <param name="c3">The c3.</param> public Mat33(Vector3 c1, Vector3 c2, Vector3 c3) { Col1 = c1; Col2 = c2; Col3 = c3; } /// <summary> /// Set this matrix to all zeros. /// </summary> public void SetZero() { Col1 = Vector3.Zero; Col2 = Vector3.Zero; Col3 = Vector3.Zero; } /// <summary> /// Solve A * x = b, where b is a column vector. This is more efficient /// than computing the inverse in one-shot cases. /// </summary> /// <param name="b">The b.</param> /// <returns></returns> public Vector3 Solve33(Vector3 b) { float det = Vector3.Dot(Col1, Vector3.Cross(Col2, Col3)); if (det != 0.0f) { det = 1.0f / det; } return new Vector3(det * Vector3.Dot(b, Vector3.Cross(Col2, Col3)), det * Vector3.Dot(Col1, Vector3.Cross(b, Col3)), det * Vector3.Dot(Col1, Vector3.Cross(Col2, b))); } /// <summary> /// Solve A * x = b, where b is a column vector. This is more efficient /// than computing the inverse in one-shot cases. Solve only the upper /// 2-by-2 matrix equation. /// </summary> /// <param name="b">The b.</param> /// <returns></returns> public Vector2 Solve22(Vector2 b) { float a11 = Col1.X, a12 = Col2.X, a21 = Col1.Y, a22 = Col2.Y; float det = a11 * a22 - a12 * a21; if (det != 0.0f) { det = 1.0f / det; } return new Vector2(det * (a22 * b.X - a12 * b.Y), det * (a11 * b.Y - a21 * b.X)); } } /// <summary> /// A transform contains translation and rotation. It is used to represent /// the position and orientation of rigid frames. /// </summary> public struct Transform { public Vector2 Position; public Mat22 R; /// <summary> /// Initialize using a position vector and a rotation matrix. /// </summary> /// <param name="position">The position.</param> /// <param name="r">The r.</param> public Transform(ref Vector2 position, ref Mat22 r) { Position = position; R = r; } /// <summary> /// Calculate the angle that the rotation matrix represents. /// </summary> /// <value></value> public float Angle { get { return (float)Math.Atan2(R.Col1.Y, R.Col1.X); } } /// <summary> /// Set this to the identity transform. /// </summary> public void SetIdentity() { Position = Vector2.Zero; R.SetIdentity(); } /// <summary> /// Set this based on the position and angle. /// </summary> /// <param name="position">The position.</param> /// <param name="angle">The angle.</param> public void Set(Vector2 position, float angle) { Position = position; R.Set(angle); } } /// <summary> /// This describes the motion of a body/shape for TOI computation. /// Shapes are defined with respect to the body origin, which may /// no coincide with the center of mass. However, to support dynamics /// we must interpolate the center of mass position. /// </summary> public struct Sweep { /// <summary> /// Local center of mass position /// </summary> public Vector2 LocalCenter; /// <summary> /// World angles /// </summary> public float A; public float A0; /// <summary> /// Fraction of the current time step in the range [0,1] /// c0 and a0 are the positions at alpha0. /// </summary> public float Alpha0; /// <summary> /// Center world positions /// </summary> public Vector2 C; public Vector2 C0; /// <summary> /// Get the interpolated transform at a specific time. /// </summary> /// <param name="xf">The transform.</param> /// <param name="beta">beta is a factor in [0,1], where 0 indicates alpha0.</param> public void GetTransform(out Transform xf, float beta) { xf = new Transform(); xf.Position.X = (1.0f - beta) * C0.X + beta * C.X; xf.Position.Y = (1.0f - beta) * C0.Y + beta * C.Y; float angle = (1.0f - beta) * A0 + beta * A; xf.R.Set(angle); // Shift to origin xf.Position -= MathUtils.Multiply(ref xf.R, ref LocalCenter); } /// <summary> /// Advance the sweep forward, yielding a new initial state. /// </summary> /// <param name="alpha">new initial time..</param> public void Advance(float alpha) { Debug.Assert(Alpha0 < 1.0f); float beta = (alpha - Alpha0) / (1.0f - Alpha0); C0.X = (1.0f - beta) * C0.X + beta * C.X; C0.Y = (1.0f - beta) * C0.Y + beta * C.Y; A0 = (1.0f - beta) * A0 + beta * A; Alpha0 = alpha; } /// <summary> /// Normalize the angles. /// </summary> public void Normalize() { float d = MathHelper.TwoPi * (float)Math.Floor(A0 / MathHelper.TwoPi); A0 -= d; A -= d; } } }
31.874598
135
0.5057
[ "MIT" ]
somethingnew2-0/Pinball
FarseerLibrary/Common/Math.cs
19,828
C#
using System; using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// <summary> /// <para>表示 [POST] /product/store/get_shopcat 接口的请求。</para> /// </summary> public class ProductStoreGetShopCategoryRequest : WechatApiRequest { } }
22.153846
70
0.694444
[ "MIT" ]
KimMeng2015/DotNetCore.SKIT.FlurlHttpClient.Wechat
src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Store/ProductStoreGetShopCategoryRequest.cs
306
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. namespace Microsoft.Psi.Imaging { using System; using Microsoft.Psi; using Microsoft.Psi.Components; /// <summary> /// Component that decodes an image using a specified <see cref="IImageFromStreamDecoder"/>. /// </summary> public class ImageDecoder : ConsumerProducer<Shared<EncodedImage>, Shared<Image>> { private readonly IImageFromStreamDecoder decoder; /// <summary> /// Initializes a new instance of the <see cref="ImageDecoder"/> class. /// </summary> /// <param name="pipeline">Pipeline to add this component to.</param> /// <param name="decoder">The image decoder to use.</param> public ImageDecoder(Pipeline pipeline, IImageFromStreamDecoder decoder) : base(pipeline) { this.decoder = decoder; } /// <inheritdoc/> protected override void Receive(Shared<EncodedImage> sharedEncodedImage, Envelope envelope) { // The code below maintains back-compatibility with encoded images which did not store the pixel format // on the instance, but only in the stream. If the pixel format is unknown, we call upon the decoder to // retrieve the pixel format. This might be less performant, but enables decoding in the right format // even from older versions of encoded images. var pixelFormat = sharedEncodedImage.Resource.PixelFormat == PixelFormat.Undefined ? this.decoder.GetPixelFormat(sharedEncodedImage.Resource.ToStream()) : sharedEncodedImage.Resource.PixelFormat; // If the decoder does not return a valid pixel format, we throw an exception. if (pixelFormat == PixelFormat.Undefined) { throw new ArgumentException("The encoded image does not contain a supported pixel format."); } using var sharedImage = ImagePool.GetOrCreate( sharedEncodedImage.Resource.Width, sharedEncodedImage.Resource.Height, pixelFormat); sharedImage.Resource.DecodeFrom(sharedEncodedImage.Resource, this.decoder); this.Out.Post(sharedImage, envelope.OriginatingTime); } } }
47.26
127
0.649598
[ "MIT" ]
Bhaskers-Blu-Org2/psi
Sources/Imaging/Microsoft.Psi.Imaging/ImageDecoder.cs
2,365
C#
using FubuMVC.Core.Diagnostics; using FubuMVC.Core.Registration.Nodes; using FubuMVC.Core.Registration.Routes; namespace FubuMVC.Core.Registration.Conventions { public interface IUrlPolicy { bool Matches(ActionCall call, IConfigurationObserver log); IRouteDefinition Build(ActionCall call); } }
27.833333
67
0.739521
[ "Apache-2.0" ]
bbehrens/fubumvc
src/FubuMVC.Core/Registration/Conventions/IUrlPolicy.cs
334
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using CsQuery.Output; namespace CsQuery { /// <summary> /// Factory for HTML encoders included with CsQuery /// </summary> public static class HtmlEncoders { /// <summary> /// The default HTML encoder /// </summary> public static IHtmlEncoder Default { get { return Config2.HtmlEncoder; } } /// <summary> /// The standard HTML encoder; encodes most entities, and any characters that are above ascii 160. /// </summary> public static IHtmlEncoder Basic = new HtmlEncoderBasic(); /// <summary> /// The minimum HTML encoder; only encodes left-caret, right-caret, and ampersand. All other /// characters are passed through. /// </summary> public static IHtmlEncoder Minimum = new HtmlEncoderMinimum(); /// <summary> /// The same as the minimum HTML encoder, but also encodes nonbreaking space (ascii 160 becomes /// &amp;nbsp;). /// </summary> public static IHtmlEncoder MinimumNbsp = new HtmlEncoderMinimumNbsp(); /// <summary> /// No HTML encoding -- all characters are passed through. Will likely produce invalid HTML. /// </summary> public static IHtmlEncoder None = new HtmlEncoderNone(); /// <summary> /// Full HTML encoding -- all entities mapped to their named (not numeric) entities when /// available. /// </summary> public static IHtmlEncoder Full = new HtmlEncoderFull(); } }
27.306452
106
0.594211
[ "MIT" ]
prepare/DomQuery
source/a_mini/CsQuery2/Output/HtmlEncoders.cs
1,695
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests; public static class StringExtensions { /// <summary> /// Replace all \r\n with \n to get Unix line endings to make strings easy to compare while still /// keeping the formatting in mind. /// </summary> /// <returns></returns> public static string NormalizeLineEndings(this string text) { return text.Replace("\r\n", "\n"); } /// <summary> /// Replace whitespace with printable characters (and still keep \r newlines for easy readability) /// </summary> /// <returns></returns> public static string ShowWhiteSpace(this string text) { // use mongolian vowel separator as placeholder for the newline that we add for formatting var placeholder = "\u180E"; if (text.Contains(placeholder)) { throw new InvalidOperationException( "The text contains mongolian vowel separator character that we use as a placeholder."); } var whiteSpaced = text .Replace("\r\n", "\\r\\n\u180E") .Replace("\r", "\\r") .Replace("\n", "\\n\u180E") .Replace("\t", "\\t") .Replace(" ", "␣") .Replace("\u180E", "\n"); // prepend one newline to get better output from assertion where both expected // and actual output start on the same position return "\n" + whiteSpaced; } }
34.808511
103
0.618582
[ "MIT" ]
Microsoft/vstest
test/vstest.console.UnitTests/StringExtensions.cs
1,638
C#
namespace NWT_Webshop_Application.Migrations { using System; using System.Data.Entity.Migrations; public partial class UserAndProductModelsUpdate : DbMigration { public override void Up() { AddColumn("dbo.Products", "Tags", c => c.String(nullable: false, maxLength: 200)); AddColumn("dbo.Products", "ApplicationUser_Id", c => c.String(maxLength: 128)); CreateIndex("dbo.Products", "ApplicationUser_Id"); AddForeignKey("dbo.Products", "ApplicationUser_Id", "dbo.AspNetUsers", "Id"); } public override void Down() { DropForeignKey("dbo.Products", "ApplicationUser_Id", "dbo.AspNetUsers"); DropIndex("dbo.Products", new[] { "ApplicationUser_Id" }); DropColumn("dbo.Products", "ApplicationUser_Id"); DropColumn("dbo.Products", "Tags"); } } }
36.64
94
0.606987
[ "MIT" ]
mskorsur/NWT-WebshopApplication
src/NWT_Webshop_Application/Migrations/201702141451289_UserAndProductModelsUpdate.cs
916
C#
using System; using System.Collections.Generic; using System.Text; namespace Google { class Children { private string name; private string date; public Children(string name, string date) { this.Name = name; this.Date = date; } public string Date { get { return date; } set { date = value; } } public string Name { get { return name; } set { if (string.IsNullOrEmpty(value) || string.IsNullOrWhiteSpace(value)) { throw new ArgumentException($"{nameof(Children)}'s name can not be neither empty nor white space!!!"); } this.name = value; } } public override string ToString() { return $"{this.Name} {this.Date}"; } } }
20.673913
122
0.465825
[ "MIT" ]
MustafaAmish/OOP-Basic
Defining Classes Lab/Google/Children.cs
953
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.V20200501 { /// <summary> /// Inbound NAT rule of the load balancer. /// </summary> [AzureNativeResourceType("azure-native:network/v20200501:InboundNatRule")] public partial class InboundNatRule : Pulumi.CustomResource { /// <summary> /// A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. /// </summary> [Output("backendIPConfiguration")] public Output<Outputs.NetworkInterfaceIPConfigurationResponse> BackendIPConfiguration { get; private set; } = null!; /// <summary> /// The port used for the internal endpoint. Acceptable values range from 1 to 65535. /// </summary> [Output("backendPort")] public Output<int?> BackendPort { get; private set; } = null!; /// <summary> /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. /// </summary> [Output("enableFloatingIP")] public Output<bool?> EnableFloatingIP { get; private set; } = null!; /// <summary> /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. /// </summary> [Output("enableTcpReset")] public Output<bool?> EnableTcpReset { get; private set; } = null!; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> [Output("etag")] public Output<string> Etag { get; private set; } = null!; /// <summary> /// A reference to frontend IP addresses. /// </summary> [Output("frontendIPConfiguration")] public Output<Outputs.SubResourceResponse?> FrontendIPConfiguration { get; private set; } = null!; /// <summary> /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. /// </summary> [Output("frontendPort")] public Output<int?> FrontendPort { get; private set; } = null!; /// <summary> /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. /// </summary> [Output("idleTimeoutInMinutes")] public Output<int?> IdleTimeoutInMinutes { get; private set; } = null!; /// <summary> /// The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource. /// </summary> [Output("name")] public Output<string?> Name { get; private set; } = null!; /// <summary> /// The reference to the transport protocol used by the load balancing rule. /// </summary> [Output("protocol")] public Output<string?> Protocol { get; private set; } = null!; /// <summary> /// The provisioning state of the inbound NAT rule resource. /// </summary> [Output("provisioningState")] public Output<string> ProvisioningState { get; private set; } = null!; /// <summary> /// Type of the resource. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Create a InboundNatRule resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public InboundNatRule(string name, InboundNatRuleArgs args, CustomResourceOptions? options = null) : base("azure-native:network/v20200501:InboundNatRule", name, args ?? new InboundNatRuleArgs(), MakeResourceOptions(options, "")) { } private InboundNatRule(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:network/v20200501:InboundNatRule", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:network/v20200501:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20170601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20170801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20170901:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170901:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20171001:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20171001:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20171101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20171101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20180801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20181001:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181001:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20181101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20181201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20190901:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190901:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20191101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20191101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20191201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20191201:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20200301:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200301:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20200401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200401:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20200601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200601:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20200701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200701:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20200801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200801:InboundNatRule"}, new Pulumi.Alias { Type = "azure-native:network/v20201101:InboundNatRule"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20201101:InboundNatRule"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing InboundNatRule resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static InboundNatRule Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new InboundNatRule(name, id, options); } } public sealed class InboundNatRuleArgs : Pulumi.ResourceArgs { /// <summary> /// The port used for the internal endpoint. Acceptable values range from 1 to 65535. /// </summary> [Input("backendPort")] public Input<int>? BackendPort { get; set; } /// <summary> /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. /// </summary> [Input("enableFloatingIP")] public Input<bool>? EnableFloatingIP { get; set; } /// <summary> /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. /// </summary> [Input("enableTcpReset")] public Input<bool>? EnableTcpReset { get; set; } /// <summary> /// A reference to frontend IP addresses. /// </summary> [Input("frontendIPConfiguration")] public Input<Inputs.SubResourceArgs>? FrontendIPConfiguration { get; set; } /// <summary> /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. /// </summary> [Input("frontendPort")] public Input<int>? FrontendPort { get; set; } /// <summary> /// Resource ID. /// </summary> [Input("id")] public Input<string>? Id { get; set; } /// <summary> /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. /// </summary> [Input("idleTimeoutInMinutes")] public Input<int>? IdleTimeoutInMinutes { get; set; } /// <summary> /// The name of the inbound nat rule. /// </summary> [Input("inboundNatRuleName")] public Input<string>? InboundNatRuleName { get; set; } /// <summary> /// The name of the load balancer. /// </summary> [Input("loadBalancerName", required: true)] public Input<string> LoadBalancerName { get; set; } = null!; /// <summary> /// The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// The reference to the transport protocol used by the load balancing rule. /// </summary> [Input("protocol")] public InputUnion<string, Pulumi.AzureNative.Network.V20200501.TransportProtocol>? Protocol { get; set; } /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; public InboundNatRuleArgs() { } } }
55.372263
288
0.619496
[ "Apache-2.0" ]
sebtelko/pulumi-azure-native
sdk/dotnet/Network/V20200501/InboundNatRule.cs
15,172
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="MainViewModel.cs" company="Helix Toolkit"> // Copyright (c) 2014 Helix Toolkit contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Workitem10044 { using DemoCore; using HelixToolkit.Wpf.SharpDX; using HelixToolkit.Wpf.SharpDX.Extensions; public class MainViewModel : BaseViewModel { public MainViewModel() { // titles this.Title = "Simple Demo (Workitem 10044)"; this.SubTitle = "Please note that this scene is defined completely in XAML."; EffectsManager = new DefaultEffectsManager(); RenderTechnique = EffectsManager[DefaultRenderTechniqueNames.Blinn]; } } }
36.5
121
0.469968
[ "MIT" ]
SiNeumann/helix-toolkit
Source/Examples/WPF.SharpDX/ExampleBrowser/Workitems/Workitem10044/MainViewModel.cs
951
C#
// ***************************************************************************** // BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE) // © Component Factory Pty Ltd, 2006 - 2016, All rights reserved. // The software and associated documentation supplied hereunder are the // proprietary information of Component Factory Pty Ltd, 13 Swallows Close, // Mornington, Vic 3931, Australia and are supplied subject to license terms. // // Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2020. All rights reserved. (https://github.com/Wagnerp/Krypton-NET-5.450) // Version 5.450.0.0 www.ComponentFactory.com // ***************************************************************************** using System.Drawing; using System.Windows.Forms; using System.Diagnostics; namespace ComponentFactory.Krypton.Toolkit { /// <summary> /// Redirects requests for tree view images from the TreeViewImages instance. /// </summary> public class PaletteRedirectTreeView : PaletteRedirect { #region Instance Fields private readonly TreeViewImages _plusMinusImages; private readonly CheckBoxImages _checkboxImages; #endregion #region Identity /// <summary> /// Initialize a new instance of the PaletteRedirectTreeView class. /// </summary> /// <param name="plusMinusImages">Reference to source of tree view images.</param> /// <param name="checkboxImages">Reference to source of check box images.</param> public PaletteRedirectTreeView(TreeViewImages plusMinusImages, CheckBoxImages checkboxImages) : this(null, plusMinusImages, checkboxImages) { } /// <summary> /// Initialize a new instance of the PaletteRedirectTreeView class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="plusMinusImages">Reference to source of tree view images.</param> /// <param name="checkboxImages">Reference to source of check box images.</param> public PaletteRedirectTreeView(IPalette target, TreeViewImages plusMinusImages, CheckBoxImages checkboxImages) : base(target) { Debug.Assert(plusMinusImages != null); // Remember incoming targets _plusMinusImages = plusMinusImages; _checkboxImages = checkboxImages; } #endregion #region Images /// <summary> /// Gets a tree view image appropriate for the provided state. /// </summary> /// <param name="expanded">Is the node expanded</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetTreeViewImage(bool expanded) { Image retImage = (expanded ? _plusMinusImages.Minus : _plusMinusImages.Plus) ?? Target.GetTreeViewImage(expanded); // Not found, then inherit from target return retImage; } /// <summary> /// Gets a check box image appropriate for the provided state. /// </summary> /// <param name="enabled">Is the check box enabled.</param> /// <param name="checkState">Is the check box checked/unchecked/indeterminate.</param> /// <param name="tracking">Is the check box being hot tracked.</param> /// <param name="pressed">Is the check box being pressed.</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) { Image retImage; // Get the state specific image switch (checkState) { default: case CheckState.Unchecked: if (!enabled) { retImage = _checkboxImages.UncheckedDisabled; } else if (pressed) { retImage = _checkboxImages.UncheckedPressed; } else if (tracking) { retImage = _checkboxImages.UncheckedTracking; } else { retImage = _checkboxImages.UncheckedNormal; } break; case CheckState.Checked: if (!enabled) { retImage = _checkboxImages.CheckedDisabled; } else if (pressed) { retImage = _checkboxImages.CheckedPressed; } else if (tracking) { retImage = _checkboxImages.CheckedTracking; } else { retImage = _checkboxImages.CheckedNormal; } break; case CheckState.Indeterminate: if (!enabled) { retImage = _checkboxImages.IndeterminateDisabled; } else if (pressed) { retImage = _checkboxImages.IndeterminatePressed; } else if (tracking) { retImage = _checkboxImages.IndeterminateTracking; } else { retImage = _checkboxImages.IndeterminateNormal; } break; } // Not found, then get the common image if (retImage == null) { retImage = _checkboxImages.Common; } // Not found, then inherit from target return retImage ?? Target.GetCheckBoxImage(enabled, checkState, tracking, pressed); } #endregion } }
39.396341
157
0.50828
[ "BSD-3-Clause" ]
Krypton-Suite-Legacy-Archive/Krypton-NET-5.450
Source/Krypton Components/ComponentFactory.Krypton.Toolkit/Palette Controls/PaletteRedirectTreeView.cs
6,464
C#
using System.Linq; using Eventualize.Interfaces.BaseTypes; namespace Eventualize.Interfaces.Security { public class EventualizeUser { public EventualizeUser(UserId userId) { this.UserId = userId; } public UserId UserId { get; } } }
18.125
45
0.634483
[ "MIT" ]
Useurmind/Eventualize
Eventualize.Interfaces/Security/EventualizeUser.cs
290
C#
using Newtonsoft.Json; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using VEDriversLite.Cryptocurrencies.Dto; namespace VEDriversLite.Cryptocurrencies { public class TestExchangeRatesAPI : CommonExchangeRatesAPI, IDisposable { public TestExchangeRatesAPI() { Name = "Test"; APIUrl = "https://api.coingecko.com/api/v3"; Type = ExchangeRatesAPITypes.Test; } public override async Task<bool> GetPriceFromAPI() { var nebl = 150; var doge = 1.5; var nebldoge = 0.0; if (doge > 0) nebldoge = nebl / doge; if (Prices.TryGetValue("nebl/usd", out var nup)) nup.Value = nebl; else { Prices.TryAdd("nebl/usd", new Dto.PriceDto() { Currency = CurrencyTypes.NEBL, VS_Currency = CurrencyTypes.USD, Value = nebl }); } if (Prices.TryGetValue("dogecoin/usd", out var dup)) dup.Value = doge; else { Prices.TryAdd("dogecoin/usd", new Dto.PriceDto() { Currency = CurrencyTypes.DOGE, VS_Currency = CurrencyTypes.USD, Value = doge }); } if (Prices.TryGetValue("nebl/dogecoin", out var ndp)) ndp.Value = nebldoge; else { Prices.TryAdd("nebl/dogecoin", new Dto.PriceDto() { Currency = CurrencyTypes.NEBL, VS_Currency = CurrencyTypes.DOGE, Value = nebldoge }); } return true; } } }
30.552239
76
0.474353
[ "BSD-2-Clause" ]
fyziktom/VirtualEconomyFramework
VirtualEconomyFramework/VEDriversLite/Cryptocurrencies/TestExchangeRatesAPI.cs
2,049
C#
using HRMSystem.Core.Entities.Abstract; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HRMSystem.Core.Entities.Dtos.ApplicationDtos { public class ApplicationListDto : ListDtoBase, IDto { public IEnumerable<ApplicationGetDto> Applications { get; set; } } }
23.866667
72
0.765363
[ "MIT" ]
cativ3/HRMSystem
HRMSystem.Core/Entities/Dtos/ApplicationDtos/ApplicationListDto.cs
360
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.Msk { public static class GetCluster { /// <summary> /// Get information on an Amazon MSK Cluster. /// /// {{% examples %}} /// {{% /examples %}} /// </summary> public static Task<GetClusterResult> InvokeAsync(GetClusterArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetClusterResult>("aws:msk/getCluster:getCluster", args ?? new GetClusterArgs(), options.WithVersion()); } public sealed class GetClusterArgs : Pulumi.InvokeArgs { /// <summary> /// Name of the cluster. /// </summary> [Input("clusterName", required: true)] public string ClusterName { get; set; } = null!; [Input("tags")] private Dictionary<string, object>? _tags; /// <summary> /// Map of key-value pairs assigned to the cluster. /// </summary> public Dictionary<string, object> Tags { get => _tags ?? (_tags = new Dictionary<string, object>()); set => _tags = value; } public GetClusterArgs() { } } [OutputType] public sealed class GetClusterResult { /// <summary> /// Amazon Resource Name (ARN) of the MSK cluster. /// </summary> public readonly string Arn; /// <summary> /// A comma separated list of one or more hostname:port pairs of Kafka brokers suitable to boostrap connectivity to the Kafka cluster. /// </summary> public readonly string BootstrapBrokers; /// <summary> /// A comma separated list of one or more DNS names (or IPs) and TLS port pairs kafka brokers suitable to boostrap connectivity to the kafka cluster. /// </summary> public readonly string BootstrapBrokersTls; public readonly string ClusterName; /// <summary> /// id is the provider-assigned unique ID for this managed resource. /// </summary> public readonly string Id; /// <summary> /// Apache Kafka version. /// </summary> public readonly string KafkaVersion; /// <summary> /// Number of broker nodes in the cluster. /// </summary> public readonly int NumberOfBrokerNodes; /// <summary> /// Map of key-value pairs assigned to the cluster. /// </summary> public readonly ImmutableDictionary<string, object> Tags; /// <summary> /// A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster. /// </summary> public readonly string ZookeeperConnectString; [OutputConstructor] private GetClusterResult( string arn, string bootstrapBrokers, string bootstrapBrokersTls, string clusterName, string id, string kafkaVersion, int numberOfBrokerNodes, ImmutableDictionary<string, object> tags, string zookeeperConnectString) { Arn = arn; BootstrapBrokers = bootstrapBrokers; BootstrapBrokersTls = bootstrapBrokersTls; ClusterName = clusterName; Id = id; KafkaVersion = kafkaVersion; NumberOfBrokerNodes = numberOfBrokerNodes; Tags = tags; ZookeeperConnectString = zookeeperConnectString; } } }
32.016667
158
0.593441
[ "ECL-2.0", "Apache-2.0" ]
johnktims/pulumi-aws
sdk/dotnet/Msk/GetCluster.cs
3,842
C#
using System; namespace Ducode.Wolk.Application.Exceptions { public class NotFoundException : Exception { public NotFoundException(string message) : base(message) { } public NotFoundException(string name, object key) : base($"Entity {name} ({key}) was not found.") { } } }
21.352941
65
0.564738
[ "MIT" ]
dukeofharen/wolk
src/Ducode.Wolk.Application/Exceptions/NotFoundException.cs
363
C#
using Microsoft.Xna.Framework; using System; namespace EnduranceTheMaze { /// <summary> /// A floating-point rectangle which allows for smooth animation. /// </summary> public class SmoothRect : IEquatable<SmoothRect> { #region Members public float X, Y, Width, Height; #endregion #region Properties /// <summary> /// The first Y coordinate. /// </summary> public float Top { get { return Y; } } /// <summary> /// The second Y coordinate. /// </summary> public float Bottom { get { return Y + Height; } } /// <summary> /// The first X coordinate. /// </summary> public float Left { get { return X; } } /// <summary> /// The second X coordinate. /// </summary> public float Right { get { return X + Width; } } /// <summary> /// The X and Y coordinates. /// </summary> public Vector2 Position { get { return new Vector2(X, Y); } } #endregion #region Constructors /// <summary> /// Creates a rectangle from a position and dimensions. /// </summary> /// <param name="X">The x-coordinate.</param> /// <param name="Y">The y-coordinate.</param> /// <param name="Width">The width of the rectangle.</param> /// <param name="Height">The height of the rectangle.</param> public SmoothRect(float X, float Y, float Width, float Height) { this.X = X; this.Y = Y; this.Width = Width; this.Height = Height; } /// <summary> /// Creates a rectangle from a position and dimensions. /// </summary> /// <param name="pos">The X and Y coordinates.</param> /// <param name="Width">The width of the rectangle.</param> /// <param name="Height">The height of the rectangle.</param> public SmoothRect(Vector2 pos, float Width, float Height) { X = pos.X; Y = pos.Y; this.Width = Width; this.Height = Height; } /// <summary> /// Clone constructor. /// </summary> public SmoothRect(SmoothRect rect) { X = rect.X; Y = rect.Y; Width = rect.Width; Height = rect.Height; } #endregion #region Methods /// <summary> /// Determines whether the specified Object is equivalent. /// </summary> /// <param name="other"> /// The Object to compare with the current Rectangle. /// </param> public bool Equals(SmoothRect other) { if (X == other.X && Y == other.Y && Width == other.Width && Height == other.Height) { return true; } return false; } /// <summary> /// Returns a Rectangle instance. /// </summary> public Rectangle ToRect() { return new Rectangle((int)X, (int)Y, (int)Width, (int)Height); } #endregion #region Static Methods /// <summary> /// An empty rectangle with all values set to zero. /// </summary> public static SmoothRect Empty { get { return new SmoothRect(0, 0, 0, 0); } } /// <summary> /// Returns a SmoothRect large enough to fit two other SmoothRects. /// </summary> public static SmoothRect Union(SmoothRect rect1, SmoothRect rect2) { float posX, posY, posWidth, posHeight; posX = Math.Min(rect1.X, rect2.X); posY = Math.Min(rect1.Y, rect2.Y); posWidth = Math.Max(rect1.X + rect1.Width, rect2.X + rect2.Width); posHeight = Math.Max(rect1.Y + rect1.Height, rect2.Y + rect2.Height); //Creates a new SmoothRect. return new SmoothRect(posX, posY, posWidth, posHeight); } /// <summary> /// Returns whether or not two SmoothRects intersect. /// </summary> public static bool IsIntersecting(SmoothRect rect1, SmoothRect rect2) { //Returns true if the rectangles are both the exact same. if (rect1.X == rect2.X && rect1.Y == rect2.Y && rect1.Width == rect2.Width && rect1.Height == rect2.Height) { return true; } //Guarantees that the corners of the rectangles are aligned such //that there is always one intersection. if (rect1.X < rect2.X + rect2.Width && rect2.X < rect1.X + rect1.Width && rect1.Y < rect2.Y + rect2.Height && rect2.Y < rect1.Y + rect1.Height) { return true; } return false; } #endregion } }
27.540816
81
0.467395
[ "MIT" ]
JoshuaLamusga/Endurance-The-Maze
EnduranceTheMaze/SimpleXnaFramework/SmoothRect.cs
5,400
C#
using System; using System.Xml.Serialization; using System.ComponentModel.DataAnnotations; using BroadWorksConnector.Ocip.Validation; using System.Collections.Generic; namespace BroadWorksConnector.Ocip.Models { /// <summary> /// /// </summary> [Serializable] [XmlRoot(Namespace = "")] [Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""ab0042aa512abc10edb3c55e4b416b0b:28038""}]")] public class SystemVoiceMessagingGroupGetVoicePortalMenusResponse19VoicePortalCallingMenuKeys { private string _endCurrentCallAndGoBackToPreviousMenu; [XmlElement(ElementName = "endCurrentCallAndGoBackToPreviousMenu", IsNullable = false, Namespace = "")] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:28038")] [MinLength(1)] [MaxLength(3)] [RegularExpression(@"([0-9]|\*|#){0,3}")] public string EndCurrentCallAndGoBackToPreviousMenu { get => _endCurrentCallAndGoBackToPreviousMenu; set { EndCurrentCallAndGoBackToPreviousMenuSpecified = true; _endCurrentCallAndGoBackToPreviousMenu = value; } } [XmlIgnore] protected bool EndCurrentCallAndGoBackToPreviousMenuSpecified { get; set; } private string _returnToPreviousMenu; [XmlElement(ElementName = "returnToPreviousMenu", IsNullable = false, Namespace = "")] [Group(@"ab0042aa512abc10edb3c55e4b416b0b:28038")] [Length(1)] [RegularExpression(@"[0-9]|\*|#")] public string ReturnToPreviousMenu { get => _returnToPreviousMenu; set { ReturnToPreviousMenuSpecified = true; _returnToPreviousMenu = value; } } [XmlIgnore] protected bool ReturnToPreviousMenuSpecified { get; set; } } }
31.866667
131
0.641213
[ "MIT" ]
JTOne123/broadworks-connector-net
BroadworksConnector/Ocip/Models/SystemVoiceMessagingGroupGetVoicePortalMenusResponse19VoicePortalCallingMenuKeys.cs
1,912
C#
using Newtonsoft.Json; using System; using System.Collections.Generic; using TMDb.Client.Contracts; namespace TMDb.Client.Entities.Media { // TODO: Replace 'Title' with 'Name' and override JsonProperty to use Title parameter name")] public class MovieMinified : IMovieMinified { [JsonProperty("adult")] public virtual bool Adult { get; set; } [JsonProperty("video")] public virtual bool Video { get; set; } [JsonProperty("popularity")] public virtual double? Popularity { get; set; } [JsonProperty("vote_average")] public virtual double? VoteAverage { get; set; } [JsonProperty("vote_count")] public virtual int VoteCount { get; set; } [JsonProperty("id")] public virtual int Id { get; set; } [JsonProperty("backdrop_path")] public virtual string BackdropPath { get; set; } /// <include file='tmdb-api-comments.xml' path='doc/members/member[@name="LanguageAbbreviation"]/*' /> [JsonProperty("original_language")] // TODO: Rename property to OriginalLanguage")] public virtual string LanguageAbbreviation { get; set; } [JsonProperty("original_title")] public virtual string OriginalTitle { get; set; } [JsonProperty("overview")] public virtual string Overview { get; set; } [JsonProperty("poster_path")] public virtual string PosterPath { get; set; } [JsonProperty("title")] public virtual string Title { get; set; } [JsonProperty("release_date")] public virtual DateTime? ReleaseDate { get; set; } [JsonProperty("genre_ids")] // TODO: Create JSON Converter that will use Genres to fill data")] public virtual IEnumerable<int> GenreIds { get; set; } } }
32.696429
110
0.634626
[ "MIT" ]
joshuajones02/TMDb
TMDb.Client/Models/Entities/Media/MovieMinified.cs
1,833
C#
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Linq; using QuantConnect.Brokerages; using QuantConnect.Data; using QuantConnect.Orders; namespace QuantConnect.Algorithm.CSharp { /// <summary> /// This algorithm is a regression test case for CancelOpenOrders and rejected orders /// </summary> public class CancelOpenOrdersRegressionAlgorithm : QCAlgorithm { /// <summary> /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized. /// </summary> public override void Initialize() { SetStartDate(2017, 9, 3); //Set Start Date SetEndDate(2017, 9, 3); //Set End Date SetCash(1000); //Set Strategy Cash SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash); AddCrypto("BTCUSD"); AddCrypto("ETHUSD"); } /// <summary> /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. /// </summary> /// <param name="data">Slice object keyed by symbol containing the stock data</param> public override void OnData(Slice data) { if (UtcTime.Hour != 6) return; if (UtcTime.Minute == 0) { // this order will be rejected for insufficient funds LimitOrder("BTCUSD", 100m, 4734.64m); LimitOrder("ETHUSD", 1.35505027m, 368.8m); } else if (UtcTime.Minute == 6) { Transactions.CancelOpenOrders("BTCUSD"); LimitOrder("BTCUSD", 0.10576312m, 4727.61m); } else if (UtcTime.Minute == 12) { Transactions.CancelOpenOrders("BTCUSD"); LimitOrder("BTCUSD", 0.10576267m, 4727.63m); } else if (UtcTime.Minute == 18) { Transactions.CancelOpenOrders("BTCUSD"); LimitOrder("BTCUSD", 0.10547724m, 4740.42m); } else if (UtcTime.Minute == 24) { Transactions.CancelOpenOrders("BTCUSD"); } } /// <summary> /// Order fill event handler. On an order fill update the resulting information is passed to this method. /// </summary> /// <param name="orderEvent">Order event details containing details of the events</param> public override void OnOrderEvent(OrderEvent orderEvent) { Debug(orderEvent.ToString()); } /// <summary> /// End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. /// </summary> public override void OnEndOfAlgorithm() { const int expectedOrders = 5; var expectedStatus = new[] { OrderStatus.Invalid, OrderStatus.Filled, OrderStatus.Canceled, OrderStatus.Canceled, OrderStatus.Filled }; var orders = Transactions.GetOrders(x => true).ToList(); if (orders.Count != expectedOrders) { throw new Exception($"Expected orders: {expectedOrders}, actual orders: {orders.Count}"); } for (var i = 0; i < expectedOrders; i++) { var order = orders[i]; if (order.Status != expectedStatus[i]) { throw new Exception($"Invalid status for order {order.Id}, Expected: {expectedStatus[i]}, actual: {order.Status}"); } } } } }
38.566372
149
0.590638
[ "Apache-2.0" ]
beezy3601/lean2
Algorithm.CSharp/CancelOpenOrdersRegressionAlgorithm.cs
4,360
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. namespace StructSample { public unsafe struct OutputStruct { public ValueStruct value; public static OutputStruct* MoveToContext(OutputStruct* output) { return output; } } }
19.411765
71
0.645455
[ "MIT" ]
1u0/FASTER
cs/playground/ManagedSampleCore/OutputStruct.cs
332
C#
using System.Threading.Tasks; using ExRam.Gremlinq.Core; using ExRam.Gremlinq.Core.Tests; using ExRam.Gremlinq.Providers.WebSocket; using ExRam.Gremlinq.Tests.Entities; using Xunit; using Xunit.Abstractions; using static ExRam.Gremlinq.Core.GremlinQuerySource; namespace ExRam.Gremlinq.Providers.GremlinServer.Tests { public sealed class GremlinServerQuerySerializationTest : QuerySerializationTest { public GremlinServerQuerySerializationTest(ITestOutputHelper testOutputHelper) : base( g .ConfigureEnvironment(env => env .UseGremlinServer(builder => builder .AtLocalhost())), testOutputHelper) { } [Fact] public async Task AddV_with_enum_property_with_workaround() { await _g .ConfigureEnvironment(env => env .ConfigureOptions(options => options .SetValue(GremlinServerGremlinqOptions.WorkaroundTinkerpop2112, true))) .AddV(new Person { Id = 1, Gender = Gender.Female }) .Verify(this); } } }
32.055556
95
0.634315
[ "MIT" ]
gabi-giladov/ExRam.Gremlinq
test/ExRam.Gremlinq.Providers.GremlinServer.Tests/GremlinServerQuerySerializationTest.cs
1,156
C#
using System.IO; namespace Vokabular.RestClient.Results { public class FileResultData { public Stream Stream { get; set; } public string MimeType { get; set; } public string FileName { get; set; } public long? FileSize { get; set; } } }
21.769231
44
0.611307
[ "BSD-3-Clause" ]
RIDICS/ITJakub
UJCSystem/Vokabular.RestClient/Results/FileResultData.cs
285
C#
using Flurl.Http; using Newtonsoft.Json; using System; using System.IO; using System.Net; using System.Runtime.Caching; using System.Threading.Tasks; using System.Web; using Vendr.PaymentProviders.PayPal.Api.Models; namespace Vendr.PaymentProviders.PayPal.Api { public class PayPalClient { private static MemoryCache AccessTokenCache = new MemoryCache("PayPalClient_AccessTokenCache"); public const string SanboxApiUrl = "https://api.sandbox.paypal.com"; public const string LiveApiUrl = "https://api.paypal.com"; private PayPalClientConfig _config; public PayPalClient(PayPalClientConfig config) { _config = config; } public PayPalOrder CreateOrder(PayPalCreateOrderRequest request) { return Request("/v2/checkout/orders", (req) => req .WithHeader("Prefer", "return=representation") .PostJsonAsync(request) .ReceiveJson<PayPalOrder>()); } public PayPalOrder GetOrder(string orderId) { return Request($"/v2/checkout/orders/{orderId}", (req) => req .WithHeader("Prefer", "return=representation") .GetAsync() .ReceiveJson<PayPalOrder>()); } public PayPalOrder AuthorizeOrder(string orderId) { return Request($"/v2/checkout/orders/{orderId}/authorize", (req) => req .WithHeader("Prefer", "return=representation") .PostJsonAsync(null) .ReceiveJson<PayPalOrder>()); } public PayPalOrder CaptureOrder(string orderId) { return Request($"/v2/checkout/orders/{orderId}/capture", (req) => req .WithHeader("Prefer", "return=representation") .PostJsonAsync(null) .ReceiveJson<PayPalOrder>()); } public PayPalCapturePayment CapturePayment(string paymentId) { return Request($"/v2/payments/authorizations/{paymentId}/capture", (req) => req .WithHeader("Prefer", "return=representation") .PostJsonAsync(new { final_capture = true }) .ReceiveJson<PayPalCapturePayment>()); } public PayPalRefundPayment RefundPayment(string paymentId) { return Request($"/v2/payments/captures/{paymentId}/refund", (req) => req .PostJsonAsync(null) .ReceiveJson<PayPalRefundPayment>()); } public void CancelPayment(string paymentId) { Request($"/v2/payments/authorizations/{paymentId}/capture", (req) => req .WithHeader("Prefer", "return=representation") .PostJsonAsync(null)); } public PayPalWebhookEvent ParseWebhookEvent(HttpRequestBase request) { var payPalWebhookEvent = default(PayPalWebhookEvent); if (request.InputStream.CanSeek) request.InputStream.Seek(0, SeekOrigin.Begin); using (var reader = new StreamReader(request.InputStream)) { var json = reader.ReadToEnd(); var webhookSignatureRequest = new PayPalVerifyWebhookSignatureRequest { AuthAlgorithm = request.Headers["paypal-auth-algo"], CertUrl = request.Headers["paypal-cert-url"], TransmissionId = request.Headers["paypal-transmission-id"], TransmissionSignature = request.Headers["paypal-transmission-sig"], TransmissionTime = request.Headers["paypal-transmission-time"], WebhookId = _config.WebhookId, WebhookEvent = new { } }; var webhookSignatureRequestStr = JsonConvert.SerializeObject(webhookSignatureRequest).Replace("{}", json); var result = Request("/v1/notifications/verify-webhook-signature", (req) => req .WithHeader("Content-Type", "application/json") .PostStringAsync(webhookSignatureRequestStr) .ReceiveJson<PayPalVerifyWebhookSignatureResult>()); if (result != null && result.VerificationStatus == "SUCCESS") { payPalWebhookEvent = JsonConvert.DeserializeObject<PayPalWebhookEvent>(json); } } return payPalWebhookEvent; } //private PayPalWebhookEvent ParseAndValidatePayPalWebhookEvent(PayPalWebhookRequestConfig requestConfig, HttpRequestBase request) //{ // var payPalWebhookEvent = default(PayPalWebhookEvent); // if (request.InputStream.CanSeek) // request.InputStream.Seek(0, SeekOrigin.Begin); // using (var reader = new StreamReader(request.InputStream)) // { // var json = reader.ReadToEnd(); // var tmpPayPalWebhookEvent = JsonConvert.DeserializeObject<PayPalWebhookEvent>(json); // var result = MakePayPalRequest("/v1/notifications/verify-webhook-signature", (req) => req // .PostJsonAsync(new PayPalVerifyWebhookSignatureRequest // { // AuthAlgorithm = request.Headers["paypal-auth-algo"], // CertUrl = request.Headers["paypal-cert-url"], // TransmissionId = request.Headers["paypal-transmission-id"], // TransmissionSignature = request.Headers["paypal-transmission-sig"], // TransmissionTime = request.Headers["paypal-transmission-time"], // WebhookId = requestConfig.WebhookId, // WebhookEvent = tmpPayPalWebhookEvent // }) // .ReceiveJson<PayPalVerifyWebhookSignatureResult>(), // requestConfig); // if (result != null && result.VerificationStatus == "SUCCESS") // { // payPalWebhookEvent = tmpPayPalWebhookEvent; // } // } // return payPalWebhookEvent; //} private TResult Request<TResult>(string url, Func<IFlurlRequest, Task<TResult>> func) { var result = default(TResult); try { var req = new FlurlRequest(_config.BaseUrl + url) .WithOAuthBearerToken(GetAccessToken()); result = func.Invoke(req).Result; } catch (FlurlHttpException ex) { if (ex.Call.HttpStatus == HttpStatusCode.Unauthorized) { var req = new FlurlRequest(_config.BaseUrl + url) .WithOAuthBearerToken(GetAccessToken(true)); result = func.Invoke(req).Result; } else { throw; } } return result; } private string GetAccessToken(bool forceReAuthentication = false) { var cacheKey = $"{_config.BaseUrl}__{_config.ClientId}__{_config.Secret}"; if (!AccessTokenCache.Contains(cacheKey) || forceReAuthentication) { var result = Authenticate(); AccessTokenCache.Set(cacheKey, result.AccessToken, new CacheItemPolicy { AbsoluteExpiration = DateTimeOffset.UtcNow.AddSeconds(result.ExpiresIn - 5) }); } return AccessTokenCache.Get(cacheKey).ToString(); } private PayPalAccessTokenResult Authenticate() { return new FlurlRequest(_config.BaseUrl + "/v1/oauth2/token") .WithBasicAuth(_config.ClientId, _config.Secret) .PostUrlEncodedAsync(new { grant_type = "client_credentials" }) .ReceiveJson<PayPalAccessTokenResult>() .Result; } } }
37.893023
138
0.560452
[ "MIT" ]
bjarnef/vendr-payment-provider-paypal
src/Vendr.PaymentProviders.PayPal/Api/PayPalClient.cs
8,149
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CompareCloudware.Domain.Models { #region SupportTerritory public class SupportTerritory { public virtual int SupportTerritoryID { get; set; } public virtual string SupportTerritoryName { get; set; } public virtual Status SupportTerritoryStatus { get; set; } public virtual byte[] RowVersion { get; set; } public virtual List<CloudApplication> CloudApplications { get; set; } } #endregion }
28.842105
77
0.70438
[ "MIT" ]
protechdm/CompareCloudware
CompareCloudware.Domain/Models/SupportTerritory.cs
550
C#
// <auto-generated /> namespace Altairis.Rap.Migrations { using System.CodeDom.Compiler; using System.Data.Entity.Migrations; using System.Data.Entity.Migrations.Infrastructure; using System.Resources; [GeneratedCode("EntityFramework.Migrations", "6.0.2-21211")] public sealed partial class Add_Messages : IMigrationMetadata { private readonly ResourceManager Resources = new ResourceManager(typeof(Add_Messages)); string IMigrationMetadata.Id { get { return "201402242100028_Add_Messages"; } } string IMigrationMetadata.Source { get { return null; } } string IMigrationMetadata.Target { get { return Resources.GetString("Target"); } } } }
27.333333
95
0.620732
[ "MIT" ]
ridercz/Rap
Altairis.Rap/Migrations/201402242100028_Add_Messages.Designer.cs
820
C#
using Microsoft.AspNetCore.Mvc; using Mvc.RoleAuthorization.Services; using System.Threading.Tasks; namespace Mvc.RoleAuthorization.ViewComponents { public class NavigationMenuViewComponent : ViewComponent { private readonly IDataAccessService _dataAccessService; public NavigationMenuViewComponent(IDataAccessService dataAccessService) { _dataAccessService = dataAccessService; } public async Task<IViewComponentResult> InvokeAsync() { var items = await _dataAccessService.GetMenuItemsAsync(HttpContext.User); return View(items); } } }
25.608696
77
0.775891
[ "MIT" ]
dnxit/Mvc-Dynamic-Role-Permission-Authorization
Mvc.RoleAuthorization/ViewComponents/NavigationMenuViewComponent.cs
591
C#
using System; using System.Diagnostics; using ActionsSample.Commands; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ActionsSample.Test { [TestClass] public class UnitTest1 { [TestMethod] public void Test_CutAndSave() { var action = new ActionCommands(); action.Commands.Add(new WaitCommand()); action.Commands.Add(new TargetScreenCommand()); action.Commands.Add(new CutCommand()); action.Commands.Add(new SaveFileCommand()); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } [TestMethod] public void Test_CutAndSave_Text() { var action = ActionCommands.FromCommands("Wait > Screen > Cut > Save"); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } [TestMethod] public void Test_ScreenSave() { var action = new ActionCommands(); action.Commands.Add(new TargetScreenCommand()); action.Commands.Add(new SaveFileCommand()); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } [TestMethod] public void Test_ScreenSave_Text() { var action = ActionCommands.FromCommands("Screen > Save"); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } [TestMethod] public void Test_SavePrimaryMonitor() { var action = new ActionCommands(); action.Commands.Add(new TargetPrimaryMonitorCommand()); action.Commands.Add(new SaveFileCommand()); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } [TestMethod] public void Test_SavePrimaryMonitor_Text() { var action = ActionCommands.FromCommands("Primary Monitor > Save"); Debug.WriteLine(action.ToString()); Debug.WriteLine(""); action.Do(); } } }
26.841463
83
0.554294
[ "MIT" ]
surviveplus/Light-Cutter
prototype/ActionsSample/ActionsSample.Test/UnitTest1.cs
2,203
C#
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! namespace Google.Cloud.Dialogflow.Cx.V3.Snippets { using Google.Cloud.Dialogflow.Cx.V3; public sealed partial class GeneratedEntityTypesClientStandaloneSnippets { /// <summary>Snippet for DeleteEntityType</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void DeleteEntityTypeResourceNames() { // Create client EntityTypesClient entityTypesClient = EntityTypesClient.Create(); // Initialize request argument(s) EntityTypeName name = EntityTypeName.FromProjectLocationAgentEntityType("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); // Make the request entityTypesClient.DeleteEntityType(name); } } }
39.025641
139
0.691196
[ "Apache-2.0" ]
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3/google-cloud-dialogflow-cx-v3-csharp/Google.Cloud.Dialogflow.Cx.V3.StandaloneSnippets/EntityTypesClient.DeleteEntityTypeResourceNamesSnippet.g.cs
1,522
C#
using System; using Xamarin.Forms; namespace GPS_navigation.Styles { public class GradientStop { private float offset; public float Offset { get => offset; set { // Value needs to be 0-1. if (value > 1) value = 1; else if (value < 0) value = 0; offset = value; } } public Color Color { get; set; } } }
18.25
41
0.407045
[ "MIT" ]
ruinengLi/GnssNavigationAndVisualization
GPS_navigation/GPS_navigation/Styles/GradientStop.cs
513
C#
using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using HuaweiCloud.SDK.Core; namespace HuaweiCloud.SDK.Ims.V2.Model { /// <summary> /// Response Object /// </summary> public class ListImageByTagsResponse : SdkResponse { /// <summary> /// 镜像信息列表 /// </summary> [JsonProperty("resources", NullValueHandling = NullValueHandling.Ignore)] public List<ShowImageByTagsResource> Resources { get; set; } /// <summary> /// 总记录数 /// </summary> [JsonProperty("total_count", NullValueHandling = NullValueHandling.Ignore)] public int? TotalCount { get; set; } /// <summary> /// Get the string /// </summary> public override string ToString() { var sb = new StringBuilder(); sb.Append("class ListImageByTagsResponse {\n"); sb.Append(" resources: ").Append(Resources).Append("\n"); sb.Append(" totalCount: ").Append(TotalCount).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns true if objects are equal /// </summary> public override bool Equals(object input) { return this.Equals(input as ListImageByTagsResponse); } /// <summary> /// Returns true if objects are equal /// </summary> public bool Equals(ListImageByTagsResponse input) { if (input == null) return false; return ( this.Resources == input.Resources || this.Resources != null && input.Resources != null && this.Resources.SequenceEqual(input.Resources) ) && ( this.TotalCount == input.TotalCount || (this.TotalCount != null && this.TotalCount.Equals(input.TotalCount)) ); } /// <summary> /// Get hash code /// </summary> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (this.Resources != null) hashCode = hashCode * 59 + this.Resources.GetHashCode(); if (this.TotalCount != null) hashCode = hashCode * 59 + this.TotalCount.GetHashCode(); return hashCode; } } } }
29.692308
83
0.512953
[ "Apache-2.0" ]
cnblogs/huaweicloud-sdk-net-v3
Services/Ims/V2/Model/ListImageByTagsResponse.cs
2,722
C#
/* Copyright (c) 2012 - 2013 Microsoft Corporation. All rights reserved. Use of this sample source code is subject to the terms of the Microsoft license agreement under which you licensed this sample source code and is provided AS-IS. If you did not accept the terms of the license agreement, you are not authorized to use this sample source code. For the terms of the license, please see the license agreement between you and Microsoft. To see all Code Samples for Windows Phone, visit http://code.msdn.microsoft.com/wpapps */ using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Applications.Common; using System.Collections.Generic; using System.Threading; namespace ShakeGestures { public class ShakeGesturesHelper { #region Gesture parameters /// <summary> /// Any vector that has a magnitude (after reducing gravitation) bigger than this parameter will be considered as a shake vector /// </summary> private const double ShakeMagnitudeWithoutGravitationThreshold_Default = 0.2; public double ShakeMagnitudeWithoutGravitationThreshold { get; set; } /// <summary> /// This parameter determines how many consecutive still vectors are required to stop a shake signal /// </summary> private const int StillCounterThreshold_Default = 20; public int StillCounterThreshold { get; set; } /// <summary> /// This parameter determines the maximum allowed magnitude (after reducing gravitation) for a still vector to be considered to the average /// The last still vector is averaged out of still vectors that are under this bound /// </summary> private const double StillMagnitudeWithoutGravitationThreshold_Default = 0.02; public double StillMagnitudeWithoutGravitationThreshold { get; set; } /// <summary> /// The maximum amount of still vectors needed to create a still vector average /// instead of averaging the entire still signal, we just look at the top recent still vectors /// </summary> private const int MaximumStillVectorsNeededForAverage_Default = 20; public int MaximumStillVectorsNeededForAverage { get; set; } /// <summary> /// The minimum amount of still vectors needed to create a still vector average. /// Without enough vectors the average will not be stable and thus ignored /// </summary> private const int MinimumStillVectorsNeededForAverage_Default = 5; public int MinimumStillVectorsNeededForAverage { get; set; } /// <summary> /// Determines the amount of shake vectors needed that has been classified the same to recognize a shake /// </summary> private const int MinimumShakeVectorsNeededForShake_Default = 10; public int MinimumShakeVectorsNeededForShake { get; set; } /// <summary> /// Shake vectors with magnitude less than this parameter will not be considered for gesture classification /// </summary> private const double WeakMagnitudeWithoutGravitationThreshold_Default = 0.2; public double WeakMagnitudeWithoutGravitationThreshold { get; set; } /// <summary> /// Determines the number of moves required to get a shake signal /// </summary> private const int MinimumRequiredMovesForShake_Default = 3; public int MinimumRequiredMovesForShake { get; set; } #endregion #region Private fields // Singleton instance for helper private static volatile ShakeGesturesHelper _singletonInstance; // private lock object for protecting the singleton instance private static Object _syncRoot = new Object(); // last still vector - average of the last still signal // used to eliminate the gravitation effect // initial value has no meaning, it's just a dummy vector to avoid dealing with null values private Simple3DVector _lastStillVector = new Simple3DVector(0, -1, 0); // flag that indicates whether we are currently in a middle of a shake signal private bool _isInShakeState = false; // counts the number of still vectors - while in shake signal private int _stillCounter = 0; // holds shake signal vectors private List<Simple3DVector> _shakeSignal = new List<Simple3DVector>(); // holds shake signal histogram private int[] _shakeHistogram = new int[3]; // hold still signal vectors, newest vectors are first private LinkedList<Simple3DVector> _stillSignal = new LinkedList<Simple3DVector>(); #endregion #region Public events /// <summary> /// Fires when a new shake gesture has been identified /// </summary> public event EventHandler<ShakeGestureEventArgs> ShakeGesture; #endregion #region Constructor /// <summary> /// Private constructor /// Use Instance property to get singleton instance /// </summary> private ShakeGesturesHelper() { // set default values for parameters ShakeMagnitudeWithoutGravitationThreshold = ShakeMagnitudeWithoutGravitationThreshold_Default; StillCounterThreshold = StillCounterThreshold_Default; StillMagnitudeWithoutGravitationThreshold = StillMagnitudeWithoutGravitationThreshold_Default; MinimumStillVectorsNeededForAverage = MinimumStillVectorsNeededForAverage_Default; MaximumStillVectorsNeededForAverage = MaximumStillVectorsNeededForAverage_Default; MinimumShakeVectorsNeededForShake = MinimumShakeVectorsNeededForShake_Default; WeakMagnitudeWithoutGravitationThreshold = WeakMagnitudeWithoutGravitationThreshold_Default; MinimumRequiredMovesForShake = MinimumRequiredMovesForShake_Default; // register for acceleromter input AccelerometerHelper.Instance.ReadingChanged += new EventHandler<AccelerometerHelperReadingEventArgs>(OnAccelerometerHelperReadingChanged); } #endregion #region Public properties /// <summary> /// Singleton instance of the Shake Gestures Helper class /// </summary> public static ShakeGesturesHelper Instance { get { if (_singletonInstance == null) { lock (_syncRoot) { if (_singletonInstance == null) { _singletonInstance = new ShakeGesturesHelper(); } } } return _singletonInstance; } } /// <summary> /// Accelerometer is active and reading value when true /// </summary> public bool Active { get { return AccelerometerHelper.Instance.Active; } set { AccelerometerHelper.Instance.Active = value; } } public void Simulate(ShakeType shakeType) { bool activePreviousState = Active; ThreadPool.QueueUserWorkItem( (o) => { Active = false; Simulation.CallTo = OnAccelerometerHelperReadingChanged; Thread.Sleep(TimeSpan.FromSeconds(1)); switch (shakeType) { case ShakeType.X: Simulation.SimulateShakeX(); break; case ShakeType.Y: Simulation.SimulateShakeY(); break; case ShakeType.Z: Simulation.SimulateShakeZ(); break; } Simulation.CallTo = null; Active = activePreviousState; }); } #endregion #region Private methods /// <summary> /// Called when the accelerometer provides a new value /// </summary> private void OnAccelerometerHelperReadingChanged(object sender, AccelerometerHelperReadingEventArgs e) { // work with optimal vector (without noise) Simple3DVector currentVector = e.OptimalyFilteredAcceleration; // check if this vector is considered a shake vector bool isShakeMagnitude = (Math.Abs(_lastStillVector.Magnitude - currentVector.Magnitude) > ShakeMagnitudeWithoutGravitationThreshold); // following is a state machine for detection of shake signal start and end // if still --> shake if ((!_isInShakeState) && (isShakeMagnitude)) { // set shake state flag _isInShakeState = true; // clear old shake signal ClearShakeSignal(); // process still signal ProcessStillSignal(); // add vector to shake signal AddVectorToShakeSignal(currentVector); } // if still --> still else if ((!_isInShakeState) && (!isShakeMagnitude)) { // add vector to still signal AddVectorToStillSignal(currentVector); } // if shake --> shake else if ((_isInShakeState) && (isShakeMagnitude)) { // add vector to shake signal AddVectorToShakeSignal(currentVector); // reset still counter _stillCounter = 0; // try to process shake signal if (ProcessShakeSignal()) { // shake signal generated, clear used data ClearShakeSignal(); } } // if shake --> still else if ((_isInShakeState) && (!isShakeMagnitude)) { // add vector to shake signal AddVectorToShakeSignal(currentVector); // count still vectors _stillCounter++; // if too much still samples if (_stillCounter > StillCounterThreshold) { // clear old still signal _stillSignal.Clear(); // add still vectors from shake signal to still signal for (int i = 0; i < StillCounterThreshold; ++i) { // calculate current index element int currentSampleIndex = _shakeSignal.Count - StillCounterThreshold + i; // add vector to still signal AddVectorToStillSignal(currentVector); } // remove last samples from shake signal _shakeSignal.RemoveRange(_shakeSignal.Count - StillCounterThreshold, StillCounterThreshold); // reset shake state flag _isInShakeState = false; _stillCounter = 0; // try to process shake signal if (ProcessShakeSignal()) { ClearShakeSignal(); } } } } private void AddVectorToStillSignal(Simple3DVector currentVector) { // add current vector to still signal, newest vectors are first _stillSignal.AddFirst(currentVector); // if still signal is getting too big, remove old items if (_stillSignal.Count > 2 * MaximumStillVectorsNeededForAverage) { _stillSignal.RemoveLast(); } } /// <summary> /// Add a vector the shake signal and does some preprocessing /// </summary> private void AddVectorToShakeSignal(Simple3DVector currentVector) { // remove still vector from current vector Simple3DVector currentVectorWithoutGravitation = currentVector - _lastStillVector; // add current vector to shake signal _shakeSignal.Add(currentVectorWithoutGravitation); // skip weak vectors if (currentVectorWithoutGravitation.Magnitude < WeakMagnitudeWithoutGravitationThreshold) { return; } // classify vector ShakeType vectorShakeType = ClassifyVectorShakeType(currentVectorWithoutGravitation); // count vector to histogram _shakeHistogram[(int)vectorShakeType]++; } /// <summary> /// Clear shake signal and related data /// </summary> private void ClearShakeSignal() { // clear shake signal _shakeSignal.Clear(); // create empty histogram Array.Clear(_shakeHistogram, 0, _shakeHistogram.Length); } /// <summary> /// Process still signal: calculate average still vector /// </summary> private void ProcessStillSignal() { Simple3DVector sumVector = new Simple3DVector(0, 0, 0); int count = 0; // going over vectors in still signal // still signal was saved backwards, i.e. newest vectors are first foreach (Simple3DVector currentStillVector in _stillSignal) { // make sure current vector is very still bool isStillMagnitude = (Math.Abs(_lastStillVector.Magnitude - currentStillVector.Magnitude) < StillMagnitudeWithoutGravitationThreshold); if (isStillMagnitude) { // sum x,y,z values sumVector += currentStillVector; ++count; // 20 samples are sufficent if (count >= MaximumStillVectorsNeededForAverage) { break; } } } // need at least a few vectors to get a good average if (count >= MinimumStillVectorsNeededForAverage) { // calculate average of still vectors _lastStillVector = sumVector / count; } } /// <summary> /// Classify vector shake type /// </summary> private ShakeType ClassifyVectorShakeType(Simple3DVector v) { double absX = Math.Abs(v.X); double absY = Math.Abs(v.Y); double absZ = Math.Abs(v.Z); // check if X is the most significant component if ((absX >= absY) & (absX >= absZ)) { return ShakeType.X; } // check if Y is the most significant component if ((absY >= absX) & (absY >= absZ)) { return ShakeType.Y; } // Z is the most significant component return ShakeType.Z; } /// <summary> /// Classify shake signal according to shake histogram /// </summary> private bool ProcessShakeSignal() { int xCount = _shakeHistogram[0]; int yCount = _shakeHistogram[1]; int zCount = _shakeHistogram[2]; ShakeType? shakeType = null; // if X part is strongest and above a minimum if ((xCount >= yCount) & (xCount >= zCount) & (xCount >= MinimumShakeVectorsNeededForShake)) { shakeType = ShakeType.X; } // if Y part is strongest and above a minimum else if ((yCount >= xCount) & (yCount >= zCount) & (yCount >= MinimumShakeVectorsNeededForShake)) { shakeType = ShakeType.Y; } // if Z part is strongest and above a minimum else if ((zCount >= xCount) & (zCount >= yCount) & (zCount >= MinimumShakeVectorsNeededForShake)) { shakeType = ShakeType.Z; } if (shakeType != null) { int countSignsChanges = CountSignChanges(shakeType.Value); // check that we have enough shakes if (countSignsChanges < MinimumRequiredMovesForShake) { shakeType = null; } } // if a strong shake was detected if (shakeType != null) { // raise shake gesture event EventHandler<ShakeGestureEventArgs> localShakeGesture = ShakeGesture; if (localShakeGesture != null) { localShakeGesture(this, new ShakeGestureEventArgs(shakeType.Value)); } return true; } return false; } /// <summary> /// Count how many shakes the shake signal contains /// </summary> private int CountSignChanges(ShakeType shakeType) { int countSignsChanges = 0; int currentSign = 0; int? prevSign = null; for (int i = 0; i < _shakeSignal.Count; ++i) { // get sign of current vector switch (shakeType) { case ShakeType.X: currentSign = Math.Sign(_shakeSignal[i].X); break; case ShakeType.Y: currentSign = Math.Sign(_shakeSignal[i].Y); break; case ShakeType.Z: currentSign = Math.Sign(_shakeSignal[i].Z); break; } // skip sign-less vectors if (currentSign == 0) { continue; } // handle sign for first vector if (prevSign == null) { prevSign = currentSign; } // check if sign changed if (currentSign != prevSign) { ++countSignsChanges; } // save previous sign prevSign = currentSign; } return countSignsChanges; } #endregion } }
35.637899
154
0.555357
[ "Apache-2.0" ]
rllibby/SignalR
samples/AskSage.WP8/ShakeGesturesHelper.cs
18,995
C#
using System; namespace FIFOAnimalShelter { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }
15.153846
47
0.502538
[ "MIT" ]
MRefvem/data-structures-and-algorithms
challenges/FIFOAnimalShelter/FIFOAnimalShelter/Program.cs
199
C#
using System; namespace NetworkProtocols { // Token: 0x020005B4 RID: 1460 public class GuildRegexPattern { // Token: 0x060032C3 RID: 12995 RVA: 0x0001B57A File Offset: 0x0001977A public GuildRegexPattern() { this.InitRefTypes(); } // Token: 0x170005F9 RID: 1529 // (get) Token: 0x060032C4 RID: 12996 RVA: 0x0001B588 File Offset: 0x00019788 // (set) Token: 0x060032C5 RID: 12997 RVA: 0x0001B590 File Offset: 0x00019790 public string Pattern { get; set; } // Token: 0x170005FA RID: 1530 // (get) Token: 0x060032C6 RID: 12998 RVA: 0x0001B599 File Offset: 0x00019799 // (set) Token: 0x060032C7 RID: 12999 RVA: 0x0001B5A1 File Offset: 0x000197A1 public eGuildOperationStatus FailureStatus { get; set; } // Token: 0x170005FB RID: 1531 // (get) Token: 0x060032C8 RID: 13000 RVA: 0x0001B5AA File Offset: 0x000197AA // (set) Token: 0x060032C9 RID: 13001 RVA: 0x0001B5B2 File Offset: 0x000197B2 public string LocalizationKey { get; set; } // Token: 0x060032CA RID: 13002 RVA: 0x00105868 File Offset: 0x00103A68 public byte[] SerializeMessage() { byte[] newArray = ArrayManager.GetNewArray(); int newSize = 0; ArrayManager.WriteString(ref newArray, ref newSize, this.Pattern); ArrayManager.WriteeGuildOperationStatus(ref newArray, ref newSize, this.FailureStatus); ArrayManager.WriteString(ref newArray, ref newSize, this.LocalizationKey); Array.Resize<byte>(ref newArray, newSize); return newArray; } // Token: 0x060032CB RID: 13003 RVA: 0x001058B4 File Offset: 0x00103AB4 public void DeserializeMessage(byte[] data) { int num = 0; this.Pattern = ArrayManager.ReadString(data, ref num); this.FailureStatus = ArrayManager.ReadeGuildOperationStatus(data, ref num); this.LocalizationKey = ArrayManager.ReadString(data, ref num); } // Token: 0x060032CC RID: 13004 RVA: 0x0001B5BB File Offset: 0x000197BB private void InitRefTypes() { this.Pattern = string.Empty; this.FailureStatus = eGuildOperationStatus.None; this.LocalizationKey = string.Empty; } } }
35.79661
91
0.712121
[ "Unlicense" ]
PermaNulled/OMDUC_EMU_CSharp
OMDUC_EMU/NetworkProtocols/GuildRegexPattern.cs
2,114
C#
// Copyright (c) 2017 Ubisoft Entertainment // // 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.Concurrent; using System.Collections.Generic; using System.Reflection; namespace Sharpmake { public static partial class Options { private const string RemoveLineTag = "REMOVE_LINE_TAG"; [Flags] public enum DefaultTarget { Debug = 0x01, Release = 0x02, All = Debug | Release } public abstract class StringOption { public static string Get<T>(Project.Configuration conf) where T : StringOption { var option = Options.GetObject<T>(conf); if (option == null) { var defaultValue = typeof(T).GetField("Default", BindingFlags.Static); return defaultValue != null ? (defaultValue.GetValue(null) as string) : RemoveLineTag; } return option.Value; } protected StringOption(string value) { Value = value; } public string Value { get; } } /// <summary> /// Used to hold an option that's a path, either to a file or directory, that's gonna be resolved /// </summary> public abstract class PathOption { public static string Get<T>(Project.Configuration conf, string fallback = RemoveLineTag) where T : PathOption { var option = Options.GetObject<T>(conf); if (option == null) return fallback; return option.Path; } protected PathOption(string path) { Path = path; } public string Path; } public abstract class IntOption { public static string Get<T>(Project.Configuration conf) where T : IntOption { var option = GetObject<T>(conf); return option != null ? option.Value.ToString() : RemoveLineTag; } protected IntOption(int value) { Value = value; } public int Value { get; } } public class ExplicitOptions : Dictionary<string, string> { public Strings ExplicitDefines = new Strings(); } #region Private [System.AttributeUsage(AttributeTargets.Field)] public class Default : Attribute { public DefaultTarget DefaultTarget { get; set; } public Default() { DefaultTarget = DefaultTarget.All; } public Default(DefaultTarget defaultValue) { DefaultTarget = defaultValue; } } [System.AttributeUsage(AttributeTargets.Field)] public class DevEnvVersion : Attribute { public DevEnv minimum { get; set; } public DevEnvVersion() { minimum = DevEnv.vs2010; } } public class OptionAction { public object Value; public Action Action; public OptionAction(object value, Action action) { Value = value; Action = action; } } public static OptionAction Option(object value, Action action) { return new OptionAction(value, action); } public static OptionAction Option(object value) { return new OptionAction(value, () => { }); } private static ConcurrentDictionary<FieldInfo, object[]> s_cachedDefaultAttributes = new ConcurrentDictionary<FieldInfo, object[]>(); private static ConcurrentDictionary<FieldInfo, object[]> s_cachedDevEnvAttributes = new ConcurrentDictionary<FieldInfo, object[]>(); public static void SelectOption(Configuration conf, params OptionAction[] options) { SelectOptionImpl(true, conf, options); } public static void SelectOptionWithFallback(Configuration conf, Action fallbackAction, params OptionAction[] options) { if (!SelectOptionImpl(false, conf, options)) fallbackAction(); } private static bool SelectOptionImpl(bool throwIfNotFound, Configuration conf, OptionAction[] options) { // Get the type of current options and make sure they are all off the same type Type optionType = null; foreach (OptionAction optionAction in options) { if (optionType == null) optionType = optionAction.Value.GetType(); else if (optionType != optionAction.Value.GetType()) throw new Error("SelectOption may only be called of value of the same type"); } if (optionType == null) throw new Error(); FieldInfo[] optionTypeFields = optionType.GetFields(); // find the latest added option of this type for (int i = conf.Options.Count - 1; i >= 0; i--) { object latestOption = conf.Options[i]; if (latestOption.GetType() == optionType) { foreach (FieldInfo field in optionTypeFields) { if (field.FieldType != optionType) continue; object fieldValue = field.GetValue(optionType); if (fieldValue.Equals(latestOption)) { object[] attributes = s_cachedDevEnvAttributes.GetOrAdd(field, fi => fi.GetCustomAttributes(typeof(Options.DevEnvVersion), true)); foreach (Options.DevEnvVersion version in attributes) { if (version.minimum > conf.Compiler) throw new Error(optionType + " " + latestOption + " is not compatible with your DevEnv (" + conf.Compiler + ")"); } break; } } foreach (OptionAction optionAction in options) { if (optionAction.Value.Equals(latestOption)) { optionAction.Action(); return true; } } } } // find the default options foreach (FieldInfo field in optionTypeFields) { object[] attributes = s_cachedDefaultAttributes.GetOrAdd(field, fi => fi.GetCustomAttributes(typeof(Options.Default), true)); foreach (Options.Default defaultOption in attributes) { if (Util.FlagsTest(defaultOption.DefaultTarget, conf.DefaultOption)) { object fieldValue = field.GetValue(optionType); foreach (OptionAction optionAction in options) { if (optionAction.Value.Equals(fieldValue)) { optionAction.Action(); return true; } } } } } if (throwIfNotFound) throw new Error("Not default value found for options: " + optionType.Name + " Default Options is " + conf.DefaultOption); return false; } public static T GetObject<T>(Configuration conf) { return GetObject<T>(conf.Options, conf.DefaultOption); } public static T GetObject<T>(List<Object> options, DefaultTarget defaultTarget) { for (int i = options.Count - 1; i >= 0; --i) { object option = options[i]; if (option is T) { return (T)option; } } // no found, return the default Type optionType = typeof(T); // for class type , default value is NULL; if (optionType.IsClass) return default(T); // find the default options FieldInfo[] optionTypeFields = optionType.GetFields(); foreach (FieldInfo field in optionTypeFields) { object[] attributes = s_cachedDefaultAttributes.GetOrAdd(field, fi => fi.GetCustomAttributes(typeof(Options.Default), true)); foreach (Default defaultOption in attributes) { if (Util.FlagsTest(defaultOption.DefaultTarget, defaultTarget)) { object fieldValue = field.GetValue(optionType); return (T)fieldValue; } } } throw new Error("Not default value found for options: " + optionType.Name + " Default Options is " + options); } public static IEnumerable<T> GetObjects<T>(Configuration conf) { for (int i = conf.Options.Count - 1; i >= 0; --i) { object option = conf.Options[i]; if (option != null && option.GetType() == typeof(T)) { yield return (T)option; } } } public static Strings GetStrings<T>(Configuration conf) where T : Strings { List<object> options = conf.Options; Strings values = new Strings(); for (int i = options.Count - 1; i >= 0; --i) { Strings option = options[i] as Strings; if (option is T) { values.AddRange(option); } } return values; } public static string GetString<T>(Configuration conf) where T : StringOption { List<object> options = conf.Options; for (int i = options.Count - 1; i >= 0; --i) { string option = options[i] as string; if (option is T) { return option; } } return string.Empty; } #endregion } }
33.876877
158
0.502349
[ "Apache-2.0" ]
MSDjango/Sharpmake
Sharpmake/Options.cs
11,283
C#
#if !UNITY_WINRT || UNITY_EDITOR || UNITY_WP8 #region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion namespace Newtonsoft.Json.Schema { /// <summary> /// Specifies undefined schema Id handling options for the <see cref="JsonSchemaGenerator"/>. /// </summary> public enum UndefinedSchemaIdHandling { /// <summary> /// Do not infer a schema Id. /// </summary> None = 0, /// <summary> /// Use the .NET type name as the schema Id. /// </summary> UseTypeName = 1, /// <summary> /// Use the assembly qualified .NET type name as the schema Id. /// </summary> UseAssemblyQualifiedName = 2, } } #endif
36.4375
95
0.712979
[ "MIT" ]
NNRepos/django-unity3d-example
Unity/Assets/Scripts/JsonDotNet/Source/Schema/UndefinedSchemaIdHandling.cs
1,749
C#
using FreeSql.Internal; using FreeSql.Internal.Model; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace FreeSql.PostgreSQL.Curd { class PostgreSQLSelect<T1> : FreeSql.Internal.CommonProvider.Select1Provider<T1> where T1 : class { internal static string ToSqlStatic(CommonUtils _commonUtils, CommonExpression _commonExpression, string _select, bool _distinct, string field, StringBuilder _join, StringBuilder _where, string _groupby, string _having, string _orderby, int _skip, int _limit, List<SelectTableInfo> _tables, List<Dictionary<Type, string>> tbUnions, Func<Type, string, string> _aliasRule, string _tosqlAppendContent, List<GlobalFilter.Item> _whereGlobalFilter, IFreeSql _orm) { if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(_tables.Select(a => a.Table.Type).ToArray()); if (_whereGlobalFilter.Any()) foreach (var tb in _tables.Where(a => a.Type != SelectTableInfoType.Parent)) tb.Cascade = _commonExpression.GetWhereCascadeSql(tb, _whereGlobalFilter, true); var sb = new StringBuilder(); var tbUnionsGt0 = tbUnions.Count > 1; for (var tbUnionsIdx = 0; tbUnionsIdx < tbUnions.Count; tbUnionsIdx++) { if (tbUnionsIdx > 0) sb.Append("\r\n \r\nUNION ALL\r\n \r\n"); if (tbUnionsGt0) sb.Append(_select).Append(" * from ("); var tbUnion = tbUnions[tbUnionsIdx]; var sbnav = new StringBuilder(); sb.Append(_select); if (_distinct) sb.Append("DISTINCT "); sb.Append(field).Append(" \r\nFROM "); var tbsjoin = _tables.Where(a => a.Type != SelectTableInfoType.From).ToArray(); var tbsfrom = _tables.Where(a => a.Type == SelectTableInfoType.From).ToArray(); for (var a = 0; a < tbsfrom.Length; a++) { sb.Append(_commonUtils.QuoteSqlName(tbUnion[tbsfrom[a].Table.Type])).Append(" ").Append(_aliasRule?.Invoke(tbsfrom[a].Table.Type, tbsfrom[a].Alias) ?? tbsfrom[a].Alias); if (tbsjoin.Length > 0) { //如果存在 join 查询,则处理 from t1, t2 改为 from t1 inner join t2 on 1 = 1 for (var b = 1; b < tbsfrom.Length; b++) { sb.Append(" \r\nLEFT JOIN ").Append(_commonUtils.QuoteSqlName(tbUnion[tbsfrom[b].Table.Type])).Append(" ").Append(_aliasRule?.Invoke(tbsfrom[b].Table.Type, tbsfrom[b].Alias) ?? tbsfrom[b].Alias); if (string.IsNullOrEmpty(tbsfrom[b].NavigateCondition) && string.IsNullOrEmpty(tbsfrom[b].On) && string.IsNullOrEmpty(tbsfrom[b].Cascade)) sb.Append(" ON 1 = 1"); else { var onSql = tbsfrom[b].NavigateCondition ?? tbsfrom[b].On; sb.Append(" ON ").Append(onSql); if (string.IsNullOrEmpty(tbsfrom[b].Cascade) == false) { if (string.IsNullOrEmpty(onSql)) sb.Append(tbsfrom[b].Cascade); else sb.Append(" AND ").Append(tbsfrom[b].Cascade); } } } break; } else { if (!string.IsNullOrEmpty(tbsfrom[a].NavigateCondition)) sbnav.Append(" AND (").Append(tbsfrom[a].NavigateCondition).Append(")"); if (!string.IsNullOrEmpty(tbsfrom[a].On)) sbnav.Append(" AND (").Append(tbsfrom[a].On).Append(")"); if (a > 0 && !string.IsNullOrEmpty(tbsfrom[a].Cascade)) sbnav.Append(" AND ").Append(tbsfrom[a].Cascade); } if (a < tbsfrom.Length - 1) sb.Append(", "); } foreach (var tb in tbsjoin) { if (tb.Type == SelectTableInfoType.Parent) continue; switch (tb.Type) { case SelectTableInfoType.LeftJoin: sb.Append(" \r\nLEFT JOIN "); break; case SelectTableInfoType.InnerJoin: sb.Append(" \r\nINNER JOIN "); break; case SelectTableInfoType.RightJoin: sb.Append(" \r\nRIGHT JOIN "); break; } sb.Append(_commonUtils.QuoteSqlName(tbUnion[tb.Table.Type])).Append(" ").Append(_aliasRule?.Invoke(tb.Table.Type, tb.Alias) ?? tb.Alias).Append(" ON ").Append(tb.On ?? tb.NavigateCondition); if (!string.IsNullOrEmpty(tb.Cascade)) sb.Append(" AND ").Append(tb.Cascade); if (!string.IsNullOrEmpty(tb.On) && !string.IsNullOrEmpty(tb.NavigateCondition)) sbnav.Append(" AND (").Append(tb.NavigateCondition).Append(")"); } if (_join.Length > 0) sb.Append(_join); sbnav.Append(_where); if (!string.IsNullOrEmpty(_tables[0].Cascade)) sbnav.Append(" AND ").Append(_tables[0].Cascade); if (sbnav.Length > 0) { sb.Append(" \r\nWHERE ").Append(sbnav.Remove(0, 5)); } if (string.IsNullOrEmpty(_groupby) == false) { sb.Append(_groupby); if (string.IsNullOrEmpty(_having) == false) sb.Append(" \r\nHAVING ").Append(_having.Substring(5)); } sb.Append(_orderby); if (_limit > 0) sb.Append(" \r\nlimit ").Append(_limit); if (_skip > 0) sb.Append(" \r\noffset ").Append(_skip); sbnav.Clear(); if (tbUnionsGt0) sb.Append(") ftb"); } return sb.Append(_tosqlAppendContent).ToString(); } public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override ISelect<T1, T2> From<T2>(Expression<Func<ISelectFromExpression<T1>, T2, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3> From<T2, T3>(Expression<Func<ISelectFromExpression<T1>, T2, T3, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4> From<T2, T3, T4>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5> From<T2, T3, T4, T5>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6> From<T2, T3, T4, T5, T6>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7> From<T2, T3, T4, T5, T6, T7>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8> From<T2, T3, T4, T5, T6, T7, T8>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> From<T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> From<T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> From<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Expression<Func<ISelectFromExpression<T1>, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, ISelectFromExpression<T1>>> exp) { this.InternalFrom(exp); var ret = new PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(_orm, _commonUtils, _commonExpression, null); PostgreSQLSelect<T1>.CopyData(this, ret, exp?.Parameters); return ret; } public override string ToSql(string field = null) => ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2> : FreeSql.Internal.CommonProvider.Select2Provider<T1, T2> where T1 : class where T2 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3> : FreeSql.Internal.CommonProvider.Select3Provider<T1, T2, T3> where T1 : class where T2 : class where T3 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4> : FreeSql.Internal.CommonProvider.Select4Provider<T1, T2, T3, T4> where T1 : class where T2 : class where T3 : class where T4 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5> : FreeSql.Internal.CommonProvider.Select5Provider<T1, T2, T3, T4, T5> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6> : FreeSql.Internal.CommonProvider.Select6Provider<T1, T2, T3, T4, T5, T6> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7> : FreeSql.Internal.CommonProvider.Select7Provider<T1, T2, T3, T4, T5, T6, T7> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8> : FreeSql.Internal.CommonProvider.Select8Provider<T1, T2, T3, T4, T5, T6, T7, T8> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> : FreeSql.Internal.CommonProvider.Select9Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : FreeSql.Internal.CommonProvider.Select10Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : FreeSql.Internal.CommonProvider.Select11Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : FreeSql.Internal.CommonProvider.Select12Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : FreeSql.Internal.CommonProvider.Select13Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : FreeSql.Internal.CommonProvider.Select14Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : FreeSql.Internal.CommonProvider.Select15Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } class PostgreSQLSelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : FreeSql.Internal.CommonProvider.Select16Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class where T16 : class { public PostgreSQLSelect(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere) { } public override string ToSql(string field = null) => PostgreSQLSelect<T1>.ToSqlStatic(_commonUtils, _commonExpression, _select, _distinct, field ?? this.GetAllFieldExpressionTreeLevel2().Field, _join, _where, _groupby, _having, _orderby, _skip, _limit, _tables, this.GetTableRuleUnions(), _aliasRule, _tosqlAppendContent, _whereGlobalFilter, _orm); } }
122.915493
564
0.677591
[ "MIT" ]
Dbo-Kt69/FreeSql
Providers/FreeSql.Provider.PostgreSQL/Curd/PostgreSQLSelect.cs
26,207
C#
<<<<<<< HEAD using Microsoft.EntityFrameworkCore; using SkiResort.Data; using SkiResort.Data.Models; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using Console = Colorful.Console; ======= using SkiResort.Data; using SkiResort.Data.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da namespace SkiResort.Business { public class LiftController { public SkiResortContext liftContext; public LiftController() { this.liftContext = new SkiResortContext(); } public LiftController(SkiResortContext context) { <<<<<<< HEAD this.liftContext = context; ======= this.liftContext = context; >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da } /// <summary> /// Gives all lifts from database. /// </summary> <<<<<<< HEAD /// <returns> /// a list of all hikes /// </returns> ======= /// <returns>List of all hikes</returns> >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da public List<Lift> GetAll() { return liftContext.Lifts.ToList(); } /// <summary> /// Gives a lift from database by id. /// </summary> public Lift Get(int id) { <<<<<<< HEAD var lift = new Lift(); try { lift = this.liftContext.Lifts.First(x => x.Id == id); } catch (InvalidOperationException e) { Console.WriteLine("Invalid id!", e, Color.Pink); } ======= var lift = this.liftContext.Lifts.FirstOrDefault(x => x.Id == id); >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da return lift; } /// <summary> <<<<<<< HEAD /// Adds a lift. ======= /// Adds a lift in database. >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da /// </summary> public void Add(Lift lift) { this.liftContext.Lifts.Add(lift); this.liftContext.SaveChanges(); } /// <summary> /// Deletes a lift from the database. /// </summary> public void Delete(int id) { var lift = this.Get(id); this.liftContext.Lifts.Remove(lift); this.liftContext.SaveChanges(); } } <<<<<<< HEAD } ======= } >>>>>>> 5b8a688afb28000f9d15563c0ade89958f34d7da
23.796296
78
0.551751
[ "MIT" ]
elitam/SkiResort
SkiResort/SkiResort/Business/LiftController.cs
2,574
C#
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; namespace Microsoft.VisualStudio.ComponentModelHost { public interface SComponentModel { } }
25.416667
103
0.780328
[ "MIT" ]
Plankankul/SharpDevelop-w-Framework
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/SComponentModel.cs
307
C#
using System; using System.Collections.Generic; namespace RestSharp.Tests.SampleClasses { public class VenueSearch { public string total_items { get; set; } public string page_size { get; set; } public string page_count { get; set; } public string page_number { get; set; } public string page_items { get; set; } public string first_item { get; set; } public string last_item { get; set; } public string search_time { get; set; } public List<Venue> venues { get; set; } } public class PerformerSearch { public string total_items { get; set; } public string page_size { get; set; } public string page_count { get; set; } public string page_number { get; set; } public string page_items { get; set; } public string first_item { get; set; } public string last_item { get; set; } public string search_time { get; set; } public List<Performer> performers { get; set; } } public class Performer { public string id { get; set; } public string url { get; set; } public string name { get; set; } public string short_bio { get; set; } public DateTime? created { get; set; } public string creator { get; set; } public string demand_count { get; set; } public string demand_member_count { get; set; } public string event_count { get; set; } public ServiceImage image { get; set; } } public class Venue { public string id { get; set; } public string url { get; set; } public string name { get; set; } public string venue_name { get; set; } public string description { get; set; } public string venue_type { get; set; } public string address { get; set; } public string city_name { get; set; } public string region_name { get; set; } public string postal_code { get; set; } public string country_name { get; set; } public string longitude { get; set; } public string latitude { get; set; } public string event_count { get; set; } } public class ServiceImage { public ServiceImage1 thumb { get; set; } public ServiceImage1 small { get; set; } public ServiceImage1 medium { get; set; } } public class ServiceImage1 { public string url { get; set; } public string width { get; set; } public string height { get; set; } } public class Event { public string id { get; set; } public string url { get; set; } public string title { get; set; } public string description { get; set; } public string start_time { get; set; } public string venue_name { get; set; } public string venue_id { get; set; } public List<Performer> performers { get; set; } } }
21.71223
55
0.576872
[ "Apache-2.0" ]
284171004/RestSharp
RestSharp.Tests/SampleClasses/eventful.cs
3,020
C#
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. using System; using System.Xml.Linq; using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Observable; using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility; namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration { /// <summary> /// Represents a flat file configuration element that can create an instance of a flat file sink. /// </summary> internal class FlatFileSinkElement : ISinkElement { private readonly XName sinkName = XName.Get("flatFileSink", Constants.Namespace); /// <summary> /// Determines whether this instance can create the specified configuration element. /// </summary> /// <param name="element">The configuration element.</param> /// <returns> /// <c>True</c> if this instance can create the specified element; otherwise, <c>false</c>. /// </returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with Guard class")] public bool CanCreateSink(XElement element) { Guard.ArgumentNotNull(element, "element"); return element.Name == this.sinkName; } /// <summary> /// Creates the <see cref="IObserver{EventEntry}" /> instance for this sink. /// </summary> /// <param name="element">The configuration element.</param> /// <returns> /// The sink instance. /// </returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with Guard class")] public IObserver<EventEntry> CreateSink(XElement element) { Guard.ArgumentNotNull(element, "element"); var subject = new EventEntrySubject(); subject.LogToFlatFile((string)element.Attribute("fileName"), FormatterElementFactory.Get(element)); return subject; } } }
43.96
187
0.669245
[ "Apache-2.0" ]
Meetsch/semantic-logging
source/Src/SemanticLogging.TextFile/Configuration/FlatFileSinkElement.cs
2,200
C#
namespace SistemaVendas.Apresentacao.ControlesUsuario { partial class Controle_Config { /// <summary> /// Variável de designer necessária. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Limpar os recursos que estão sendo usados. /// </summary> /// <param name="disposing">true se for necessário descartar os recursos gerenciados; caso contrário, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Código gerado pelo Designer de Componentes /// <summary> /// Método necessário para suporte ao Designer - não modifique /// o conteúdo deste método com o editor de código. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Controle_Config)); this.btnBackup = new System.Windows.Forms.Button(); this.btnRestaurar = new System.Windows.Forms.Button(); this.btnAjuda = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnBackup // this.btnBackup.Cursor = System.Windows.Forms.Cursors.Hand; this.btnBackup.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBackup.Font = new System.Drawing.Font("Century Gothic", 8F); this.btnBackup.Image = ((System.Drawing.Image)(resources.GetObject("btnBackup.Image"))); this.btnBackup.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnBackup.Location = new System.Drawing.Point(41, 41); this.btnBackup.Name = "btnBackup"; this.btnBackup.Size = new System.Drawing.Size(93, 111); this.btnBackup.TabIndex = 14; this.btnBackup.Text = "Gerar Backup"; this.btnBackup.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.btnBackup.UseVisualStyleBackColor = true; this.btnBackup.Click += new System.EventHandler(this.btnBackup_Click); // // btnRestaurar // this.btnRestaurar.Cursor = System.Windows.Forms.Cursors.Hand; this.btnRestaurar.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRestaurar.Font = new System.Drawing.Font("Century Gothic", 8F); this.btnRestaurar.Image = ((System.Drawing.Image)(resources.GetObject("btnRestaurar.Image"))); this.btnRestaurar.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnRestaurar.Location = new System.Drawing.Point(190, 41); this.btnRestaurar.Name = "btnRestaurar"; this.btnRestaurar.Size = new System.Drawing.Size(93, 111); this.btnRestaurar.TabIndex = 15; this.btnRestaurar.Text = "Restaurar Backup"; this.btnRestaurar.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.btnRestaurar.UseVisualStyleBackColor = true; this.btnRestaurar.Click += new System.EventHandler(this.btnRestaurar_Click); // // btnAjuda // this.btnAjuda.BackColor = System.Drawing.Color.Transparent; this.btnAjuda.Cursor = System.Windows.Forms.Cursors.Hand; this.btnAjuda.FlatAppearance.BorderSize = 0; this.btnAjuda.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAjuda.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnAjuda.ForeColor = System.Drawing.Color.Transparent; this.btnAjuda.Image = ((System.Drawing.Image)(resources.GetObject("btnAjuda.Image"))); this.btnAjuda.Location = new System.Drawing.Point(644, 0); this.btnAjuda.Margin = new System.Windows.Forms.Padding(0); this.btnAjuda.Name = "btnAjuda"; this.btnAjuda.Size = new System.Drawing.Size(34, 29); this.btnAjuda.TabIndex = 16; this.btnAjuda.UseVisualStyleBackColor = false; this.btnAjuda.Click += new System.EventHandler(this.btnAjuda_Click); // // Controle_Config // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.btnAjuda); this.Controls.Add(this.btnRestaurar); this.Controls.Add(this.btnBackup); this.Name = "Controle_Config"; this.Size = new System.Drawing.Size(678, 369); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button btnBackup; private System.Windows.Forms.Button btnRestaurar; private System.Windows.Forms.Button btnAjuda; } }
49.009434
170
0.626179
[ "MIT" ]
lucasestevan/SistemaVendasC-
SistemaVendas/SistemaVendas/Apresentacao/ControlesUsuario/Controle_Config.Designer.cs
5,209
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class MenuScript : MonoBehaviour { public void buttonPlay() { SceneManager.LoadScene(0); } public void buttonCredits() { SceneManager.LoadScene(1); } public void buttonQuit() { Debug.Log("Quit Game"); Application.Quit(); } }
17.375
39
0.647482
[ "MIT" ]
johnklima/SkyPortal
Assets/Member Scenes/Thomas/TESTING/MenuScript.cs
417
C#
//////////////////////////////////////////////////////////////////////// // // This file is part of pdn-ddsfiletype-plus, a DDS FileType plugin // for Paint.NET that adds support for the DX10 and later formats. // // Copyright (c) 2017-2021 Nicholas Hayes // // This file is licensed under the MIT License. // See LICENSE.txt for complete licensing and attribution information. // //////////////////////////////////////////////////////////////////////// namespace DdsFileTypePlus { internal interface IDdsStringResourceManager { string GetString(string name); } }
29.3
73
0.544369
[ "MIT" ]
0xC0000054/pdn-ddsfiletype-plus
Localization/IDdsStringResourceManager.cs
588
C#
using System.Threading; using System.Threading.Tasks; using MediatR; using SvishtovHighSchool.Domain; using SvishtovHighSchool.Domain.CourseModule; using SvishtovHighSchool.Domain.CourseModule.Commands; namespace SvishtovHighSchool.Application.Handlers.Course { public class CourseCreatorHandler : INotificationHandler<CreateCourseCommand> { private readonly IDomainRepository<Domain.CourseModule.Course> _domainRepository; public CourseCreatorHandler(IDomainRepository<Domain.CourseModule.Course> domainRepository) { _domainRepository = domainRepository; } public async Task Handle(CreateCourseCommand notification, CancellationToken cancellationToken) { var course = new Domain.CourseModule.Course(notification.Name); // TODO think a better way to handle version of events course.Version = -1; await _domainRepository.SaveAsync(course, -1); } } }
35.035714
103
0.732926
[ "MIT" ]
chunk1ty/svishtov-high-school
src/SvishtovHighSchool.Application/Handlers/Course/CourseCreatorHandler.cs
983
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Data.Entity; namespace AllReady.Models { public partial class AllReadyDataAccessEF7 : IAllReadyDataAccess { IEnumerable<AllReadyTask> IAllReadyDataAccess.Tasks { get { return _dbContext.Tasks .Include(x => x.Tenant) .Include(x => x.Activity) .Include(x => x.Activity.Campaign) .Include(x => x.AssignedVolunteers) .Include(x => x.RequiredSkills) .ToList(); } } AllReadyTask IAllReadyDataAccess.GetTask(int taskId, string userId) { var taskUser = _dbContext.TaskSignups.Where(tu => tu.User.Id == userId).SingleOrDefault(); return taskUser == null ? null : _dbContext.Tasks .Include(x => x.Tenant) .Include(x => x.Activity) .Include(x => x.Activity.Campaign) .Include(x => x.AssignedVolunteers) .Where(t => t.Id == taskId && t.AssignedVolunteers.Contains(taskUser)).SingleOrDefault(); } AllReadyTask IAllReadyDataAccess.GetTask(int taskId) { return _dbContext.Tasks .Include(x => x.Tenant) .Include(x => x.Activity) .Include(x => x.Activity.Campaign) .Include(x => x.AssignedVolunteers).ThenInclude(v => v.User) .Include(x => x.RequiredSkills) .Where(t => t.Id == taskId).SingleOrDefault(); } Task IAllReadyDataAccess.AddTaskAsync(AllReadyTask task) { if (task.Id == 0) { _dbContext.Add(task); return _dbContext.SaveChangesAsync(); } else throw new InvalidOperationException("Added task that already has Id"); } Task IAllReadyDataAccess.DeleteTaskAsync(int taskId) { var toDelete = _dbContext.Tasks.Where(t => t.Id == taskId).SingleOrDefault(); if (toDelete != null) { _dbContext.Tasks.Remove(toDelete); return _dbContext.SaveChangesAsync(); } return null; } Task IAllReadyDataAccess.UpdateTaskAsync(AllReadyTask value) { //First remove any skills that are no longer associated with this task var tsToRemove = _dbContext.TaskSkills.Where(ts => ts.TaskId == value.Id && (value.RequiredSkills == null || !value.RequiredSkills.Any(ts1 => ts1.SkillId == ts.SkillId))); _dbContext.TaskSkills.RemoveRange(tsToRemove); _dbContext.Tasks.Update(value); return _dbContext.SaveChangesAsync(); } } }
35.060241
120
0.548454
[ "MIT" ]
JesseLiberty/allReady
AllReadyApp/Web-App/AllReady/DataAccess/AllReadyDataAccessEF7.Task.cs
2,912
C#
using Imagin.Common.Configuration; using System; using System.Windows.Media; namespace Clock { public partial class App : SingleApplication { public override ApplicationProperties Properties => new ApplicationProperties<MainWindow, MainViewModel, Options>(); [STAThread] public static void Main(params string[] arguments) { if (SingleInstance<App>.InitializeAsFirstInstance(nameof(Clock))) { var App = new App(); App.InitializeComponent(); App.Run(); SingleInstance<App>.Cleanup(); } } } }
28
124
0.596273
[ "BSD-2-Clause" ]
fritzmark/Imagin.NET
Apps.Clock/App.xaml.cs
646
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 sagemaker-2017-07-24.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.SageMaker.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.SageMaker.Model.Internal.MarshallTransformations { /// <summary> /// CreateHyperParameterTuningJob Request Marshaller /// </summary> public class CreateHyperParameterTuningJobRequestMarshaller : IMarshaller<IRequest, CreateHyperParameterTuningJobRequest> , 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((CreateHyperParameterTuningJobRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateHyperParameterTuningJobRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.SageMaker"); string target = "SageMaker.CreateHyperParameterTuningJob"; request.Headers["X-Amz-Target"] = target; request.Headers["Content-Type"] = "application/x-amz-json-1.1"; request.HttpMethod = "POST"; string uriResourcePath = "/"; 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.IsSetHyperParameterTuningJobConfig()) { context.Writer.WritePropertyName("HyperParameterTuningJobConfig"); context.Writer.WriteObjectStart(); var marshaller = HyperParameterTuningJobConfigMarshaller.Instance; marshaller.Marshall(publicRequest.HyperParameterTuningJobConfig, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetHyperParameterTuningJobName()) { context.Writer.WritePropertyName("HyperParameterTuningJobName"); context.Writer.Write(publicRequest.HyperParameterTuningJobName); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("Tags"); context.Writer.WriteArrayStart(); foreach(var publicRequestTagsListValue in publicRequest.Tags) { context.Writer.WriteObjectStart(); var marshaller = TagMarshaller.Instance; marshaller.Marshall(publicRequestTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetTrainingJobDefinition()) { context.Writer.WritePropertyName("TrainingJobDefinition"); context.Writer.WriteObjectStart(); var marshaller = HyperParameterTrainingJobDefinitionMarshaller.Instance; marshaller.Marshall(publicRequest.TrainingJobDefinition, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetWarmStartConfig()) { context.Writer.WritePropertyName("WarmStartConfig"); context.Writer.WriteObjectStart(); var marshaller = HyperParameterTuningJobWarmStartConfigMarshaller.Instance; marshaller.Marshall(publicRequest.WarmStartConfig, context); context.Writer.WriteObjectEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateHyperParameterTuningJobRequestMarshaller _instance = new CreateHyperParameterTuningJobRequestMarshaller(); internal static CreateHyperParameterTuningJobRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateHyperParameterTuningJobRequestMarshaller Instance { get { return _instance; } } } }
38.24183
173
0.61545
[ "Apache-2.0" ]
DalavanCloud/aws-sdk-net
sdk/src/Services/SageMaker/Generated/Model/Internal/MarshallTransformations/CreateHyperParameterTuningJobRequestMarshaller.cs
5,851
C#
namespace Source { public interface IMediaItemQuery { string SearchString { get; set; } string UniqueIdentifier { get; set; } } }
17.666667
45
0.610063
[ "MIT" ]
DotNetBootCamp/.NetGenerics
Source/IMediaItemQuery.cs
161
C#
// Copyright 2004-2010 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace Castle.Components.Pagination { using System; using System.Collections; using System.Collections.Generic; /// <summary> /// Abstract implementation of <see cref="IPaginatedPage"/> which performs the standard calculations /// on <see cref="CalculatePaginationInfo"/>. /// </summary> [Serializable] public abstract class AbstractPage : IPaginatedPage { private int firstItemIndex, lastItemIndex, totalItems, pageSize, currentPageSize; private int previousPageIndex, nextPageIndex, lastPageIndex, currentPageIndex; private bool hasPreviousPage, hasNextPage; /// <summary> /// Calculate the values of all properties based on the specified parameters. /// </summary> /// <param name="startIndex">Start index</param> /// <param name="endIndex">Last index</param> /// <param name="count">Total of elements</param> /// <param name="pageSize">Page size</param> /// <param name="currentPage">This page index</param> protected void CalculatePaginationInfo(int startIndex, int endIndex, int count, int pageSize, int currentPage) { firstItemIndex = count != 0 ? startIndex + 1 : 0; lastItemIndex = endIndex; totalItems = count; currentPageIndex = currentPage; previousPageIndex = currentPage - 1; nextPageIndex = currentPage + 1; lastPageIndex = count == -1 ? -1 : count / pageSize; hasPreviousPage = currentPageIndex > 1; currentPageSize = count > 0 ? endIndex - startIndex : 0; this.pageSize = pageSize; if (count != -1 && count / (float) pageSize > lastPageIndex) { lastPageIndex++; } hasNextPage = count == -1 || currentPageIndex < lastPageIndex; } public int CurrentPageIndex { get { return currentPageIndex; } } public int PreviousPageIndex { get { return previousPageIndex; } } public int NextPageIndex { get { return nextPageIndex; } } public int FirstItemIndex { get { return firstItemIndex; } } public int LastItemIndex { get { return lastItemIndex; } } public int TotalItems { get { return totalItems; } } public int PageSize { get { return pageSize; } } public bool HasPreviousPage { get { return hasPreviousPage; } } public bool HasNextPage { get { return hasNextPage; } } public bool HasPage(int pageNumber) { return pageNumber <= lastPageIndex && pageNumber >= 1; } public int TotalPages { get { return lastPageIndex; } } public int CurrentPageSize { get { return currentPageSize; } } /// <summary> /// Returns a enumerator for the contents of this page only (not the whole set). /// </summary> /// <returns>Enumerator instance.</returns> IEnumerator IEnumerable.GetEnumerator() { return GetEnumeratorImplementation(); } object IPaginatedPage.FirstItem { get { return GetItemAtIndex(firstItemIndex - 1); } } object IPaginatedPage.LastItem { get { return GetItemAtIndex(lastItemIndex - 1); } } /// <summary> /// should be overrided /// </summary> /// <returns></returns> protected abstract object GetItemAtIndex(int itemIndex); /// <summary> /// should be overrided /// </summary> /// <returns></returns> protected abstract IEnumerator GetEnumeratorImplementation(); } /// <summary> /// Generic specialization of <see cref="AbstractPage"/>. /// </summary> /// <typeparam name="T"></typeparam> public abstract class AbstractPage<T> : AbstractPage, IPaginatedPage<T> { T IPaginatedPage<T>.FirstItem { get { return (T) ((IPaginatedPage)this).FirstItem; } } T IPaginatedPage<T>.LastItem { get { return (T)((IPaginatedPage)this).LastItem; } } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return GetGenericEnumeratorImplementation(); } protected override IEnumerator GetEnumeratorImplementation() { return GetGenericEnumeratorImplementation(); } /// <summary> /// return enumerator over the current set (not the whole set) /// </summary> /// <returns></returns> protected abstract IEnumerator<T> GetGenericEnumeratorImplementation(); /// <summary> /// return element at index /// </summary> /// <returns></returns> protected abstract T GetGenericItemAtIndex(int itemIndex); } }
26.489583
102
0.660637
[ "Apache-2.0" ]
hach-que/Castle.Core
src/Castle.Components.Pagination/AbstractPage.cs
5,086
C#
// This file was generated by cswinrt.exe using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Numerics; using System.Security.Cryptography; using System.Text; using System.Threading; using System.Linq.Expressions; namespace WinRT.Interop { [Guid("1CF2B120-547D-101B-8E65-08002B2BD119")] internal interface IErrorInfo { Guid GetGuid(); string GetSource(); string GetDescription(); string GetHelpFile(); string GetHelpFileContent(); } [Guid("DF0B3D60-548F-101B-8E65-08002B2BD119")] internal interface ISupportErrorInfo { bool InterfaceSupportsErrorInfo(Guid riid); } [Guid("04a2dbf3-df83-116c-0946-0812abf6e07d")] internal interface ILanguageExceptionErrorInfo { IObjectReference GetLanguageException(); } [Guid("82BA7092-4C88-427D-A7BC-16DD93FEB67E")] internal interface IRestrictedErrorInfo { void GetErrorDetails( out string description, out int error, out string restrictedDescription, out string capabilitySid); string GetReference(); } internal class ManagedExceptionErrorInfo : IErrorInfo, ISupportErrorInfo { private readonly Exception _exception; public ManagedExceptionErrorInfo(Exception ex) { _exception = ex; } public bool InterfaceSupportsErrorInfo(Guid riid) => true; public Guid GetGuid() => default; public string GetSource() => _exception.Source; public string GetDescription() { string desc = _exception.Message; if (string.IsNullOrEmpty(desc)) { desc = _exception.GetType().FullName; } return desc; } public string GetHelpFile() => _exception.HelpLink; public string GetHelpFileContent() => string.Empty; } } #pragma warning disable CS0649 namespace ABI.WinRT.Interop { using global::WinRT; using WinRT.Interop; [Guid("1CF2B120-547D-101B-8E65-08002B2BD119")] internal unsafe class IErrorInfo : global::WinRT.Interop.IErrorInfo { [Guid("1CF2B120-547D-101B-8E65-08002B2BD119")] public struct Vftbl { internal global::WinRT.Interop.IUnknownVftbl IUnknownVftbl; private void* _GetGuid_0; public delegate* unmanaged[Stdcall]<IntPtr, Guid*, int> GetGuid_0 { get => (delegate* unmanaged[Stdcall]<IntPtr, Guid*, int>)_GetGuid_0; set => _GetGuid_0 = value; } private void* _GetSource_1; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetSource_1 { get => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetSource_1; set => _GetSource_1 = value; } private void* _GetDescription_2; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetDescription_2 { get => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetDescription_2; set => _GetDescription_2 = value; } private void* _GetHelpFile_3; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetHelpFile_3 { get => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetHelpFile_3; set => _GetHelpFile_3 = value; } private void* _GetHelpFileContent_4; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetHelpFileContent_4 { get => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetHelpFileContent_4; set => _GetHelpFileContent_4 = value; } private static readonly Vftbl AbiToProjectionVftable; public static readonly IntPtr AbiToProjectionVftablePtr; #if NETSTANDARD2_0 public delegate int GetGuidDelegate(IntPtr thisPtr, Guid* guid); public delegate int GetBstrDelegate(IntPtr thisPtr, IntPtr* bstr); private static readonly Delegate[] DelegateCache = new Delegate[5]; #endif static unsafe Vftbl() { AbiToProjectionVftable = new Vftbl { IUnknownVftbl = global::WinRT.Interop.IUnknownVftbl.AbiToProjectionVftbl, #if NETSTANDARD2_0 _GetGuid_0 = Marshal.GetFunctionPointerForDelegate(DelegateCache[0] = new GetGuidDelegate(Do_Abi_GetGuid_0)).ToPointer(), _GetSource_1 = Marshal.GetFunctionPointerForDelegate(DelegateCache[1] = new GetBstrDelegate(Do_Abi_GetSource_1)).ToPointer(), _GetDescription_2 = Marshal.GetFunctionPointerForDelegate(DelegateCache[2] = new GetBstrDelegate(Do_Abi_GetDescription_2)).ToPointer(), _GetHelpFile_3 = Marshal.GetFunctionPointerForDelegate(DelegateCache[3] = new GetBstrDelegate(Do_Abi_GetHelpFile_3)).ToPointer(), _GetHelpFileContent_4 = Marshal.GetFunctionPointerForDelegate(DelegateCache[4] = new GetBstrDelegate(Do_Abi_GetHelpFileContent_4)).ToPointer(), #else _GetGuid_0 = (delegate* unmanaged<IntPtr, Guid*, int>)&Do_Abi_GetGuid_0, _GetSource_1 = (delegate* unmanaged<IntPtr, IntPtr*, int>)&Do_Abi_GetSource_1, _GetDescription_2 = (delegate* unmanaged<IntPtr, IntPtr*, int>)&Do_Abi_GetDescription_2, _GetHelpFile_3 = (delegate* unmanaged<IntPtr, IntPtr*, int>)&Do_Abi_GetHelpFile_3, _GetHelpFileContent_4 = (delegate* unmanaged<IntPtr, IntPtr*, int>)&Do_Abi_GetHelpFileContent_4 #endif }; var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>()); Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); AbiToProjectionVftablePtr = (IntPtr)nativeVftbl; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_GetGuid_0(IntPtr thisPtr, Guid* guid) { try { *guid = ComWrappersSupport.FindObject<global::WinRT.Interop.IErrorInfo>(thisPtr).GetGuid(); } catch (Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_GetSource_1(IntPtr thisPtr, IntPtr* source) { *source = IntPtr.Zero; string _source; try { _source = ComWrappersSupport.FindObject<global::WinRT.Interop.IErrorInfo>(thisPtr).GetSource(); *source = Marshal.StringToBSTR(_source); } catch (Exception ex) { Marshal.FreeBSTR(*source); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_GetDescription_2(IntPtr thisPtr, IntPtr* description) { *description = IntPtr.Zero; string _description; try { _description = ComWrappersSupport.FindObject<global::WinRT.Interop.IErrorInfo>(thisPtr).GetDescription(); *description = Marshal.StringToBSTR(_description); } catch (Exception ex) { Marshal.FreeBSTR(*description); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_GetHelpFile_3(IntPtr thisPtr, IntPtr* helpFile) { *helpFile = IntPtr.Zero; string _helpFile; try { _helpFile = ComWrappersSupport.FindObject<global::WinRT.Interop.IErrorInfo>(thisPtr).GetHelpFile(); *helpFile = Marshal.StringToBSTR(_helpFile); } catch (Exception ex) { Marshal.FreeBSTR(*helpFile); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_GetHelpFileContent_4(IntPtr thisPtr, IntPtr* helpFileContent) { *helpFileContent = IntPtr.Zero; string _helpFileContent; try { _helpFileContent = ComWrappersSupport.FindObject<global::WinRT.Interop.IErrorInfo>(thisPtr).GetHelpFileContent(); *helpFileContent = Marshal.StringToBSTR(_helpFileContent); } catch (Exception ex) { Marshal.FreeBSTR(*helpFileContent); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr); public static implicit operator IErrorInfo(IObjectReference obj) => (obj != null) ? new IErrorInfo(obj) : null; public static implicit operator IErrorInfo(ObjectReference<Vftbl> obj) => (obj != null) ? new IErrorInfo(obj) : null; protected readonly ObjectReference<Vftbl> _obj; public IntPtr ThisPtr => _obj.ThisPtr; public ObjectReference<I> AsInterface<I>() => _obj.As<I>(); public A As<A>() => _obj.AsType<A>(); public IErrorInfo(IObjectReference obj) : this(obj.As<Vftbl>()) { } public IErrorInfo(ObjectReference<Vftbl> obj) { _obj = obj; } public Guid GetGuid() { Guid __return_value__; Marshal.ThrowExceptionForHR(_obj.Vftbl.GetGuid_0(ThisPtr, &__return_value__)); return __return_value__; } public string GetSource() { IntPtr __retval = default; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetSource_1(ThisPtr, &__retval)); return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; } finally { Marshal.FreeBSTR(__retval); } } public string GetDescription() { IntPtr __retval = default; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetDescription_2(ThisPtr, &__retval)); return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; } finally { Marshal.FreeBSTR(__retval); } } public string GetHelpFile() { IntPtr __retval = default; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetHelpFile_3(ThisPtr, &__retval)); return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; } finally { Marshal.FreeBSTR(__retval); } } public string GetHelpFileContent() { IntPtr __retval = default; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetHelpFileContent_4(ThisPtr, &__retval)); return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; } finally { Marshal.FreeBSTR(__retval); } } } [Guid("04a2dbf3-df83-116c-0946-0812abf6e07d")] internal unsafe class ILanguageExceptionErrorInfo : global::WinRT.Interop.ILanguageExceptionErrorInfo { [Guid("04a2dbf3-df83-116c-0946-0812abf6e07d")] public struct Vftbl { internal global::WinRT.Interop.IUnknownVftbl IUnknownVftbl; private void* _GetLanguageException_0; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetLanguageException_0 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetLanguageException_0; } public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr); public static implicit operator ILanguageExceptionErrorInfo(IObjectReference obj) => (obj != null) ? new ILanguageExceptionErrorInfo(obj) : null; public static implicit operator ILanguageExceptionErrorInfo(ObjectReference<Vftbl> obj) => (obj != null) ? new ILanguageExceptionErrorInfo(obj) : null; protected readonly ObjectReference<Vftbl> _obj; public IntPtr ThisPtr => _obj.ThisPtr; public ObjectReference<I> AsInterface<I>() => _obj.As<I>(); public A As<A>() => _obj.AsType<A>(); public ILanguageExceptionErrorInfo(IObjectReference obj) : this(obj.As<Vftbl>()) { } public ILanguageExceptionErrorInfo(ObjectReference<Vftbl> obj) { _obj = obj; } public IObjectReference GetLanguageException() { IntPtr __return_value__ = IntPtr.Zero; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetLanguageException_0(ThisPtr, &__return_value__)); return ObjectReference<global::WinRT.Interop.IUnknownVftbl>.Attach(ref __return_value__); } finally { if (__return_value__ != IntPtr.Zero) { (*(global::WinRT.Interop.IUnknownVftbl**)__return_value__)->Release(__return_value__); } } } } [Guid("DF0B3D60-548F-101B-8E65-08002B2BD119")] internal unsafe class ISupportErrorInfo : global::WinRT.Interop.ISupportErrorInfo { [Guid("DF0B3D60-548F-101B-8E65-08002B2BD119")] public struct Vftbl { internal global::WinRT.Interop.IUnknownVftbl IUnknownVftbl; private void* _InterfaceSupportsErrorInfo_0; public delegate* unmanaged[Stdcall]<IntPtr, Guid*, int> InterfaceSupportsErrorInfo_0 { get => (delegate* unmanaged[Stdcall]<IntPtr, Guid*, int>)_InterfaceSupportsErrorInfo_0; set => _InterfaceSupportsErrorInfo_0 = value; } private static readonly Vftbl AbiToProjectionVftable; public static readonly IntPtr AbiToProjectionVftablePtr; #if NETSTANDARD2_0 public delegate int _InterfaceSupportsErrorInfo(IntPtr thisPtr, Guid* riid); private static readonly _InterfaceSupportsErrorInfo DelegateCache; #endif static unsafe Vftbl() { AbiToProjectionVftable = new Vftbl { IUnknownVftbl = global::WinRT.Interop.IUnknownVftbl.AbiToProjectionVftbl, #if NETSTANDARD2_0 _InterfaceSupportsErrorInfo_0 = Marshal.GetFunctionPointerForDelegate(DelegateCache = Do_Abi_InterfaceSupportsErrorInfo_0).ToPointer() #else _InterfaceSupportsErrorInfo_0 = (delegate* unmanaged<IntPtr, Guid*, int>)&Do_Abi_InterfaceSupportsErrorInfo_0 #endif }; var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>()); Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); AbiToProjectionVftablePtr = (IntPtr)nativeVftbl; } #if !NETSTANDARD2_0 [UnmanagedCallersOnly] #endif private static int Do_Abi_InterfaceSupportsErrorInfo_0(IntPtr thisPtr, Guid* guid) { try { return global::WinRT.ComWrappersSupport.FindObject<global::WinRT.Interop.ISupportErrorInfo>(thisPtr).InterfaceSupportsErrorInfo(*guid) ? 0 : 1; } catch (Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } } } public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr); public static implicit operator ISupportErrorInfo(IObjectReference obj) => (obj != null) ? new ISupportErrorInfo(obj) : null; public static implicit operator ISupportErrorInfo(ObjectReference<Vftbl> obj) => (obj != null) ? new ISupportErrorInfo(obj) : null; protected readonly ObjectReference<Vftbl> _obj; public IntPtr ThisPtr => _obj.ThisPtr; public ObjectReference<I> AsInterface<I>() => _obj.As<I>(); public A As<A>() => _obj.AsType<A>(); public ISupportErrorInfo(IObjectReference obj) : this(obj.As<Vftbl>()) { } public ISupportErrorInfo(ObjectReference<Vftbl> obj) { _obj = obj; } public bool InterfaceSupportsErrorInfo(Guid riid) { return _obj.Vftbl.InterfaceSupportsErrorInfo_0(ThisPtr, &riid) == 0; } } [Guid("82BA7092-4C88-427D-A7BC-16DD93FEB67E")] internal unsafe class IRestrictedErrorInfo : global::WinRT.Interop.IRestrictedErrorInfo { [Guid("82BA7092-4C88-427D-A7BC-16DD93FEB67E")] public struct Vftbl { public delegate int _GetErrorDetails(IntPtr thisPtr, out IntPtr description, out int error, out IntPtr restrictedDescription, out IntPtr capabilitySid); public delegate int _GetReference(IntPtr thisPtr, out IntPtr reference); internal global::WinRT.Interop.IUnknownVftbl unknownVftbl; private void* _GetErrorDetails_0; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int*, IntPtr*, IntPtr*, int> GetErrorDetails_0 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int*, IntPtr*, IntPtr*, int>)_GetErrorDetails_0; private void* _GetReference_1; public delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetReference_1 => (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetReference_1; } public static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr) => ObjectReference<Vftbl>.FromAbi(thisPtr); public static implicit operator IRestrictedErrorInfo(IObjectReference obj) => (obj != null) ? new IRestrictedErrorInfo(obj) : null; public static implicit operator IRestrictedErrorInfo(ObjectReference<Vftbl> obj) => (obj != null) ? new IRestrictedErrorInfo(obj) : null; protected readonly ObjectReference<Vftbl> _obj; public IntPtr ThisPtr => _obj.ThisPtr; public ObjectReference<I> AsInterface<I>() => _obj.As<I>(); public A As<A>() => _obj.AsType<A>(); public IRestrictedErrorInfo(IObjectReference obj) : this(obj.As<Vftbl>()) { } public IRestrictedErrorInfo(ObjectReference<Vftbl> obj) { _obj = obj; } public void GetErrorDetails( out string description, out int error, out string restrictedDescription, out string capabilitySid) { IntPtr _description = IntPtr.Zero; IntPtr _restrictedDescription = IntPtr.Zero; IntPtr _capabilitySid = IntPtr.Zero; try { fixed (int* pError = &error) { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetErrorDetails_0(ThisPtr, &_description, pError, &_restrictedDescription, &_capabilitySid)); } description = _description != IntPtr.Zero ? Marshal.PtrToStringBSTR(_description) : string.Empty; restrictedDescription = _restrictedDescription != IntPtr.Zero ? Marshal.PtrToStringBSTR(_restrictedDescription) : string.Empty; capabilitySid = _capabilitySid != IntPtr.Zero ? Marshal.PtrToStringBSTR(_capabilitySid) : string.Empty; } finally { Marshal.FreeBSTR(_description); Marshal.FreeBSTR(_restrictedDescription); Marshal.FreeBSTR(_capabilitySid); } } public string GetReference() { IntPtr __retval = default; try { Marshal.ThrowExceptionForHR(_obj.Vftbl.GetReference_1(ThisPtr, &__retval)); return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; } finally { Marshal.FreeBSTR(__retval); } } } }
41.869048
234
0.610132
[ "MIT" ]
Acidburn0zzz/CsWinRT
WinRT.Runtime/Interop/ExceptionErrorInfo.cs
21,104
C#
using System; using System.Collections.Generic; using Uno.Disposables; using System.Text; using Uno.Extensions; using Uno.Logging; using Windows.UI.Xaml.Markup; using Windows.UI.Xaml.Controls.Primitives; using Android.Views; using Uno.UI; namespace Windows.UI.Xaml.Controls { [ContentProperty(Name = "Child")] public partial class NativePopup : PopupBase { private Android.Widget.PopupWindow _popupWindow; public NativePopup() { _popupWindow = new Android.Widget.PopupWindow(); _popupWindow.Focusable = true; _popupWindow.Touchable = true; } private protected override void OnLoaded() { base.OnLoaded(); _popupWindow.DismissEvent += OnDismissEvent; } private protected override void OnUnloaded() { base.OnUnloaded(); _popupWindow.DismissEvent -= OnDismissEvent; } private void OnDismissEvent(object sender, EventArgs e) { IsOpen = false; } protected override void OnChildChanged(UIElement oldChild, UIElement newChild) { base.OnChildChanged(oldChild, newChild); _popupWindow.ContentView = newChild; } protected override void OnIsOpenChanged(bool oldIsOpen, bool newIsOpen) { base.OnIsOpenChanged(oldIsOpen, newIsOpen); if (newIsOpen) { if (Child is FrameworkElement child) { child.Measure(Window.Current.Bounds.Size); _popupWindow.Width = ViewHelper.LogicalToPhysicalPixels(child.DesiredSize.Width); _popupWindow.Height = ViewHelper.LogicalToPhysicalPixels(child.DesiredSize.Height); } _popupWindow.ShowAsDropDown(Anchor ?? this); } else { _popupWindow.Dismiss(); } } } }
22.676056
88
0.73354
[ "Apache-2.0" ]
Abhishek-Sharma-Msft/uno
src/Uno.UI/UI/Xaml/Controls/Popup/NativePopup.Android.cs
1,612
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="AssemblyUtils.cs" company="Slash Games"> // Copyright (c) Slash Games. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Slash.Reflection.Utils { using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; #if WINDOWS_STORE using Windows.ApplicationModel; using Windows.Foundation; using Windows.Storage; #endif /// <summary> /// Utility methods for operating on assemblies. /// </summary> public class AssemblyUtils { #if WINDOWS_STORE #region Static Fields /// <summary> /// Cached list of loaded assemblies. /// </summary> private static List<Assembly> loadedAssemblies; #endregion #region Public Methods and Operators /// <summary> /// Gets all assemblies that are loaded in the current application domain. /// </summary> /// <returns>All loaded assemblies.</returns> public static IEnumerable<Assembly> GetLoadedAssemblies() { // Check if cached. if (loadedAssemblies != null) { return loadedAssemblies; } // Find assemblies. StorageFolder folder = Package.Current.InstalledLocation; loadedAssemblies = new List<Assembly>(); IAsyncOperation<IReadOnlyList<StorageFile>> folderFilesAsync = folder.GetFilesAsync(); folderFilesAsync.AsTask().Wait(); foreach (StorageFile file in folderFilesAsync.GetResults()) { if (file.FileType == ".dll" || file.FileType == ".exe") { try { var filename = file.Name.Substring(0, file.Name.Length - file.FileType.Length); AssemblyName name = new AssemblyName { Name = filename }; Assembly asm = Assembly.Load(name); loadedAssemblies.Add(asm); } catch (BadImageFormatException) { /* * TODO(np): Thrown reflecting on C++ executable files for which the C++ compiler * stripped the relocation addresses (such as Unity dlls): * http://msdn.microsoft.com/en-us/library/x4cw969y(v=vs.110).aspx */ } } } return loadedAssemblies; } #endregion #endif #if !WINDOWS_PHONE public static void CheckReferencedAssembliesAreLoaded() { var loadedAssemblies = GetLoadedAssemblies().ToList(); foreach (var loadedAssembly in loadedAssemblies) { CheckReferencedAssembliesAreLoaded(loadedAssembly, new List<Assembly>(loadedAssemblies)); } } private static void CheckReferencedAssembliesAreLoaded(Assembly assembly, IList<Assembly> loadedAssemblies) { var loadedAssemblyNames = loadedAssemblies.Select(a => a.FullName).ToArray(); var referencedAssemblies = assembly.GetReferencedAssemblies(); var assemblyNamesToLoad = referencedAssemblies.Where( referencedAssembly => !loadedAssemblyNames.Contains(referencedAssembly.FullName)); foreach (var assemblyName in assemblyNamesToLoad) { try { var loadedAssembly = AppDomain.CurrentDomain.Load(assemblyName); // Check if really not loaded already, might just be another version. if (!loadedAssemblies.Contains(loadedAssembly)) { loadedAssemblies.Add(loadedAssembly); // Do recursive for loaded assembly. CheckReferencedAssembliesAreLoaded(loadedAssembly, loadedAssemblies); } } catch (FileNotFoundException) { // NOTE(co): Okay or not? } catch (FileLoadException) { // NOTE(co): Okay or not? } } } #endif /// <summary> /// Gets all assemblies that are loaded in the current application domain. /// </summary> /// <returns>All loaded assemblies.</returns> public static IEnumerable<Assembly> GetLoadedAssemblies() { return AppDomain.CurrentDomain.GetAssemblies(); } } }
35.035461
120
0.516802
[ "MIT" ]
SlashGames/slash-framework
Source/Slash.Reflection/Source/Utils/AssemblyUtils.cs
4,942
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.Cdn.Latest { /// <summary> /// CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. /// </summary> public partial class Origin : Pulumi.CustomResource { /// <summary> /// Origin is enabled for load balancing or not /// </summary> [Output("enabled")] public Output<bool?> Enabled { get; private set; } = null!; /// <summary> /// The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. /// </summary> [Output("hostName")] public Output<string> HostName { get; private set; } = null!; /// <summary> /// The value of the HTTP port. Must be between 1 and 65535. /// </summary> [Output("httpPort")] public Output<int?> HttpPort { get; private set; } = null!; /// <summary> /// The value of the HTTPS port. Must be between 1 and 65535. /// </summary> [Output("httpsPort")] public Output<int?> HttpsPort { get; private set; } = null!; /// <summary> /// Resource name. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint /// </summary> [Output("originHostHeader")] public Output<string?> OriginHostHeader { get; private set; } = null!; /// <summary> /// Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 /// </summary> [Output("priority")] public Output<int?> Priority { get; private set; } = null!; /// <summary> /// The approval status for the connection to the Private Link /// </summary> [Output("privateEndpointStatus")] public Output<string> PrivateEndpointStatus { get; private set; } = null!; /// <summary> /// The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' /// </summary> [Output("privateLinkAlias")] public Output<string?> PrivateLinkAlias { get; private set; } = null!; /// <summary> /// A custom message to be included in the approval request to connect to the Private Link. /// </summary> [Output("privateLinkApprovalMessage")] public Output<string?> PrivateLinkApprovalMessage { get; private set; } = null!; /// <summary> /// The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated /// </summary> [Output("privateLinkLocation")] public Output<string?> PrivateLinkLocation { get; private set; } = null!; /// <summary> /// The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' /// </summary> [Output("privateLinkResourceId")] public Output<string?> PrivateLinkResourceId { get; private set; } = null!; /// <summary> /// Provisioning status of the origin. /// </summary> [Output("provisioningState")] public Output<string> ProvisioningState { get; private set; } = null!; /// <summary> /// Resource status of the origin. /// </summary> [Output("resourceState")] public Output<string> ResourceState { get; private set; } = null!; /// <summary> /// Resource type. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 /// </summary> [Output("weight")] public Output<int?> Weight { get; private set; } = null!; /// <summary> /// Create a Origin resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public Origin(string name, OriginArgs args, CustomResourceOptions? options = null) : base("azure-nextgen:cdn/latest:Origin", name, args ?? new OriginArgs(), MakeResourceOptions(options, "")) { } private Origin(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-nextgen:cdn/latest:Origin", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:cdn/v20150601:Origin"}, new Pulumi.Alias { Type = "azure-nextgen:cdn/v20160402:Origin"}, new Pulumi.Alias { Type = "azure-nextgen:cdn/v20191231:Origin"}, new Pulumi.Alias { Type = "azure-nextgen:cdn/v20200331:Origin"}, new Pulumi.Alias { Type = "azure-nextgen:cdn/v20200415:Origin"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing Origin resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static Origin Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new Origin(name, id, options); } } public sealed class OriginArgs : Pulumi.ResourceArgs { /// <summary> /// Origin is enabled for load balancing or not /// </summary> [Input("enabled")] public Input<bool>? Enabled { get; set; } /// <summary> /// Name of the endpoint under the profile which is unique globally. /// </summary> [Input("endpointName", required: true)] public Input<string> EndpointName { get; set; } = null!; /// <summary> /// The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. /// </summary> [Input("hostName", required: true)] public Input<string> HostName { get; set; } = null!; /// <summary> /// The value of the HTTP port. Must be between 1 and 65535. /// </summary> [Input("httpPort")] public Input<int>? HttpPort { get; set; } /// <summary> /// The value of the HTTPS port. Must be between 1 and 65535. /// </summary> [Input("httpsPort")] public Input<int>? HttpsPort { get; set; } /// <summary> /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint /// </summary> [Input("originHostHeader")] public Input<string>? OriginHostHeader { get; set; } /// <summary> /// Name of the origin that is unique within the endpoint. /// </summary> [Input("originName", required: true)] public Input<string> OriginName { get; set; } = null!; /// <summary> /// Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 /// </summary> [Input("priority")] public Input<int>? Priority { get; set; } /// <summary> /// The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' /// </summary> [Input("privateLinkAlias")] public Input<string>? PrivateLinkAlias { get; set; } /// <summary> /// A custom message to be included in the approval request to connect to the Private Link. /// </summary> [Input("privateLinkApprovalMessage")] public Input<string>? PrivateLinkApprovalMessage { get; set; } /// <summary> /// The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated /// </summary> [Input("privateLinkLocation")] public Input<string>? PrivateLinkLocation { get; set; } /// <summary> /// The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' /// </summary> [Input("privateLinkResourceId")] public Input<string>? PrivateLinkResourceId { get; set; } /// <summary> /// Name of the CDN profile which is unique within the resource group. /// </summary> [Input("profileName", required: true)] public Input<string> ProfileName { get; set; } = null!; /// <summary> /// Name of the Resource group within the Azure subscription. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; /// <summary> /// Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 /// </summary> [Input("weight")] public Input<int>? Weight { get; set; } public OriginArgs() { } } }
43.356322
333
0.604984
[ "Apache-2.0" ]
test-wiz-sec/pulumi-azure-nextgen
sdk/dotnet/Cdn/Latest/Origin.cs
11,316
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 quicksight-2018-04-01.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.QuickSight.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.QuickSight.Model.Internal.MarshallTransformations { /// <summary> /// ListTemplateVersions Request Marshaller /// </summary> public class ListTemplateVersionsRequestMarshaller : IMarshaller<IRequest, ListTemplateVersionsRequest> , 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((ListTemplateVersionsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListTemplateVersionsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.QuickSight"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-04-01"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAwsAccountId()) throw new AmazonQuickSightException("Request object does not have required field AwsAccountId set"); request.AddPathResource("{AwsAccountId}", StringUtils.FromString(publicRequest.AwsAccountId)); if (!publicRequest.IsSetTemplateId()) throw new AmazonQuickSightException("Request object does not have required field TemplateId set"); request.AddPathResource("{TemplateId}", StringUtils.FromString(publicRequest.TemplateId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("max-results", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("next-token", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/accounts/{AwsAccountId}/templates/{TemplateId}/versions"; request.MarshallerVersion = 2; request.UseQueryString = true; return request; } private static ListTemplateVersionsRequestMarshaller _instance = new ListTemplateVersionsRequestMarshaller(); internal static ListTemplateVersionsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListTemplateVersionsRequestMarshaller Instance { get { return _instance; } } } }
39.704082
156
0.646877
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/QuickSight/Generated/Model/Internal/MarshallTransformations/ListTemplateVersionsRequestMarshaller.cs
3,891
C#
#region Copyright // Copyright (c) 2020 TonesNotes // Distributed under the Open BSV software license, see the accompanying file LICENSE. #endregion using System; using Newtonsoft.Json; namespace CafeLib.BsvSharp.Scripting { internal class ScriptConverter : JsonConverter<Script> { public override Script ReadJson(JsonReader reader, Type objectType, Script existingValue, bool hasExistingValue, JsonSerializer serializer) { var s = (string)reader.Value; return new Script(s); } public override void WriteJson(JsonWriter writer, Script value, JsonSerializer serializer) { writer.WriteValue(value.ToHexString()); } } }
28.68
147
0.691771
[ "MIT" ]
chrissolutions/BsvSharp
BsvSharp/CafeLib.BsvSharp/Scripting/ScriptConverter.cs
719
C#
namespace CompileScore { using Microsoft.VisualStudio.Language.Intellisense; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Utilities; using System.ComponentModel.Composition; [Export(typeof(IAsyncQuickInfoSourceProvider))] [Name("Score Async Quick Info Provider")] [ContentType("C/C++")] [Order] internal sealed class ScoreAsyncQuickInfoSourceProvider : IAsyncQuickInfoSourceProvider { public IAsyncQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) { // This ensures only one instance per textbuffer is created return textBuffer.Properties.GetOrCreateSingletonProperty(() => new ScoreAsyncQuickInfoSource(textBuffer)); } } }
35.809524
119
0.732713
[ "MIT" ]
ikrima/CompileScore
CompileScore/QuickInfo/ScoreQuickInfoSourceProvider.cs
754
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("PhpLogParser.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PhpLogParser.Tests")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e93405b1-f169-426b-9bb6-9b0a1c7f7e68")] // 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.745919
[ "MIT" ]
lagerone/phplogparser
src/PhpLogParser.Tests/Properties/AssemblyInfo.cs
1,412
C#
using StyletIoC.Internal.Creators; using StyletIoC.Internal.Registrations; using System; using StyletIoC.Creation; using System.Collections.Generic; using System.Diagnostics; namespace StyletIoC.Internal.Builders { internal class BuilderAbstractFactoryBinding : BuilderBindingBase { private BuilderTypeKey ServiceType { get { return this.ServiceTypes[0]; } } public BuilderAbstractFactoryBinding(List<BuilderTypeKey> serviceTypes) : base(serviceTypes) { // This should be ensured by the fluent interfaces Trace.Assert(serviceTypes.Count == 1); if (this.ServiceType.Type.IsGenericTypeDefinition) throw new StyletIoCRegistrationException(String.Format("Unbound generic type {0} can't be used as an abstract factory", this.ServiceType.Type.GetDescription())); } public override void Build(Container container) { var factoryType = container.GetFactoryForType(this.ServiceType.Type); var creator = new AbstractFactoryCreator(factoryType); var registration = new TransientRegistration(creator); container.AddRegistration(new TypeKey(this.ServiceType.Type.TypeHandle, this.ServiceType.Key), registration); } } }
38.941176
178
0.688066
[ "MIT" ]
DotNetUz/Stylet
Stylet/StyletIoC/Internal/Builders/BuilderAbstractFactoryBinding.cs
1,293
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Threading.Tasks; using SharpBrick.PoweredUp.Protocol; using SharpBrick.PoweredUp.Protocol.Knowledge; using SharpBrick.PoweredUp.Protocol.Messages; using SharpBrick.PoweredUp.Utils; namespace SharpBrick.PoweredUp { public class MoveHubTiltSensor : Device, IPoweredUpDevice { protected MultiValueMode<sbyte, sbyte> _twoAxisFullMode; protected SingleValueMode<sbyte, sbyte> _twoAxisStateMode; protected SingleValueMode<sbyte, sbyte> _threeAxisStateMode; protected SingleValueMode<int, int> _impactsMode; protected MultiValueMode<sbyte, sbyte> _threeAxisFullMode; /// <summary> /// Two axis full values /// </summary> public byte ModeIndexTwoAxisFull { get; protected set; } = 0; /// <summary> /// Two Axis simple state of orientation /// </summary> public byte ModeIndexTwoAxisState { get; protected set; } = 1; /// <summary> /// Three Axis simple state of orientation which provides more states than <see cref="ModeIndexTwoAxisState"/> /// </summary> public byte ModeIndexThreeAxisState { get; protected set; } = 2; /// <summary> /// Count of impacts /// </summary> public byte ModeIndexImpacts { get; protected set; } = 3; /// <summary> /// Three axis full values /// </summary> public byte ModeIndexThreeAxisFull { get; protected set; } = 4; public byte ModeIndexOrientationConfig { get; protected set; } = 5; public byte ModeIndexImpactsConfig { get; protected set; } = 6; public byte ModeIndexCalibration { get; protected set; } = 7; public (sbyte roll, sbyte pitch) TwoAxisFull => (_twoAxisFullMode.SI[0], _twoAxisFullMode.SI[1]); public MoveHubTiltSimpleOrientation TwoAxisState => (MoveHubTiltSimpleOrientation)_twoAxisStateMode.SI; public MoveHubTiltOrientation ThreeAxisState => (MoveHubTiltOrientation)_threeAxisStateMode.SI; public int Impacts => _impactsMode.SI; public (sbyte roll, sbyte pitch, sbyte yaw) ThreeAxisFull => (_threeAxisFullMode.SI[0], _threeAxisFullMode.SI[1], _threeAxisFullMode.SI[2]); public IObservable<(sbyte roll, sbyte pitch)> TwoAxisFullObservable => _twoAxisFullMode.Observable.Select(v => (v.SI[0], v.SI[1])); public IObservable<MoveHubTiltSimpleOrientation> TwoAxisStateObservable => _twoAxisStateMode.Observable.Select(x => (MoveHubTiltSimpleOrientation)x.SI); public IObservable<MoveHubTiltOrientation> ThreeAxisStateObservable => _threeAxisStateMode.Observable.Select(x => (MoveHubTiltOrientation)x.SI); public IObservable<Value<int, int>> ImpactsObservable => _impactsMode.Observable; public IObservable<(sbyte roll, sbyte pitch, sbyte yaw)> ThreeAxisFullObservable => _threeAxisFullMode.Observable.Select(v => (v.SI[0], v.SI[1], v.SI[2])); public MoveHubTiltSensor() { } public MoveHubTiltSensor(ILegoWirelessProtocol protocol, byte hubId, byte portId) : base(protocol, hubId, portId) { _twoAxisFullMode = MultiValueMode<sbyte, sbyte>(ModeIndexTwoAxisFull); _twoAxisStateMode = SingleValueMode<sbyte, sbyte>(ModeIndexTwoAxisState); _threeAxisStateMode = SingleValueMode<sbyte, sbyte>(ModeIndexThreeAxisState); _impactsMode = SingleValueMode<int, int>(ModeIndexImpacts); _threeAxisFullMode = MultiValueMode<sbyte, sbyte>(ModeIndexThreeAxisFull); ObserveForPropertyChanged(_twoAxisFullMode.Observable, nameof(TwoAxisFull)); ObserveForPropertyChanged(_twoAxisStateMode.Observable, nameof(TwoAxisState)); ObserveForPropertyChanged(_threeAxisStateMode.Observable, nameof(ThreeAxisState)); ObserveForPropertyChanged(_impactsMode.Observable, nameof(Impacts)); ObserveForPropertyChanged(_threeAxisFullMode.Observable, nameof(ThreeAxisFull)); } public void ExtendPortMode(PortModeInfo modeInfo) { // Percentage is disabled for three axis full (ACCEL) since in some cases the hub // can report a larger than expected value which makes the percentage go beyond an sbyte min/max values and generate an exception // TODO: This can be removed when #126 is implemented if (modeInfo.ModeIndex == ModeIndexThreeAxisFull) { modeInfo.DisablePercentage = true; } } /// <summary> /// Set the Tilt into ImpactCount mode and change (preset) the value to the given PresetValue. /// </summary> /// <param name="presetValue">Value between 0 and int.MaxValue</param> /// <returns></returns> public async Task<PortFeedback> TiltImpactPresetAsync(int presetValue) { AssertIsConnected(); if (presetValue < 0) { throw new ArgumentOutOfRangeException(nameof(presetValue), "PresetValue has to be between 0 and int.MaxValue"); } var response = await _protocol.SendPortOutputCommandAsync(new PortOutputCommandTiltImpactPresetMessage( _portId, PortOutputCommandStartupInformation.ExecuteImmediately, PortOutputCommandCompletionInformation.CommandFeedback, presetValue ) { HubId = _hubId, ModeIndex = ModeIndexImpacts, }); return response; } /// <summary> /// Setup Tilt ImpactThreshold and BumpHoldoff /// </summary> /// <param name="impactThreshold">Impact Threshold between 0 and 127.</param> /// <param name="bumpHoldoffInMs">Bump Holdoff between 10ms and 1270ms.</param> /// <returns></returns> public async Task<PortFeedback> TiltConfigImpactAsync(sbyte impactThreshold, short bumpHoldoffInMs) { AssertIsConnected(); if (impactThreshold < 0) { throw new ArgumentOutOfRangeException(nameof(impactThreshold), "Impact Threshold has to be between 0 and 127"); } if (bumpHoldoffInMs < 10 || bumpHoldoffInMs > 1270) { throw new ArgumentOutOfRangeException(nameof(bumpHoldoffInMs), "Hold off has to be between 10 and 1270 ms (in steps of 10ms)"); } var response = await _protocol.SendPortOutputCommandAsync(new PortOutputCommandTiltConfigImpactMessage( _portId, PortOutputCommandStartupInformation.ExecuteImmediately, PortOutputCommandCompletionInformation.CommandFeedback, impactThreshold, (sbyte)((float)bumpHoldoffInMs / 10) ) { HubId = _hubId, ModeIndex = ModeIndexImpactsConfig, }); return response; } /// <summary> /// Set the Tilt into Orientation mode and set the Orientation value to Orientation. /// </summary> /// <param name="orientation">orientation of the tilt for 0 values.</param> /// <returns></returns> public async Task<PortFeedback> TiltConfigOrientationAsync(TiltConfigOrientation orientation) { AssertIsConnected(); var response = await _protocol.SendPortOutputCommandAsync(new PortOutputCommandTiltConfigOrientationMessage( _portId, PortOutputCommandStartupInformation.ExecuteImmediately, PortOutputCommandCompletionInformation.CommandFeedback, orientation ) { HubId = _hubId, ModeIndex = ModeIndexOrientationConfig, }); return response; } public IEnumerable<byte[]> GetStaticPortInfoMessages(Version softwareVersion, Version hardwareVersion, SystemType systemType) => @" 0B-00-43-3A-01-06-08-FF-00-00-00 07-00-43-3A-02-1F-00 11-00-44-3A-00-00-41-4E-47-4C-45-00-00-00-00-00-00 0E-00-44-3A-00-01-00-00-B4-C2-00-00-B4-42 0E-00-44-3A-00-02-00-00-C8-C2-00-00-C8-42 0E-00-44-3A-00-03-00-00-B4-C2-00-00-B4-42 0A-00-44-3A-00-04-44-45-47-00 08-00-44-3A-00-05-50-00 0A-00-44-3A-00-80-02-00-03-00 11-00-44-3A-01-00-54-49-4C-54-00-00-00-00-00-00-00 0E-00-44-3A-01-01-00-00-00-00-00-00-20-41 0E-00-44-3A-01-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-01-03-00-00-00-00-00-00-20-41 0A-00-44-3A-01-04-44-49-52-00 08-00-44-3A-01-05-44-00 0A-00-44-3A-01-80-01-00-01-00 11-00-44-3A-02-00-4F-52-49-4E-54-00-00-00-00-00-00 0E-00-44-3A-02-01-00-00-00-00-00-00-A0-40 0E-00-44-3A-02-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-02-03-00-00-00-00-00-00-A0-40 0A-00-44-3A-02-04-44-49-52-00 08-00-44-3A-02-05-10-00 0A-00-44-3A-02-80-01-00-01-00 11-00-44-3A-03-00-49-4D-50-43-54-00-00-00-00-00-00 0E-00-44-3A-03-01-00-00-00-00-00-00-C8-42 0E-00-44-3A-03-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-03-03-00-00-00-00-00-00-C8-42 0A-00-44-3A-03-04-49-4D-50-00 08-00-44-3A-03-05-08-00 0A-00-44-3A-03-80-01-02-04-00 11-00-44-3A-04-00-41-43-43-45-4C-00-00-00-00-00-00 0E-00-44-3A-04-01-00-00-82-C2-00-00-82-42 0E-00-44-3A-04-02-00-00-C8-C2-00-00-C8-42 0E-00-44-3A-04-03-00-00-82-C2-00-00-82-42 0A-00-44-3A-04-04-41-43-43-00 08-00-44-3A-04-05-10-00 0A-00-44-3A-04-80-03-00-03-00 11-00-44-3A-05-00-4F-52-5F-43-46-00-00-00-00-00-00 0E-00-44-3A-05-01-00-00-00-00-00-00-C0-40 0E-00-44-3A-05-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-05-03-00-00-00-00-00-00-C0-40 0A-00-44-3A-05-04-53-49-44-00 08-00-44-3A-05-05-10-00 0A-00-44-3A-05-80-01-00-01-00 11-00-44-3A-06-00-49-4D-5F-43-46-00-00-00-00-00-00 0E-00-44-3A-06-01-00-00-00-00-00-00-7F-43 0E-00-44-3A-06-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-06-03-00-00-00-00-00-00-7F-43 0A-00-44-3A-06-04-53-45-4E-00 08-00-44-3A-06-05-10-00 0A-00-44-3A-06-80-02-00-03-00 11-00-44-3A-07-00-43-41-4C-49-42-00-00-00-00-00-00 0E-00-44-3A-07-01-00-00-00-00-00-00-7F-43 0E-00-44-3A-07-02-00-00-00-00-00-00-C8-42 0E-00-44-3A-07-03-00-00-00-00-00-00-7F-43 0A-00-44-3A-07-04-43-41-4C-00 08-00-44-3A-07-05-10-00 0A-00-44-3A-07-80-03-00-03-00 ".Trim().Split("\n").Select(s => BytesStringUtil.StringToData(s)); } }
44.171674
163
0.657307
[ "MIT" ]
romarro/powered-up
src/SharpBrick.PoweredUp/Devices/MoveHubTiltSensor.cs
10,292
C#
using System; using UnityEditor.MemoryProfiler; using UnityEngine; namespace MemoryProfilerWindow { internal struct BytesAndOffset { public byte[] bytes; public int offset; public int pointerSize; public bool IsValid { get { return bytes != null; } } public UInt64 ReadPointer() { if (pointerSize == 4) return BitConverter.ToUInt32(bytes, offset); if (pointerSize == 8) return BitConverter.ToUInt64(bytes, offset); throw new ArgumentException("Unexpected pointersize: " + pointerSize); } public Int32 ReadInt32() { return BitConverter.ToInt32(bytes, offset); } public Int64 ReadInt64() { return BitConverter.ToInt64(bytes, offset); } public BytesAndOffset Add(int add) { return new BytesAndOffset() { bytes = bytes, offset = offset + add, pointerSize = pointerSize }; } public void WritePointer(UInt64 value) { for (int i = 0; i < pointerSize; i++) { bytes[i + offset] = (byte)value; value >>= 8; } } public BytesAndOffset NextPointer() { return Add(pointerSize); } } }
25.471698
108
0.536296
[ "MIT" ]
Android2048/PerfAssist
Assets/PerfAssist/MemoryProfilerAdvanced/Editor/BytesAndOffset.cs
1,352
C#
/* // <copyright> // dotNetRDF is free and open source software licensed under the MIT License // ------------------------------------------------------------------------- // // Copyright (c) 2009-2020 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.Xml.Serialization; namespace VDS.RDF { /// <summary> /// Interface for RDF Graphs. /// </summary> /// <remarks> /// <para> /// Most implementations will probably want to inherit from the abstract class <see cref="BaseGraph">BaseGraph</see> since it contains reference implementations of various algorithms (Graph Equality/Graph Difference/Sub-Graph testing etc) which will save considerable work in implementation and ensure consistent behaviour of some methods across implementations. /// </para> /// </remarks> public interface IGraph : INodeFactory, IDisposable #if !NETCORE , IXmlSerializable #endif { #region Properties /// <summary> /// Gets/Sets the Base Uri for the Graph. /// </summary> Uri BaseUri { get; set; } /// <summary> /// Gets whether a Graph is Empty. /// </summary> bool IsEmpty { get; } /// <summary> /// Gets the Namespace Map for the Graph. /// </summary> INamespaceMapper NamespaceMap { get; } /// <summary> /// Gets the unique Subject and Object nodes of the Graph. /// </summary> /// <remarks>This property returns only nodes that appear in the Subject or Object position in triples. To retrieve a list of all INode instances in a graph including those in Predicate position in a triple, use the <see cref="AllNodes"/> property.</remarks> IEnumerable<INode> Nodes { get; } /// <summary> /// Gets the unique Subject, Predicate and Object nodes of the Graph. /// </summary> IEnumerable<INode> AllNodes { get; } /// <summary> /// Gets the Triple Collection for the Graph. /// </summary> BaseTripleCollection Triples { get; } #endregion #region Assertion & Retraction /// <summary> /// Asserts a Triple in the Graph. /// </summary> /// <param name="t">A Triple.</param> bool Assert(Triple t); /// <summary> /// Asserts an Enumerable of Triples in the Graph. /// </summary> /// <param name="ts">An Enumerable of Triples.</param> bool Assert(IEnumerable<Triple> ts); /// <summary> /// Retracts a Triple from the Graph. /// </summary> /// <param name="t">A Triple.</param> bool Retract(Triple t); /// <summary> /// Retracts an Enumerable of Triples from the Graph. /// </summary> /// <param name="ts">Enumerable of Triples.</param> bool Retract(IEnumerable<Triple> ts); /// <summary> /// Retracts all Triples from the Graph. /// </summary> /// <remarks> /// <para> /// The Graph should raise the <see cref="ClearRequested">ClearRequested</see> event at the start of the Clear operation and abort the operation if the operation is cancelled by an event handler. On completing the Clear the <see cref="Cleared">Cleared</see> event should be raised. /// </para> /// </remarks> void Clear(); #endregion #region Node Creation /// <summary> /// Creates a URI Node that corresponds to the Base URI of the Graph. /// </summary> /// <returns></returns> IUriNode CreateUriNode(); /// <summary> /// Creates a URI Node for the given QName using the Graphs NamespaceMap to resolve the QName. /// </summary> /// <param name="qname">QName.</param> /// <returns></returns> IUriNode CreateUriNode(string qname); #endregion #region Selection /// <summary> /// Selects the Blank Node with the given ID if it exists in the Graph, returns null otherwise. /// </summary> /// <param name="nodeId">Node ID.</param> /// <returns>The Node if it exists in the Graph or null.</returns> IBlankNode GetBlankNode(string nodeId); /// <summary> /// Selects the Literal Node with the given Value and Language if it exists in the Graph, returns null otherwise. /// </summary> /// <param name="literal">Value of the Literal.</param> /// <param name="langspec">Language Specifier of the Literal.</param> /// <returns>The Node if it exists in the Graph or null.</returns> ILiteralNode GetLiteralNode(string literal, string langspec); /// <summary> /// Selects the Literal Node with the given Value if it exists in the Graph, returns null otherwise. /// </summary> /// <param name="literal">Value of the Literal.</param> /// <returns>The Node if it exists in the Graph or null.</returns> ILiteralNode GetLiteralNode(string literal); /// <summary> /// Selects the Literal Node with the given Value and DataType if it exists in the Graph, returns otherwise. /// </summary> /// <param name="literal">Value of the Literal.</param> /// <param name="datatype">Data Type of the Literal.</param> /// <returns>The Node if it exists in the Graph or null.</returns> ILiteralNode GetLiteralNode(string literal, Uri datatype); /// <summary> /// Selects all Triples which have a Uri Node with the given Uri. /// </summary> /// <param name="uri">Uri.</param> /// <returns></returns> IEnumerable<Triple> GetTriples(Uri uri); /// <summary> /// Selects all Triples which contain the given Node. /// </summary> /// <param name="n">Node.</param> /// <returns></returns> IEnumerable<Triple> GetTriples(INode n); /// <summary> /// Selects all Triples where the Object is a Uri Node with the given Uri. /// </summary> /// <param name="u">Uri.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithObject(Uri u); /// <summary> /// Selects all Triples where the Object is a given Node. /// </summary> /// <param name="n">Node.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithObject(INode n); /// <summary> /// Selects all Triples where the Predicate is a given Node. /// </summary> /// <param name="n">Node.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithPredicate(INode n); /// <summary> /// Selects all Triples where the Predicate is a Uri Node with the given Uri. /// </summary> /// <param name="u">Uri.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithPredicate(Uri u); /// <summary> /// Selects all Triples where the Subject is a given Node. /// </summary> /// <param name="n">Node.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithSubject(INode n); /// <summary> /// Selects all Triples where the Subject is a Uri Node with the given Uri. /// </summary> /// <param name="u">Uri.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithSubject(Uri u); /// <summary> /// Selects all Triples with the given Subject and Predicate. /// </summary> /// <param name="subj">Subject.</param> /// <param name="pred">Predicate.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred); /// <summary> /// Selects all Triples with the given Subject and Object. /// </summary> /// <param name="subj">Subject.</param> /// <param name="obj">Object.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj); /// <summary> /// Selects all Triples with the given Predicate and Object. /// </summary> /// <param name="pred">Predicate.</param> /// <param name="obj">Object.</param> /// <returns></returns> IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj); /// <summary> /// Selects the Uri Node with the given QName if it exists in the Graph, returns null otherwise. /// </summary> /// <param name="qname">QName.</param> /// <returns>The Node if it exists in the Graph or null.</returns> IUriNode GetUriNode(string qname); /// <summary> /// Selects the Uri Node with the given Uri if it exists in the Graph, returns null otherwise. /// </summary> /// <param name="uri">Uri.</param> /// <returns>The Node if it exists in the Graph or null.</returns> IUriNode GetUriNode(Uri uri); /// <summary> /// Gets whether a given Triple is in this Graph. /// </summary> /// <param name="t">Triple to test.</param> /// <returns></returns> bool ContainsTriple(Triple t); #endregion #region Advanced Graph Operations /// <summary> /// Merges the given Graph into this Graph. /// </summary> /// <param name="g">Graph to merge.</param> /// <remarks> /// <para> /// The Graph should raise the <see cref="MergeRequested">MergeRequested</see> event at the start of the Merge operation and abort the operation if the operation is cancelled by an event handler. On completing the Merge the <see cref="Merged">Merged</see> event should be raised. /// </para> /// </remarks> void Merge(IGraph g); /// <summary> /// Merges the given Graph into this Graph. /// </summary> /// <param name="g">Graph to merge.</param> /// <param name="keepOriginalGraphUri">Indicates that the Merge should preserve the Graph URIs of Nodes.</param> /// <remarks> /// <para> /// The Graph should raise the <see cref="MergeRequested">MergeRequested</see> event at the start of the Merge operation and abort the operation if the operation is cancelled by an event handler. On completing the Merge the <see cref="Merged">Merged</see> event should be raised. /// </para> /// </remarks> void Merge(IGraph g, bool keepOriginalGraphUri); /// <summary> /// Checks whether a Graph is equal to another Graph and if so returns the mapping of Blank Nodes. /// </summary> /// <param name="g">Graph to compare with.</param> /// <param name="mapping">Mapping of Blank Nodes.</param> /// <returns></returns> bool Equals(IGraph g, out Dictionary<INode, INode> mapping); /// <summary> /// Checks whether this Graph is a sub-graph of the given Graph. /// </summary> /// <param name="g">Graph.</param> /// <returns></returns> bool IsSubGraphOf(IGraph g); /// <summary> /// Checks whether this Graph is a sub-graph of the given Graph. /// </summary> /// <param name="g">Graph.</param> /// <param name="mapping">Mapping of Blank Nodes.</param> /// <returns></returns> bool IsSubGraphOf(IGraph g, out Dictionary<INode, INode> mapping); /// <summary> /// Checks whether this Graph has the given Graph as a sub-graph. /// </summary> /// <param name="g">Graph.</param> /// <returns></returns> bool HasSubGraph(IGraph g); /// <summary> /// Checks whether this Graph has the given Graph as a sub-graph. /// </summary> /// <param name="g">Graph.</param> /// <param name="mapping">Mapping of Blank Nodes.</param> /// <returns></returns> bool HasSubGraph(IGraph g, out Dictionary<INode, INode> mapping); /// <summary> /// Calculates the difference between this Graph and the given Graph. /// </summary> /// <param name="g">Graph.</param> /// <returns></returns> /// <remarks> /// <para> /// Produces a report which shows the changes that must be made to this Graph to produce the given Graph. /// </para> /// </remarks> GraphDiffReport Difference(IGraph g); #endregion #region Helper Functions /// <summary> /// Resolves a QName into a URI using the Namespace Map and Base URI of this Graph. /// </summary> /// <param name="qname">QName.</param> /// <returns></returns> Uri ResolveQName(String qname); #endregion #region Events /// <summary> /// Event which is raised when a Triple is asserted in the Graph /// </summary> /// <remarks> /// Whenever this event is raised the <see cref="Changed">Changed</see> event should also be raised /// </remarks> event TripleEventHandler TripleAsserted; /// <summary> /// Event which is raised when a Triple is retracted from the Graph /// </summary> /// <remarks> /// Whenever this event is raised the <see cref="Changed">Changed</see> event should also be raised /// </remarks> event TripleEventHandler TripleRetracted; /// <summary> /// Event which is raised when the Graph contents change /// </summary> event GraphEventHandler Changed; /// <summary> /// Event which is raised just before the Graph is cleared of its contents /// </summary> event CancellableGraphEventHandler ClearRequested; /// <summary> /// Event which is raised after the Graph is cleared of its contents /// </summary> event GraphEventHandler Cleared; /// <summary> /// Event which is raised just before a Merge operation begins on the Graph /// </summary> event CancellableGraphEventHandler MergeRequested; /// <summary> /// Event which is raised when a Merge operation is completed on the Graph /// </summary> event GraphEventHandler Merged; #endregion } /// <summary> /// Interface for RDF Graphs which provide Transactions i.e. changes to them can be Flushed (committed) or Discard (rolled back) as desired. /// </summary> public interface ITransactionalGraph : IGraph { /// <summary> /// Flushes any changes to the Graph. /// </summary> void Flush(); /// <summary> /// Discards any changes to the Graph. /// </summary> void Discard(); } }
37.187215
366
0.585891
[ "MIT" ]
blackwork/dotnetrdf
Libraries/dotNetRDF/Core/IGraph.cs
16,288
C#
namespace Bytewizer.TinyCLR.Sntp { /// <summary> /// Represents the NTP/SNTP version number. /// </summary> public enum VersionNumber { /// <summary> /// Version 3. /// </summary> Version3 = 3, } }
18.214286
47
0.509804
[ "MIT" ]
bytewizer/microserver
src/Bytewizer.TinyCLR.Sntp/Sntp/VersionNumber.cs
257
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.Runtime.InteropServices; using Gdip = System.Drawing.SafeNativeMethods.Gdip; namespace System.Drawing.Imaging { [StructLayout(LayoutKind.Sequential)] public sealed class EncoderParameter : IDisposable { #pragma warning disable CS0618 // Legacy code: We don't care about using obsolete API's. [MarshalAs(UnmanagedType.Struct)] #pragma warning restore CS0618 private Guid _parameterGuid; // GUID of the parameter private int _numberOfValues; // Number of the parameter values private EncoderParameterValueType _parameterValueType; // Value type, like ValueTypeLONG etc. private IntPtr _parameterValue; // A pointer to the parameter values ~EncoderParameter() { Dispose(false); } /// <summary> /// Gets/Sets the Encoder for the EncoderPameter. /// </summary> public Encoder Encoder { get { return new Encoder(_parameterGuid); } set { _parameterGuid = value.Guid; } } /// <summary> /// Gets the EncoderParameterValueType object from the EncoderParameter. /// </summary> public EncoderParameterValueType Type { get { return _parameterValueType; } } /// <summary> /// Gets the EncoderParameterValueType object from the EncoderParameter. /// </summary> public EncoderParameterValueType ValueType { get { return _parameterValueType; } } /// <summary> /// Gets the NumberOfValues from the EncoderParameter. /// </summary> public int NumberOfValues { get { return _numberOfValues; } } public void Dispose() { Dispose(true); GC.KeepAlive(this); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { if (_parameterValue != IntPtr.Zero) Marshal.FreeHGlobal(_parameterValue); _parameterValue = IntPtr.Zero; } public EncoderParameter(Encoder encoder, byte value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeByte; _numberOfValues = 1; _parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(byte))); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteByte(_parameterValue, value); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, byte value, bool undefined) { _parameterGuid = encoder.Guid; if (undefined == true) _parameterValueType = EncoderParameterValueType.ValueTypeUndefined; else _parameterValueType = EncoderParameterValueType.ValueTypeByte; _numberOfValues = 1; _parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(byte))); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteByte(_parameterValue, value); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, short value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeShort; _numberOfValues = 1; _parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(short))); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteInt16(_parameterValue, value); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, long value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeLong; _numberOfValues = 1; _parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteInt32(_parameterValue, unchecked((int)value)); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, int numerator, int denominator) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeRational; _numberOfValues = 1; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(2 * size); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteInt32(_parameterValue, numerator); Marshal.WriteInt32(Add(_parameterValue, size), denominator); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, long rangebegin, long rangeend) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeLongRange; _numberOfValues = 1; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(2 * size); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteInt32(_parameterValue, unchecked((int)rangebegin)); Marshal.WriteInt32(Add(_parameterValue, size), unchecked((int)rangeend)); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeRationalRange; _numberOfValues = 1; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(4 * size); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.WriteInt32(_parameterValue, numerator1); Marshal.WriteInt32(Add(_parameterValue, size), demoninator1); Marshal.WriteInt32(Add(_parameterValue, 2 * size), numerator2); Marshal.WriteInt32(Add(_parameterValue, 3 * size), demoninator2); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, string value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeAscii; _numberOfValues = value.Length; _parameterValue = Marshal.StringToHGlobalAnsi(value); GC.KeepAlive(this); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); } public EncoderParameter(Encoder encoder, byte[] value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeByte; _numberOfValues = value.Length; _parameterValue = Marshal.AllocHGlobal(_numberOfValues); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.Copy(value, 0, _parameterValue, _numberOfValues); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, byte[] value, bool undefined) { _parameterGuid = encoder.Guid; if (undefined == true) _parameterValueType = EncoderParameterValueType.ValueTypeUndefined; else _parameterValueType = EncoderParameterValueType.ValueTypeByte; _numberOfValues = value.Length; _parameterValue = Marshal.AllocHGlobal(_numberOfValues); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.Copy(value, 0, _parameterValue, _numberOfValues); GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, short[] value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeShort; _numberOfValues = value.Length; int size = Marshal.SizeOf(typeof(short)); _parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * size)); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); Marshal.Copy(value, 0, _parameterValue, _numberOfValues); GC.KeepAlive(this); } public unsafe EncoderParameter(Encoder encoder, long[] value) { _parameterGuid = encoder.Guid; _parameterValueType = EncoderParameterValueType.ValueTypeLong; _numberOfValues = value.Length; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * size)); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); int* dest = (int*)_parameterValue; fixed (long* source = value) { for (int i = 0; i < value.Length; i++) { dest[i] = unchecked((int)source[i]); } } GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, int[] numerator, int[] denominator) { _parameterGuid = encoder.Guid; if (numerator.Length != denominator.Length) throw Gdip.StatusException(Gdip.InvalidParameter); _parameterValueType = EncoderParameterValueType.ValueTypeRational; _numberOfValues = numerator.Length; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 2 * size)); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); for (int i = 0; i < _numberOfValues; i++) { Marshal.WriteInt32(Add(i * 2 * size, _parameterValue), (int)numerator[i]); Marshal.WriteInt32(Add((i * 2 + 1) * size, _parameterValue), (int)denominator[i]); } GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, long[] rangebegin, long[] rangeend) { _parameterGuid = encoder.Guid; if (rangebegin.Length != rangeend.Length) throw Gdip.StatusException(Gdip.InvalidParameter); _parameterValueType = EncoderParameterValueType.ValueTypeLongRange; _numberOfValues = rangebegin.Length; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 2 * size)); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); for (int i = 0; i < _numberOfValues; i++) { Marshal.WriteInt32(Add(i * 2 * size, _parameterValue), unchecked((int)rangebegin[i])); Marshal.WriteInt32(Add((i * 2 + 1) * size, _parameterValue), unchecked((int)rangeend[i])); } GC.KeepAlive(this); } public EncoderParameter(Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2) { _parameterGuid = encoder.Guid; if (numerator1.Length != denominator1.Length || numerator1.Length != denominator2.Length || denominator1.Length != denominator2.Length) throw Gdip.StatusException(Gdip.InvalidParameter); _parameterValueType = EncoderParameterValueType.ValueTypeRationalRange; _numberOfValues = numerator1.Length; int size = Marshal.SizeOf(typeof(int)); _parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 4 * size)); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); for (int i = 0; i < _numberOfValues; i++) { Marshal.WriteInt32(Add(_parameterValue, 4 * i * size), numerator1[i]); Marshal.WriteInt32(Add(_parameterValue, (4 * i + 1) * size), denominator1[i]); Marshal.WriteInt32(Add(_parameterValue, (4 * i + 2) * size), numerator2[i]); Marshal.WriteInt32(Add(_parameterValue, (4 * i + 3) * size), denominator2[i]); } GC.KeepAlive(this); } [Obsolete("This constructor has been deprecated. Use EncoderParameter(Encoder encoder, int numberValues, EncoderParameterValueType type, IntPtr value) instead. https://go.microsoft.com/fwlink/?linkid=14202")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public EncoderParameter(Encoder encoder, int NumberOfValues, int Type, int Value) { int size; switch ((EncoderParameterValueType)Type) { case EncoderParameterValueType.ValueTypeByte: case EncoderParameterValueType.ValueTypeAscii: size = 1; break; case EncoderParameterValueType.ValueTypeShort: size = 2; break; case EncoderParameterValueType.ValueTypeLong: size = 4; break; case EncoderParameterValueType.ValueTypeRational: case EncoderParameterValueType.ValueTypeLongRange: size = 2 * 4; break; case EncoderParameterValueType.ValueTypeUndefined: size = 1; break; case EncoderParameterValueType.ValueTypeRationalRange: size = 2 * 2 * 4; break; default: throw Gdip.StatusException(Gdip.WrongState); } int bytes = checked(size * NumberOfValues); _parameterValue = Marshal.AllocHGlobal(bytes); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); for (int i = 0; i < bytes; i++) { Marshal.WriteByte(Add(_parameterValue, i), Marshal.ReadByte((IntPtr)(Value + i))); } _parameterValueType = (EncoderParameterValueType)Type; _numberOfValues = NumberOfValues; _parameterGuid = encoder.Guid; GC.KeepAlive(this); } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] public EncoderParameter(Encoder encoder, int numberValues, EncoderParameterValueType type, IntPtr value) { int size; switch (type) { case EncoderParameterValueType.ValueTypeByte: case EncoderParameterValueType.ValueTypeAscii: size = 1; break; case EncoderParameterValueType.ValueTypeShort: size = 2; break; case EncoderParameterValueType.ValueTypeLong: size = 4; break; case EncoderParameterValueType.ValueTypeRational: case EncoderParameterValueType.ValueTypeLongRange: size = 2 * 4; break; case EncoderParameterValueType.ValueTypeUndefined: size = 1; break; case EncoderParameterValueType.ValueTypeRationalRange: size = 2 * 2 * 4; break; default: throw Gdip.StatusException(Gdip.WrongState); } int bytes = checked(size * numberValues); _parameterValue = Marshal.AllocHGlobal(bytes); if (_parameterValue == IntPtr.Zero) throw Gdip.StatusException(Gdip.OutOfMemory); for (int i = 0; i < bytes; i++) { Marshal.WriteByte(Add(_parameterValue, i), Marshal.ReadByte((IntPtr)(value + i))); } _parameterValueType = type; _numberOfValues = numberValues; _parameterGuid = encoder.Guid; GC.KeepAlive(this); } private static IntPtr Add(IntPtr a, int b) { return (IntPtr)((long)a + (long)b); } private static IntPtr Add(int a, IntPtr b) { return (IntPtr)((long)a + (long)b); } } }
36.505176
217
0.577359
[ "MIT" ]
2E0PGS/corefx
src/System.Drawing.Common/src/System/Drawing/Imaging/EncoderParameter.cs
17,632
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Threading; using Microsoft.Win32.SafeHandles; using System.Diagnostics; namespace System.Net.Sockets { public partial class SafeSocketHandle { private int _receiveTimeout = -1; private int _sendTimeout = -1; private bool _nonBlocking; private bool _underlyingHandleNonBlocking; private SocketAsyncContext _asyncContext; private TrackedSocketOptions _trackedOptions; internal bool LastConnectFailed { get; set; } internal bool DualMode { get; set; } internal bool ExposedHandleOrUntrackedConfiguration { get; private set; } internal void RegisterConnectResult(SocketError error) { switch (error) { case SocketError.Success: case SocketError.WouldBlock: break; default: LastConnectFailed = true; break; } } internal void TransferTrackedState(SafeSocketHandle target) { target._trackedOptions = _trackedOptions; target.LastConnectFailed = LastConnectFailed; target.DualMode = DualMode; target.ExposedHandleOrUntrackedConfiguration = ExposedHandleOrUntrackedConfiguration; } internal void SetExposed() => ExposedHandleOrUntrackedConfiguration = true; internal bool IsTrackedOption(TrackedSocketOptions option) => (_trackedOptions & option) != 0; internal void TrackOption(SocketOptionLevel level, SocketOptionName name) { // As long as only these options are set, we can support Connect{Async}(IPAddress[], ...). switch (level) { case SocketOptionLevel.Tcp: switch (name) { case SocketOptionName.NoDelay: _trackedOptions |= TrackedSocketOptions.NoDelay; return; } break; case SocketOptionLevel.IP: switch (name) { case SocketOptionName.DontFragment: _trackedOptions |= TrackedSocketOptions.DontFragment; return; case SocketOptionName.IpTimeToLive: _trackedOptions |= TrackedSocketOptions.Ttl; return; } break; case SocketOptionLevel.IPv6: switch (name) { case SocketOptionName.IPv6Only: _trackedOptions |= TrackedSocketOptions.DualMode; return; case SocketOptionName.IpTimeToLive: _trackedOptions |= TrackedSocketOptions.Ttl; return; } break; case SocketOptionLevel.Socket: switch (name) { case SocketOptionName.Broadcast: _trackedOptions |= TrackedSocketOptions.EnableBroadcast; return; case SocketOptionName.Linger: _trackedOptions |= TrackedSocketOptions.LingerState; return; case SocketOptionName.ReceiveBuffer: _trackedOptions |= TrackedSocketOptions.ReceiveBufferSize; return; case SocketOptionName.ReceiveTimeout: _trackedOptions |= TrackedSocketOptions.ReceiveTimeout; return; case SocketOptionName.SendBuffer: _trackedOptions |= TrackedSocketOptions.SendBufferSize; return; case SocketOptionName.SendTimeout: _trackedOptions |= TrackedSocketOptions.SendTimeout; return; } break; } // For any other settings, we need to track that they were used so that we can error out // if a Connect{Async}(IPAddress[],...) attempt is made. ExposedHandleOrUntrackedConfiguration = true; } internal SocketAsyncContext AsyncContext { get { if (Volatile.Read(ref _asyncContext) == null) { Interlocked.CompareExchange(ref _asyncContext, new SocketAsyncContext(this), null); } return _asyncContext; } } // This will set the underlying OS handle to be nonblocking, for whatever reason -- // performing an async operation or using a timeout will cause this to happen. // Once the OS handle is nonblocking, it never transitions back to blocking. private void SetHandleNonBlocking() { // We don't care about synchronization because this is idempotent if (!_underlyingHandleNonBlocking) { AsyncContext.SetNonBlocking(); _underlyingHandleNonBlocking = true; } } internal bool IsNonBlocking { get { return _nonBlocking; } set { _nonBlocking = value; // // If transitioning to non-blocking, we need to set the native socket to non-blocking mode. // If we ever transition back to blocking, we keep the native socket in non-blocking mode, and emulate // blocking. This avoids problems with switching to native blocking while there are pending async // operations. // if (value) { SetHandleNonBlocking(); } } } internal bool IsUnderlyingBlocking { get { return !_underlyingHandleNonBlocking; } } internal int ReceiveTimeout { get { return _receiveTimeout; } set { Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}"); _receiveTimeout = value; } } internal int SendTimeout { get { return _sendTimeout; } set { Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}"); _sendTimeout = value; } } internal bool IsDisconnected { get; private set; } = false; internal void SetToDisconnected() { IsDisconnected = true; } /// <returns>Returns whether operations were canceled.</returns> private bool OnHandleClose() { // If we've aborted async operations, return true to cause an abortive close. return _asyncContext?.StopAndAbort() ?? false; } /// <returns>Returns whether operations were canceled.</returns> private unsafe bool TryUnblockSocket(bool abortive) { // Calling 'close' on a socket that has pending blocking calls (e.g. recv, send, accept, ...) // may block indefinitely. This is a best-effort attempt to not get blocked and make those operations return. // We need to ensure we keep the expected TCP behavior that is observed by the socket peer (FIN vs RST close). // What we do here isn't specified by POSIX and doesn't work on all OSes. // On Linux this works well. // On OSX, TCP connections will be closed with a FIN close instead of an abortive RST close. // And, pending TCP connect operations and UDP receive are not abortable. // Unless we're doing an abortive close, don't touch sockets which don't have the CLOEXEC flag set. // These may be shared with other processes and we want to avoid disconnecting them. if (!abortive) { int fdFlags = Interop.Sys.Fcntl.GetFD(handle); if (fdFlags == 0) { return false; } } int type = 0; int optLen = sizeof(int); Interop.Error err = Interop.Sys.GetSockOpt(handle, SocketOptionLevel.Socket, SocketOptionName.Type, (byte*)&type, &optLen); if (err == Interop.Error.SUCCESS) { // For TCP (SocketType.Stream), perform an abortive close. // Unless the user requested a normal close using Socket.Shutdown. if (type == (int)SocketType.Stream && !_hasShutdownSend) { Interop.Sys.Disconnect(handle); } else { Interop.Sys.Shutdown(handle, SocketShutdown.Both); } } return true; } private unsafe SocketError DoCloseHandle(bool abortive) { Interop.Error errorCode = Interop.Error.SUCCESS; // If abortive is not set, we're not running on the finalizer thread, so it's safe to block here. // We can honor the linger options set on the socket. It also means closesocket() might return // EWOULDBLOCK, in which case we need to do some recovery. if (!abortive) { if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"handle:{handle} Following 'non-abortive' branch."); // Close, and if its errno is other than EWOULDBLOCK, there's nothing more to do - we either succeeded or failed. errorCode = CloseHandle(handle); if (errorCode != Interop.Error.EWOULDBLOCK) { return SocketPal.GetSocketErrorForErrorCode(errorCode); } // The socket must be non-blocking with a linger timeout set. // We have to set the socket to blocking. if (Interop.Sys.Fcntl.DangerousSetIsNonBlocking(handle, 0) == 0) { // The socket successfully made blocking; retry the close(). return SocketPal.GetSocketErrorForErrorCode(CloseHandle(handle)); } // The socket could not be made blocking; fall through to the regular abortive close. } // By default or if the non-abortive path failed, set linger timeout to zero to get an abortive close (RST). var linger = new Interop.Sys.LingerOption { OnOff = 1, Seconds = 0 }; errorCode = Interop.Sys.SetLingerOption(handle, &linger); #if DEBUG _closeSocketLinger = SocketPal.GetSocketErrorForErrorCode(errorCode); #endif if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"handle:{handle}, setsockopt():{errorCode}"); switch (errorCode) { case Interop.Error.SUCCESS: case Interop.Error.EINVAL: case Interop.Error.ENOPROTOOPT: errorCode = CloseHandle(handle); break; // For other errors, it's too dangerous to try closesocket() - it might block! } return SocketPal.GetSocketErrorForErrorCode(errorCode); } private Interop.Error CloseHandle(IntPtr handle) { Interop.Error errorCode = Interop.Error.SUCCESS; bool remappedError = false; if (Interop.Sys.Close(handle) != 0) { errorCode = Interop.Sys.GetLastError(); if (errorCode == Interop.Error.ECONNRESET) { // Some Unix platforms (e.g. FreeBSD) non-compliantly return ECONNRESET from close(). // For our purposes, we want to ignore such a "failure" and treat it as success. // In such a case, the file descriptor was still closed and there's no corrective // action to take. errorCode = Interop.Error.SUCCESS; remappedError = true; } } if (NetEventSource.IsEnabled) { NetEventSource.Info(this, remappedError ? $"handle:{handle}, close():ECONNRESET, but treating it as SUCCESS" : $"handle:{handle}, close():{errorCode}"); } #if DEBUG _closeSocketResult = SocketPal.GetSocketErrorForErrorCode(errorCode); #endif return errorCode; } } /// <summary>Flags that correspond to exposed options on Socket.</summary> [Flags] internal enum TrackedSocketOptions : short { DontFragment = 0x1, DualMode = 0x2, EnableBroadcast = 0x4, LingerState = 0x8, NoDelay = 0x10, ReceiveBufferSize = 0x20, ReceiveTimeout = 0x40, SendBufferSize = 0x80, SendTimeout = 0x100, Ttl = 0x200, } }
38.699708
135
0.556351
[ "MIT" ]
939481896/dotnet-corefx
src/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.Unix.cs
13,274
C#
using System; using System.Windows.Markup; namespace TerrLauncherPackCreator.Code.MarkupExtensions { public class BooleanExtension : MarkupExtension { private static readonly object FalseObject = false; private static readonly object TrueObject = true; private readonly object _value; public BooleanExtension(bool value) { _value = value ? TrueObject : FalseObject; } public override object ProvideValue(IServiceProvider serviceProvider) => _value; } }
27.25
88
0.682569
[ "MIT" ]
And42/TerrLauncherPackCreator
TerrLauncherPackCreator/Code/MarkupExtensions/BooleanExtension.cs
547
C#
// Copyright (c) 2019-2021 Ryujinx // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // using Ryujinx.Audio.Integration; namespace Ryujinx.Audio.Common { /// <summary> /// Represent an audio buffer that will be used by an <see cref="HardwareDeviceSession"/>. /// </summary> public class AudioBuffer { /// <summary> /// Unique tag of this buffer. /// </summary> /// <remarks>Unique per session</remarks> public ulong BufferTag; /// <summary> /// Pointer to the user samples. /// </summary> public ulong DataPointer; /// <summary> /// Size of the user samples region. /// </summary> public ulong DataSize; /// <summary> /// Played at witch the buffer was played. /// </summary> /// <remarks>Not used but useful for debugging.</remarks> public ulong PlayedTimestamp; /// <summary> /// The user samples. /// </summary> public byte[] Data; } }
30.87037
94
0.628074
[ "MIT" ]
rubikex/Ryujinx
Ryujinx.Audio/Common/AudioBuffer.cs
1,669
C#
// <auto-generated> // Auto-generated by StoneAPI, do not modify. // </auto-generated> namespace Dropbox.Api.TeamLog { using sys = System; using col = System.Collections.Generic; using re = System.Text.RegularExpressions; using enc = Dropbox.Api.Stone; /// <summary> /// <para>The file permanently delete type object</para> /// </summary> public class FilePermanentlyDeleteType { #pragma warning disable 108 /// <summary> /// <para>The encoder instance.</para> /// </summary> internal static enc.StructEncoder<FilePermanentlyDeleteType> Encoder = new FilePermanentlyDeleteTypeEncoder(); /// <summary> /// <para>The decoder instance.</para> /// </summary> internal static enc.StructDecoder<FilePermanentlyDeleteType> Decoder = new FilePermanentlyDeleteTypeDecoder(); /// <summary> /// <para>Initializes a new instance of the <see cref="FilePermanentlyDeleteType" /> /// class.</para> /// </summary> /// <param name="description">The description</param> public FilePermanentlyDeleteType(string description) { if (description == null) { throw new sys.ArgumentNullException("description"); } this.Description = description; } /// <summary> /// <para>Initializes a new instance of the <see cref="FilePermanentlyDeleteType" /> /// class.</para> /// </summary> /// <remarks>This is to construct an instance of the object when /// deserializing.</remarks> [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] public FilePermanentlyDeleteType() { } /// <summary> /// <para>Gets the description of the file permanently delete type</para> /// </summary> public string Description { get; protected set; } #region Encoder class /// <summary> /// <para>Encoder for <see cref="FilePermanentlyDeleteType" />.</para> /// </summary> private class FilePermanentlyDeleteTypeEncoder : enc.StructEncoder<FilePermanentlyDeleteType> { /// <summary> /// <para>Encode fields of given value.</para> /// </summary> /// <param name="value">The value.</param> /// <param name="writer">The writer.</param> public override void EncodeFields(FilePermanentlyDeleteType value, enc.IJsonWriter writer) { WriteProperty("description", value.Description, writer, enc.StringEncoder.Instance); } } #endregion #region Decoder class /// <summary> /// <para>Decoder for <see cref="FilePermanentlyDeleteType" />.</para> /// </summary> private class FilePermanentlyDeleteTypeDecoder : enc.StructDecoder<FilePermanentlyDeleteType> { /// <summary> /// <para>Create a new instance of type <see cref="FilePermanentlyDeleteType" /// />.</para> /// </summary> /// <returns>The struct instance.</returns> protected override FilePermanentlyDeleteType Create() { return new FilePermanentlyDeleteType(); } /// <summary> /// <para>Set given field.</para> /// </summary> /// <param name="value">The field value.</param> /// <param name="fieldName">The field name.</param> /// <param name="reader">The json reader.</param> protected override void SetField(FilePermanentlyDeleteType value, string fieldName, enc.IJsonReader reader) { switch (fieldName) { case "description": value.Description = enc.StringDecoder.Instance.Decode(reader); break; default: reader.Skip(); break; } } } #endregion } }
34.286885
119
0.559646
[ "MIT" ]
AlirezaMaddah/dropbox-sdk-dotnet
dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FilePermanentlyDeleteType.cs
4,183
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Reflection; using System.Text.Encodings.Web; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Mvc.Razor { /// <inheritdoc /> public class RazorPageActivator : IRazorPageActivator { // Name of the "public TModel Model" property on RazorPage<TModel> private const string ModelPropertyName = "Model"; private readonly ConcurrentDictionary<CacheKey, RazorPagePropertyActivator> _activationInfo; private readonly IModelMetadataProvider _metadataProvider; // Value accessors for common singleton properties activated in a RazorPage. private readonly RazorPagePropertyActivator.PropertyValueAccessors _propertyAccessors; /// <summary> /// Initializes a new instance of the <see cref="RazorPageActivator"/> class. /// </summary> public RazorPageActivator( IModelMetadataProvider metadataProvider, IUrlHelperFactory urlHelperFactory, IJsonHelper jsonHelper, DiagnosticSource diagnosticSource, HtmlEncoder htmlEncoder, IModelExpressionProvider modelExpressionProvider) { _activationInfo = new ConcurrentDictionary<CacheKey, RazorPagePropertyActivator>(); _metadataProvider = metadataProvider; _propertyAccessors = new RazorPagePropertyActivator.PropertyValueAccessors { UrlHelperAccessor = context => urlHelperFactory.GetUrlHelper(context), JsonHelperAccessor = context => jsonHelper, DiagnosticSourceAccessor = context => diagnosticSource, HtmlEncoderAccessor = context => htmlEncoder, ModelExpressionProviderAccessor = context => modelExpressionProvider, }; } /// <inheritdoc /> public void Activate(IRazorPage page, ViewContext context) { if (page == null) { throw new ArgumentNullException(nameof(page)); } if (context == null) { throw new ArgumentNullException(nameof(context)); } var propertyActivator = GetOrAddCacheEntry(page); propertyActivator.Activate(page, context); } internal RazorPagePropertyActivator GetOrAddCacheEntry(IRazorPage page) { var pageType = page.GetType(); Type providedModelType = null; if (page is IModelTypeProvider modelTypeProvider) { providedModelType = modelTypeProvider.GetModelType(); } // We only need to vary by providedModelType since it varies at runtime. Defined model type // is synonymous with the pageType and consequently does not need to be accounted for in the cache key. var cacheKey = new CacheKey(pageType, providedModelType); if (!_activationInfo.TryGetValue(cacheKey, out var propertyActivator)) { // Look for a property named "Model". If it is non-null, we'll assume this is // the equivalent of TModel Model property on RazorPage<TModel>. // // Otherwise if we don't have a model property the activator will just skip setting // the view data. var modelType = providedModelType; if (modelType == null) { modelType = pageType.GetRuntimeProperty(ModelPropertyName)?.PropertyType; } propertyActivator = new RazorPagePropertyActivator( pageType, modelType, _metadataProvider, _propertyAccessors); propertyActivator = _activationInfo.GetOrAdd(cacheKey, propertyActivator); } return propertyActivator; } private readonly struct CacheKey : IEquatable<CacheKey> { public CacheKey(Type pageType, Type providedModelType) { PageType = pageType; ProvidedModelType = providedModelType; } public Type PageType { get; } public Type ProvidedModelType { get; } public bool Equals(CacheKey other) { return PageType == other.PageType && ProvidedModelType == other.ProvidedModelType; } public override int GetHashCode() { var hashCodeCombiner = new HashCode(); hashCodeCombiner.Add(PageType); if (ProvidedModelType != null) { hashCodeCombiner.Add(ProvidedModelType); } return hashCodeCombiner.ToHashCode(); } } } }
38.620438
115
0.611983
[ "Apache-2.0" ]
1kevgriff/aspnetcore
src/Mvc/Mvc.Razor/src/RazorPageActivator.cs
5,291
C#
using NBitcoin; using System; using System.Collections.Immutable; using System.Linq; using WalletWasabi.WabiSabi.Backend.Models; namespace WalletWasabi.WabiSabi.Models.MultipartyTransaction { // This class represents actions of the BIP 370 creator and constructor roles public record ConstructionState(MultipartyTransactionParameters Parameters) : IState { public ImmutableList<Coin> Inputs { get; init; } = ImmutableList<Coin>.Empty; public ImmutableList<TxOut> Outputs { get; init; } = ImmutableList<TxOut>.Empty; public Money Balance => Inputs.Sum(x => x.Amount) - Outputs.Sum(x => x.Value); public int EstimatedInputsVsize => Inputs.Sum(x => x.TxOut.ScriptPubKey.EstimateInputVsize()); public int OutputsVsize => Outputs.Sum(x => x.ScriptPubKey.EstimateOutputVsize()); public int EstimatedVsize => MultipartyTransactionParameters.SharedOverhead + EstimatedInputsVsize + OutputsVsize; public FeeRate EffectiveFeeRate => new FeeRate(Balance, EstimatedVsize); // TODO ownership proofs and spend status also in scope public ConstructionState AddInput(Coin coin) { var prevout = coin.TxOut; if (prevout.Value <= Parameters.FeeRate.GetFee(prevout.ScriptPubKey.EstimateInputVsize())) { // Inputs must contribute more than they cost to spend because: // - Such inputs contribute nothing to privacy and may degrade it // because they must be paid for, when constraining sub-transactions // this may be useful for disambiguating between different input // clusters in the same way that the existence of a dust output // might. // - Space in standard transaction is limited and must be shared // between participants. throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.UneconomicalInput); } if (prevout.Value < Parameters.AllowedInputAmounts.Min) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.NotEnoughFunds); } if (prevout.Value > Parameters.AllowedInputAmounts.Max) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.TooMuchFunds); } if (!StandardScripts.IsStandardScriptPubKey(prevout.ScriptPubKey)) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.NonStandardInput); } if (!prevout.ScriptPubKey.IsScriptType(ScriptType.P2WPKH)) { throw new NotImplementedException(); // See #5440 } if (!Parameters.AllowedInputTypes.Any(x => prevout.ScriptPubKey.IsScriptType(x))) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.ScriptNotAllowed); } if (Inputs.Any(x => x.Outpoint == coin.Outpoint)) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.NonUniqueInputs); } return this with { Inputs = Inputs.Add(coin) }; } public ConstructionState AddOutput(TxOut output) { if (output.Value < Parameters.AllowedOutputAmounts.Min) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.NotEnoughFunds); } if (output.Value > Parameters.AllowedOutputAmounts.Max) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.TooMuchFunds); } if (output.IsDust(Parameters.MinRelayTxFee)) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.DustOutput); } if (!StandardScripts.IsStandardScriptPubKey(output.ScriptPubKey)) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.NonStandardOutput); } // Only one OP_RETURN is allowed per standard transaction, but this // check is not implemented since there is no OP_RETURN ScriptType, // which means no OP_RETURN outputs can be registered at all. if (!Parameters.AllowedOutputTypes.Any(x => output.ScriptPubKey.IsScriptType(x))) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.ScriptNotAllowed); } return this with { Outputs = Outputs.Add(output) }; } public SigningState Finalize() { if (EstimatedVsize > Parameters.MaxTransactionSize) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.SizeLimitExceeded); } if (EffectiveFeeRate < Parameters.FeeRate) { throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.InsufficientFees); } return new SigningState(Parameters, Inputs.ToImmutableArray(), Outputs.ToImmutableArray()); } } }
35.61157
116
0.757252
[ "MIT" ]
catenocrypt/WalletWasabi
WalletWasabi/WabiSabi/Models/MultipartyTransaction/ConstructionState.cs
4,309
C#
// IglooLotEditButton using ClubPenguin.Igloo; using Disney.LaunchPadFramework; using Disney.MobileNetwork; using UnityEngine; using UnityEngine.UI; [RequireComponent(typeof(Button))] public class IglooLotEditButton : MonoBehaviour { public void OnButtonClick() { Service.Get<EventDispatcher>().DispatchEvent(default(IglooUIEvents.LotNextButtonPressed)); } }
22.8125
92
0.813699
[ "MIT" ]
smdx24/CPI-Source-Code
ClubPenguin.Igloo.UI/IglooLotEditButton.cs
365
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Globalization; using System.Linq; using System.Text; using BLToolkit.DataAccess; using BLToolkit.Mapping; using Kesco.ComponentModel.DataAnnotations; using Kesco.Localization; using Kesco.ObjectModel; namespace Kesco.Common { public struct HelpTopicID { public string ID { get; set; } public string Culture { get; set; } public override string ToString() { return String.Format("{0}-{1}", ID, Culture); } } public abstract class HelpTopic : Entity<HelpTopic, HelpTopicID> { [MapField("КодТемыСправки"), PrimaryKey, NonUpdatable] [Display(ResourceType = typeof(Resources), Name="HelpTopic_ID_Display_Name")] [UIHint("UniqueID")] public override HelpTopicID ID { get; set; } [MapField("ТемаСправки")] [Display(ResourceType = typeof(Resources), Name="HelpTopic_Subject_Display_Name")] public string Subject { get; set; } [MapField("СодержаниеСправки")] [Display(ResourceType = typeof(Resources), Name="HelpTopic_Content_Display_Name")] public string Content { get; set; } } }
25.173913
84
0.750432
[ "MIT" ]
Kesco-m/Kesco.App.Web.MVC.Persons
Kesco.ApplicationServices/ObjectModel/HelpTopic.cs
1,202
C#
#region License // Copyright (c) 2011, ClearCanvas Inc. // All rights reserved. // http://www.clearcanvas.ca // // This software is licensed under the Open Software License v3.0. // For the complete license, see http://www.clearcanvas.ca/OSLv3.0 #endregion using System.Collections.Generic; using ClearCanvas.Common; using ClearCanvas.Desktop; namespace ClearCanvas.ImageViewer.Utilities.StudyFilters { [ExtensionPoint] public sealed class ColumnPickerComponentViewExtensionPoint : ExtensionPoint<IApplicationComponentView> {} [AssociateView(typeof (ColumnPickerComponentViewExtensionPoint))] public class ColumnPickerComponent : ApplicationComponent { private readonly List<StudyFilterColumn.ColumnDefinition> _columns; public ColumnPickerComponent() { _columns = new List<StudyFilterColumn.ColumnDefinition>(); } public ColumnPickerComponent(IEnumerable<StudyFilterColumn> columns) : this() { foreach (StudyFilterColumn column in columns) { _columns.Add(StudyFilterColumn.GetColumnDefinition(column.Key)); } } public IList<StudyFilterColumn.ColumnDefinition> Columns { get { return _columns; } } } }
27.204545
108
0.750209
[ "Apache-2.0" ]
SNBnani/Xian
ImageViewer/Utilities/StudyFilters/ColumnPickerComponent.cs
1,197
C#
#region COPYRIGHT© 2009-2014 Phillip Clark. All rights reserved. // For licensing information see License.txt (MIT style licensing). #endregion using System; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; using System.Threading; using FlitBit.Core; using FlitBit.Emit; namespace FlitBit.Copy { internal static class CopierTypeFactory { private static readonly MethodInfo GenericCreateType = typeof (CopierTypeFactory).MatchGenericMethod("ConcreteType", BindingFlags.Static | BindingFlags.NonPublic, 2, typeof (Type)); private static readonly Lazy<EmittedModule> Module = new Lazy<EmittedModule>(() => RuntimeAssemblies.DynamicAssembly.DefineModule("Copiers", null), LazyThreadSafetyMode.ExecutionAndPublication ); private static EmittedModule GeneratedModule { get { return Module.Value; } } internal static Type ConcreteType(Type sourceType, Type targetType) { Contract.Requires<ArgumentNullException>(sourceType != null); Contract.Requires<ArgumentNullException>(targetType != null); Contract.Ensures(Contract.Result<Type>() != null); MethodInfo method = GenericCreateType.MakeGenericMethod(sourceType, targetType); return (Type) method.Invoke(null, null); } [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "By design.")] internal static Type ConcreteType<TSource, TTarget>() { Contract.Ensures(Contract.Result<Type>() != null); Type targetType = typeof (ICopier<TSource, TTarget>); string typeName = RuntimeAssemblies.PrepareTypeName(targetType, "Copier"); lock (targetType.GetLockForType()) { EmittedModule module = GeneratedModule; return module.Builder.GetType(typeName, false, false) ?? BuildCopierType<TSource, TTarget>(module, typeName); } } [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "By design.")] private static Type BuildCopierType<TSource, TTarget>(EmittedModule module, string typeName) { Contract.Requires<ArgumentNullException>(module != null); Contract.Requires<ArgumentNullException>(typeName != null); Contract.Requires<ArgumentException>(typeName.Length > 0); Contract.Ensures(Contract.Result<Type>() != null); EmittedClass builder = module.DefineClass(typeName, EmittedClass.DefaultTypeAttributes, typeof (Copier<TSource, TTarget>), null); builder.Attributes = TypeAttributes.Sealed | TypeAttributes.Public | TypeAttributes.BeforeFieldInit; ImplementPerformLooseCopy<TSource, TTarget>(builder); ImplementPerformStrictCopy<TSource, TTarget>(builder); builder.Compile(); return builder.Ref.Target; } private static void ImplementPerformLooseCopy<TSource, TTarget>(EmittedClass builder) { var baseMethod = typeof (Copier<TSource, TTarget>).GetMethod("PerformLooseCopy", BindingFlags.NonPublic | BindingFlags.Instance); var method = builder.DefineOverrideMethod(baseMethod); method.ContributeInstructions((m, il) => { foreach ( var prop in from src in typeof (TSource).GetReadablePropertiesFromHierarchy(BindingFlags.Instance | BindingFlags.Public) join dest in typeof (TTarget).GetWritablePropertiesFromHierarchy(BindingFlags.Instance | BindingFlags.Public) on src.Name equals dest.Name select new { Source = src, Destination = dest }) { if (!prop.Destination.PropertyType.IsAssignableFrom(prop.Source.PropertyType)) continue; // // result.<property-name> = src.<property-name>; // il.LoadArg_1(); il.LoadArg_2(); il.CallVirtual(prop.Source.GetGetMethod()); il.CallVirtual(prop.Destination.GetSetMethod()); //else if (!prop.Destination.PropertyType.IsValueType // && !prop.Source.PropertyType.IsValueType) //{ // // // // <source-property-type> temp_<n>; // // if (temp_<n> != null) // // { // // target.<property-name> = Factory<destination-property-type> // // .Copier<destination-property-type> // // .LooseCopy<source-property-type>(temp_<n>); // // } // // // var copierType = typeof(ICopier<,>).MakeGenericType(prop.Source.PropertyType, prop.Destination.PropertyType); // var localCopier = il.DeclareLocal(copierType); // il.LoadArg_3(); // il.Call(typeof(IContainerExtensions).GetGenericMethod("New", 1, 1).MakeGenericMethod(copierType)); // il.StoreLocal(localCopier); // il.LoadArg_1(); // il.LoadLocal(localCopier); // il.LoadArg_3(); // il.LoadArg_2(); // il.CallVirtual(prop.Source.GetGetMethod()); // il.LoadValue(CopyKind.Loose); // il.Call(typeof(ICopierExtensions).GetGenericMethod("Copy", 4, 2).MakeGenericMethod(prop.Source.PropertyType, prop.Destination.PropertyType)); // il.CallVirtual(prop.Destination.GetSetMethod()); // //} } }); } private static void ImplementPerformStrictCopy<TSource, TTarget>(EmittedClass builder) { MethodInfo baseMethod = typeof (Copier<TSource, TTarget>).GetMethod("PerformStrictCopy", BindingFlags.NonPublic | BindingFlags.Instance); EmittedMethod method = builder.DefineOverrideMethod(baseMethod); method.ContributeInstructions((m, il) => { var props = (from src in typeof (TSource).GetReadablePropertiesFromHierarchy(BindingFlags.Instance | BindingFlags.Public) select new { Source = src, Destination = typeof (TTarget).GetWritablePropertyWithAssignmentCompatablityFromHierarchy(src.Name, BindingFlags.Instance | BindingFlags.Public, src.PropertyType) }).ToArray(); if (props.FirstOrDefault(p => p.Destination == null) != null) { il.LoadValue( "Cannot perfrom a strict copy because the source and target do not have all properties in common."); il.New<InvalidOperationException>(typeof (string)); il.Throw(); } else { foreach (var p in props) { // // result.<property name> = src.<property name>; // il.LoadArg_1(); il.LoadArg_2(); il.CallVirtual(p.Source.GetGetMethod()); il.CallVirtual(p.Destination.GetSetMethod()); } } }); } } }
45.336957
165
0.532846
[ "MIT" ]
flitbit-org/fbcopy
FlitBit.Copy/CopierTypeFactory.cs
8,345
C#
using System.IO; using Nikki.Reflection.Abstract; using Nikki.Reflection.Attributes; namespace Nikki.Support.Underground1.Parts.InfoParts { /// <summary> /// A unit <see cref="Unknown"/> used in car performance. /// </summary> public class Unknown : SubPart { /// <summary> /// /// </summary> [AccessModifiable()] public float Unknown1 { get; set; } /// <summary> /// /// </summary> [AccessModifiable()] public float Unknown2 { get; set; } /// <summary> /// /// </summary> [AccessModifiable()] public float Unknown3 { get; set; } /// <summary> /// /// </summary> [AccessModifiable()] public float Unknown4 { get; set; } /// <summary> /// Initializes new instance of <see cref="Unknown"/>. /// </summary> public Unknown() { } /// <summary> /// Creates a plain copy of the objects that contains same values. /// </summary> /// <returns>Exact plain copy of the object.</returns> public override SubPart PlainCopy() { var result = new Unknown() { Unknown1 = this.Unknown1, Unknown2 = this.Unknown2, Unknown3 = this.Unknown3, Unknown4 = this.Unknown4 }; return result; } /// <summary> /// Reads data using <see cref="BinaryReader"/> provided. /// </summary> /// <param name="br"><see cref="BinaryReader"/> to read data with.</param> public void Read(BinaryReader br) { this.Unknown1 = br.ReadSingle(); this.Unknown2 = br.ReadSingle(); this.Unknown3 = br.ReadSingle(); this.Unknown4 = br.ReadSingle(); } /// <summary> /// Writes data using <see cref="BinaryWriter"/> provided. /// </summary> /// <param name="bw"><see cref="BinaryWriter"/> to write data with.</param> public void Write(BinaryWriter bw) { bw.Write(this.Unknown1); bw.Write(this.Unknown2); bw.Write(this.Unknown3); bw.Write(this.Unknown4); } } }
21.988235
77
0.623328
[ "MIT" ]
SpeedReflect/Nikki
Nikki/Support.Underground1/Parts/InfoParts/Unknown.cs
1,871
C#
using System; using System.ComponentModel; using EfsTools.Attributes; using EfsTools.Utils; using Newtonsoft.Json; namespace EfsTools.Items.Nv { [Serializable] [NvItemId(2982)] [Attributes(9)] public class Wcdma800UtranTxLimVsTempOffset { [ElementsCount(8)] [ElementType("int16")] [Description("")] public short[] Value { get; set; } } }
20.190476
48
0.610849
[ "MIT" ]
HomerSp/EfsTools
EfsTools/Items/Nv/Wcdma800UtranTxLimVsTempOffsetI.cs
424
C#
namespace WebApi.Modules { using Application.Services; using Domain.Accounts; using Domain.Customers; using Domain.Security; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; public static class PersistenceExtensions { public static IServiceCollection AddPersistence( this IServiceCollection services, IConfiguration configuration) { bool useFake = configuration.GetValue<bool>("PersistenceModule:UseFake"); if (useFake) { services.AddScoped<IUserFactory, Infrastructure.InMemoryDataAccess.EntityFactory>(); services.AddScoped<ICustomerFactory, Infrastructure.InMemoryDataAccess.EntityFactory>(); services.AddScoped<IAccountFactory, Infrastructure.InMemoryDataAccess.EntityFactory>(); services.AddSingleton<Infrastructure.InMemoryDataAccess.MangaContext, Infrastructure.InMemoryDataAccess.MangaContext>(); services.AddScoped<IUnitOfWork, Infrastructure.InMemoryDataAccess.UnitOfWork>(); services.AddScoped<IAccountRepository, Infrastructure.InMemoryDataAccess.Repositories.AccountRepository>(); services.AddScoped<ICustomerRepository, Infrastructure.InMemoryDataAccess.Repositories.CustomerRepository>(); services.AddScoped<IUserRepository, Infrastructure.InMemoryDataAccess.Repositories.UserRepository>(); } else { services.AddScoped<IUserFactory, Infrastructure.EntityFrameworkDataAccess.EntityFactory>(); services.AddScoped<ICustomerFactory, Infrastructure.EntityFrameworkDataAccess.EntityFactory>(); services.AddScoped<IAccountFactory, Infrastructure.EntityFrameworkDataAccess.EntityFactory>(); services.AddDbContext<Infrastructure.EntityFrameworkDataAccess.MangaContext>( options => options.UseSqlServer(configuration.GetConnectionString("DefaultConnection"))); services.AddScoped<IUnitOfWork, Infrastructure.EntityFrameworkDataAccess.UnitOfWork>(); services.AddScoped<IAccountRepository, Infrastructure.EntityFrameworkDataAccess.Repositories.AccountRepository>(); services.AddScoped<ICustomerRepository, Infrastructure.EntityFrameworkDataAccess.Repositories.CustomerRepository>(); } return services; } } }
52.795918
137
0.701585
[ "Apache-2.0" ]
RaphsVenas/clean-architecture-manga
src/WebApi/Modules/PersistenceExtensions.cs
2,587
C#
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Thor.Core")] [assembly: InternalsVisibleTo("Thor.Core.Abstractions.Tests")] [assembly: InternalsVisibleTo("Thor.Core.Transmission.BlobStorage")] [assembly: InternalsVisibleTo("Thor.Core.Transmission.EventHub")] [assembly: InternalsVisibleTo("Thor.Extensions.Http")] [assembly: InternalsVisibleTo("Thor.Extensions.HotChocolate")] [assembly: InternalsVisibleTo("Thor.Extensions.Http.Tests")] [assembly: InternalsVisibleTo("Thor.Extensions.HotChocolate.Tests")] [assembly: InternalsVisibleTo("Thor.Core.Session")]
52.909091
68
0.812715
[ "MIT" ]
glucaci/thor-client
src/Core/Core.Abstractions/AssemblyAttributes.cs
584
C#
// ----------------------------------------------------------------------------------------- // <copyright file="IRequestOptions.cs" company="Microsoft"> // Copyright 2013 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // ----------------------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.Storage { using Microsoft.WindowsAzure.Storage.RetryPolicies; using System; /// <summary> /// An interface required for request option types. /// </summary> /// <remarks>The <see cref="Microsoft.WindowsAzure.Storage.Queue.QueueRequestOptions"/>, <see cref="Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions"/>, and <see cref="Microsoft.WindowsAzure.Storage.Table.TableRequestOptions"/> classes implement the <see cref="IRequestOptions"/> interface.</remarks> public interface IRequestOptions { /// <summary> /// Gets or sets the retry policy for the request. /// </summary> /// <value>An object of type <see cref="IRetryPolicy"/>.</value> IRetryPolicy RetryPolicy { get; set; } /// <summary> /// Gets or sets the location mode of the request. /// </summary> /// <value>A <see cref="Microsoft.WindowsAzure.Storage.RetryPolicies.LocationMode"/> enumeration value.</value> LocationMode? LocationMode { get; set; } /// <summary> /// Gets or sets the default server timeout for the request. /// </summary> /// <value>A <see cref="TimeSpan"/> containing the server timeout interval.</value> TimeSpan? ServerTimeout { get; set; } /// <summary> /// Gets or sets the maximum execution time across all potential retries. /// </summary> /// <value>A <see cref="TimeSpan"/> containing the maximum execution time across all potential retries.</value> TimeSpan? MaximumExecutionTime { get; set; } #if !(WINDOWS_RT || NETCORE) /// <summary> /// Gets or sets a value to indicate whether data written and read by the client library should be encrypted. /// </summary> /// <value>Use <c>true</c> to specify that data should be encrypted/decrypted for all transactions; otherwise, <c>false</c>.</value> bool? RequireEncryption { get; set; } #endif } }
46.806452
310
0.620951
[ "Apache-2.0" ]
JoeLiang1983/Azure-Storage-Net
Lib/Common/IRequestOptions.cs
2,904
C#
using Microsoft.EntityFrameworkCore; namespace PugetSound.Data { public static class DbInitializer { public static void Initialize(AppDbContext context) { context.Database.EnsureCreated(); context.Database.Migrate(); } } }
20.285714
59
0.637324
[ "MIT" ]
tomzorz/PugetSound
sources/PugetSound/PugetSound/Data/DbInitializer.cs
284
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ public partial class CMSModules_ImportExport_Controls_Global_Import_SiteDetails { /// <summary> /// lblSiteDisplayName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblSiteDisplayName; /// <summary> /// txtSiteDisplayName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMSFormControls_System_LocalizableTextBox txtSiteDisplayName; /// <summary> /// rfvSiteDisplayName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMS.Base.Web.UI.CMSRequiredFieldValidator rfvSiteDisplayName; /// <summary> /// lblSiteName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblSiteName; /// <summary> /// txtSiteName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMS.Base.Web.UI.CMSTextBox txtSiteName; /// <summary> /// rfvSiteName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMS.Base.Web.UI.CMSRequiredFieldValidator rfvSiteName; }
32.779412
83
0.600718
[ "MIT" ]
BryanSoltis/KenticoMVCWidgetShowcase
CMS/CMSModules/ImportExport/Controls/Global/Import_SiteDetails.ascx.designer.cs
2,231
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the appmesh-2019-01-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AppMesh.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AppMesh.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for VirtualGatewayRef Object /// </summary> public class VirtualGatewayRefUnmarshaller : IUnmarshaller<VirtualGatewayRef, XmlUnmarshallerContext>, IUnmarshaller<VirtualGatewayRef, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> VirtualGatewayRef IUnmarshaller<VirtualGatewayRef, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public VirtualGatewayRef Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; VirtualGatewayRef unmarshalledObject = new VirtualGatewayRef(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("arn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Arn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("meshName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MeshName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("meshOwner", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.MeshOwner = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("resourceOwner", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ResourceOwner = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("version", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; unmarshalledObject.Version = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("virtualGatewayName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.VirtualGatewayName = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static VirtualGatewayRefUnmarshaller _instance = new VirtualGatewayRefUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static VirtualGatewayRefUnmarshaller Instance { get { return _instance; } } } }
39.410448
165
0.5783
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/AppMesh/Generated/Model/Internal/MarshallTransformations/VirtualGatewayRefUnmarshaller.cs
5,281
C#
using System; using Toggl.Shared; using Foundation; using UIKit; using Toggl.iOS.Extensions; namespace Toggl.iOS.Cells.Reports { public partial class ReportsNoDataCollectionViewCell : UICollectionViewCell { public static readonly NSString Key = new NSString("ReportsNoDataCollectionViewCell"); public static readonly UINib Nib; static ReportsNoDataCollectionViewCell() { Nib = UINib.FromName("ReportsNoDataCollectionViewCell", NSBundle.MainBundle); } protected ReportsNoDataCollectionViewCell(IntPtr handle) : base(handle) { // Note: this .ctor should not contain any initialization logic. } override public void AwakeFromNib() { base.AwakeFromNib(); ErrorTitleLabel.Text = Resources.ReportsEmptyStateTitle; ErrorMessageLabel.Text = Resources.ReportsEmptyStateDescription; ErrorTitleLabel.SetKerning(-0.2); ErrorMessageLabel.SetKerning(-0.2); } } }
28.459459
94
0.662868
[ "BSD-3-Clause" ]
moljac/mobileapp
Toggl.iOS/Cells/Reports/ReportsNoDataCollectionViewCell.cs
1,055
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Options; using Opserver.Data.Exceptions; using Opserver.Data.Jira; using Opserver.Helpers; using Opserver.Views.Exceptions; using StackExchange.Exceptional; namespace Opserver.Controllers { [OnlyAllow(ExceptionsRoles.Viewer)] [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] public class ExceptionsController : StatusController<ExceptionsModule> { public const int MaxSearchResults = 2000; private List<ApplicationGroup> ApplicationGroups => CurrentStore.ApplicationGroups; private ExceptionStore CurrentStore; private string CurrentGroup; private string CurrentLog; private Guid? CurrentId; private Guid? CurrentSimilarId; private ExceptionSorts CurrentSort; public ExceptionsController(ExceptionsModule module, IOptions<OpserverSettings> settings) : base(module, settings) { } public override void OnActionExecuting(ActionExecutingContext context) { CurrentStore = Module.GetStore(GetParam("store")); CurrentGroup = GetParam("group"); CurrentLog = GetParam("log") ?? GetParam("app"); // old link compat CurrentId = GetParam("id").HasValue() && Guid.TryParse(GetParam("id"), out var guid) ? guid : (Guid?)null; CurrentSimilarId = GetParam("similar").HasValue() && Guid.TryParse(GetParam("similar"), out var similarGuid) ? similarGuid : (Guid?)null; Enum.TryParse(GetParam("sort"), out CurrentSort); if (CurrentLog.HasValue()) { var storeApps = CurrentStore.Applications.Data; var a = storeApps?.Find(app => app.Name == CurrentLog) ?? storeApps?.Find(app => app.ShortName == CurrentLog); if (a != null) { // Correct the log name to a found one, this enables short names to work. CurrentLog = a.Name; // Make pre-group links work correctly if (CurrentGroup.IsNullOrEmpty()) { // Old links, that didn't know about groups var g = ApplicationGroups.Find(gr => gr[a.Name] != null); if (g != null) { CurrentGroup = g.Name; } } } } base.OnActionExecuting(context); } public string GetParam(string param) => Request.HasFormContentType ? Request.Form[param] : Request.Query[param]; // TODO: Move entirely to model binder private async Task<ExceptionStore.SearchParams> GetSearchAsync() { var result = new ExceptionStore.SearchParams { Group = CurrentGroup, Log = CurrentLog, Sort = CurrentSort, Id = CurrentId }; if (GetParam("q").HasValue()) { result.SearchQuery = GetParam("q"); } if (bool.TryParse(GetParam("includeDeleted"), out var includeDeleted)) { result.IncludeDeleted = includeDeleted; } if (CurrentSimilarId.HasValue) { var error = await CurrentStore.GetErrorAsync(CurrentLog, CurrentSimilarId.Value); if (error != null) { result.Message = error.Message; } } return result; } private ExceptionsModel GetModel(List<Error> errors) { var group = CurrentGroup.HasValue() ? CurrentStore.ApplicationGroups.Find(g => g.Name == CurrentGroup) : null; var log = group != null && CurrentLog.HasValue() ? group.Applications.Find(a => a.Name == CurrentLog) : null; // Handle single-log groups a bit more intuitively so things like clear all work if (log == null && group?.Applications.Count == 1) { log = group.Applications[0]; } return new ExceptionsModel { Module = Module, Store = CurrentStore, Groups = ApplicationGroups, Group = group, Log = log, Sort = CurrentSort, Errors = errors }; } [DefaultRoute("exceptions")] public async Task<ActionResult> Exceptions() { var search = await GetSearchAsync(); var errors = await CurrentStore.GetErrorsAsync(search); var vd = GetModel(errors); vd.SearchParams = search; vd.LoadAsyncSize = Module.Settings.PageSize; return View(vd); } [Route("exceptions/load-more")] public async Task<ActionResult> LoadMore(int? count = null, Guid? prevLast = null) { var search = await GetSearchAsync(); search.Count = count ?? Module.Settings.PageSize; search.StartAt = prevLast; var errors = await CurrentStore.GetErrorsAsync(search); var vd = GetModel(errors); vd.SearchParams = search; return PartialView("Exceptions.Table.Rows", vd); } [Route("exceptions/detail")] public async Task<ActionResult> Detail(Guid id) { var e = await CurrentStore.GetErrorAsync(CurrentLog, id); var vd = GetModel(null); vd.Exception = e; return View("Exceptions.Detail", vd); } [Route("exceptions/preview")] public async Task<ActionResult> Preview(Guid id) { var e = await CurrentStore.GetErrorAsync(CurrentLog, id); var vd = GetModel(null); vd.Exception = e; return PartialView("Exceptions.Preview", vd); } [AllowAnonymous] [Route("exceptions/detail/json")] public async Task<ActionResult> DetailJson(Guid id) { var e = await CurrentStore.GetErrorAsync(CurrentLog, id); if (e == null) { return JsonNotFound(); } else { return Json(new { e.GUID, e.ErrorHash, e.ApplicationName, e.Type, e.Source, e.Message, e.Detail, e.MachineName, e.Host, e.FullUrl, e.HTTPMethod, e.IPAddress, e.DuplicateCount, CreationDate = e.CreationDate.ToEpochTime(), e.Commands, }); } } [Route("exceptions/protect"), HttpPost, OnlyAllow(ExceptionsRoles.Admin)] public async Task<ActionResult> Protect(Guid id, bool redirect = false) { var success = await CurrentStore.ProtectErrorAsync(id); if (!success) JsonError("Unable to protect, error was not found in the log"); return redirect ? Json(new { url = Url.Action(nameof(Exceptions), new { store = CurrentStore.Name, group = CurrentGroup, log = CurrentLog }) }) : Counts(); } [Route("exceptions/delete"), HttpPost, OnlyAllow(ExceptionsRoles.Admin)] public async Task<ActionResult> Delete() { var toDelete = await GetSearchAsync(); // we don't care about success...if it's *already* deleted, that's fine // if we throw an exception trying to delete, that's another matter if (toDelete.Id.HasValue) { // optimized single route await CurrentStore.DeleteErrorAsync(toDelete.Id.Value); } else { await CurrentStore.DeleteErrorsAsync(toDelete); } return toDelete.Id.HasValue ? Counts() : Json(new { url = Url.Action(nameof(Exceptions), new { store = CurrentStore.Name, group = CurrentGroup, log = CurrentLog }) }); } [Route("exceptions/delete-list"), HttpPost, OnlyAllow(ExceptionsRoles.Admin)] public async Task<ActionResult> DeleteList(Guid[] ids, bool returnCounts = false) { if (ids == null || ids.Length == 0) return Json(true); await CurrentStore.DeleteErrorsAsync(ids.ToList()); return returnCounts ? Counts() : Json(new { url = Url.Action("Exceptions", new { store = CurrentStore.Name, log = CurrentLog, group = CurrentGroup }) }); } [Route("exceptions/counts")] public ActionResult Counts() { var stores = Module.Stores.Select(s => new { s.Name, Total = s.TotalExceptionCount }); var groups = ApplicationGroups.Select(g => new { g.Name, g.Total, Applications = g.Applications.Select(a => new { a.Name, Total = a.ExceptionCount }) }); return Json(new { Stores = stores, Groups = groups, Total = Module.TotalExceptionCount }); } [Route("exceptions/jiraactions"), HttpGet, OnlyAllow(ExceptionsRoles.Admin)] public ActionResult JiraActions(string appName) { var issues = Module.Settings.Jira.GetActionsForApplication(appName); return PartialView("Exceptions.Jira", issues); } [Route("exceptions/jiraaction"), HttpGet, OnlyAllow(ExceptionsRoles.Admin)] public async Task<ActionResult> JiraAction(Guid id, int actionid) { var e = await CurrentStore.GetErrorAsync(CurrentLog, id); var user = Current.User; var action = Module.Settings.Jira.Actions.Find(i => i.Id == actionid); var jiraClient = new JiraClient(Module.Settings.Jira); var result = await jiraClient.CreateIssueAsync(action, e, user == null ? "" : user.AccountName); if (string.IsNullOrWhiteSpace(result.Key)) { return Json(new { success = false, message = "Can not create issue" }); } return Json(new { success = true, issueKey = result.Key, browseUrl = result.BrowseUrl }); } } }
37.56314
167
0.536798
[ "MIT" ]
dwardin/Opserver
src/Opserver.Web/Controllers/ExceptionsController.cs
11,008
C#
using HarmonyLib; using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.UnitLogic.Buffs.Blueprints; using Kingmaker.UnitLogic.FactLogic; using Kingmaker.Utility; using System.Linq; using TabletopTweaks.Core.Utilities; using static TabletopTweaks.Base.Main; namespace TabletopTweaks.Base.Bugfixes.Classes { class Witch { [HarmonyPatch(typeof(BlueprintsCache), "Init")] static class Witch_AlternateCapstone_Patch { static bool Initialized; [HarmonyPriority(Priority.Last)] static void Postfix() { if (Initialized) return; Initialized = true; PatchAlternateCapstone(); } static void PatchAlternateCapstone() { if (Main.TTTContext.Fixes.AlternateCapstones.IsDisabled("Witch")) { return; } var WitchAlternateCapstone = NewContent.AlternateCapstones.Witch.WitchAlternateCapstone.ToReference<BlueprintFeatureBaseReference>(); ClassTools.Classes.WitchClass.TemporaryContext(bp => { bp.Progression.LevelEntries .Where(entry => entry.Level == 20) .ForEach(entry => entry.m_Features.Add(WitchAlternateCapstone)); TTTContext.Logger.LogPatch("Enabled Alternate Capstones", bp); }); } } [HarmonyPatch(typeof(BlueprintsCache), "Init")] static class BlueprintsCache_Init_Patch { static bool Initialized; static void Postfix() { if (Initialized) return; Initialized = true; TTTContext.Logger.LogHeader("Patching Witch"); PatchBase(); } static void PatchBase() { PatchAgilityPatron(); PatchAmelioratingHex(); PatchMajorAmelioratingHex(); void PatchAgilityPatron() { if (TTTContext.Fixes.Witch.Base.IsDisabled("AgilityPatron")) { return; } var WitchAgilityPatronProgression = BlueprintTools.GetBlueprint<BlueprintProgression>("08518b2a62446c74b9ae08ee73664047"); var WitchAgilityPatronSpellLevel8 = BlueprintTools.GetBlueprint<BlueprintFeature>("6164c2aa71247bd4d91274ebe93a6c0f"); var WitchAgilityPatronSpellLevel9 = BlueprintTools.GetBlueprint<BlueprintFeature>("1e418c5f030347542ad47dd752cdea05"); var AnimalShapes = BlueprintTools.GetBlueprintReference<BlueprintAbilityReference>("cf689244b2c7e904eb85f26fd6e81552"); var Shapechange = BlueprintTools.GetBlueprintReference<BlueprintAbilityReference>("22b9044aa229815429d57d0a30e4b739"); PatchPatronSpell(WitchAgilityPatronProgression, WitchAgilityPatronSpellLevel8, AnimalShapes); PatchPatronSpell(WitchAgilityPatronProgression, WitchAgilityPatronSpellLevel9, Shapechange); TTTContext.Logger.LogPatch("Patched", WitchAgilityPatronProgression); } void PatchPatronSpell(BlueprintProgression patron, BlueprintFeature patronSpellfeature, BlueprintAbilityReference spell) { patronSpellfeature.GetComponent<AddKnownSpell>().m_Spell = spell; var AddSpells = patron.GetComponent<AddSpellsToDescription>(); AddSpells.m_Spells = AddSpells.m_Spells.AppendToArray(spell); TTTContext.Logger.LogPatch("Patched", patronSpellfeature); } void PatchAmelioratingHex() { if (TTTContext.Fixes.Witch.Base.IsDisabled("AmelioratingHex")) { return; } var WitchHexAmelioratingDazzleSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("c1a5e2bb65fbc6d479f957fd54b2f313"); var WitchHexAmelioratingFatuguedSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("32b27dd734277464c954f22b35338a62"); var WitchHexAmelioratingShakenSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("d98e8e525c0f5c746b4d8f1ea24b865a"); var WitchHexAmelioratingSickenedSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("ddee5f689ef42274ca5d5731cb96b075"); QuickFixTools.ReplaceSuppression(WitchHexAmelioratingDazzleSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexAmelioratingFatuguedSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexAmelioratingShakenSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexAmelioratingSickenedSuppressBuff, TTTContext); } void PatchMajorAmelioratingHex() { if (TTTContext.Fixes.Witch.Base.IsDisabled("MajorAmelioratingHex")) { return; } var WitchHexMajorAmelioratingBlindedSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("66700a810f380c5419dc13f03bb76f45"); var WitchHexMajorAmelioratingCurseSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("ee471eead8a069c449710ac5073322c0"); var WitchHexMajorAmelioratingDiseaseSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("0870624a0fa21cf418d4c922da4205d4"); var WitchHexMajorAmelioratingPoisonSuppressBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("2cf1962ef4cd4b5468c09bf4959d1bf7"); QuickFixTools.ReplaceSuppression(WitchHexMajorAmelioratingBlindedSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexMajorAmelioratingCurseSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexMajorAmelioratingDiseaseSuppressBuff, TTTContext); QuickFixTools.ReplaceSuppression(WitchHexMajorAmelioratingPoisonSuppressBuff, TTTContext); } } } } }
57.132075
150
0.679987
[ "MIT" ]
Vek17/TabletopTweaks-Base
TabletopTweaks-Base/Bugfixes/Classes/Witch.cs
6,058
C#
using System.Collections.Generic; namespace ElvenNameGenerator { public interface IElvenNameGenerator { /// <summary> /// Generates a single elven name as one word. /// </summary> /// <returns>Elven name</returns> string GenerateName(); /// <summary> /// When you need a full elven name with a space in between, use this method. /// </summary> /// <returns>An elven full name with first and last name.</returns> string GenerateFullName(); /// <summary> /// Use .Take() to specify number of elven full names you want to generate. /// </summary> /// <returns>Enumerable of elven full names.</returns> IEnumerable<string> GenerateFullNames(); /// <summary> /// Seeds randomization so that with the same seed, same name sequences are generated. /// </summary> /// <param name="seed">A seed value that will be used in randomization.</param> void Seed(int seed); } }
33.451613
94
0.59595
[ "MIT" ]
koraybalci/ElvenNameGenerator
ElvenNameGenerator/IElvenNameGenerator.cs
1,039
C#
using System; using System.Collections.Generic; using Unity.Collections; #if UNITY_EDITOR using UnityEditor; using UnityEditor.Experimental.Rendering.LightweightPipeline; #endif using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.Experimental.GlobalIllumination; using Lightmapping = UnityEngine.Experimental.GlobalIllumination.Lightmapping; namespace UnityEngine.Experimental.Rendering.LightweightPipeline { public interface IBeforeCameraRender { void ExecuteBeforeCameraRender(LightweightRenderPipeline pipelineInstance, ScriptableRenderContext context, Camera camera); } public sealed partial class LightweightRenderPipeline : RenderPipeline { static class PerFrameBuffer { public static int _GlossyEnvironmentColor; public static int _SubtractiveShadowColor; } static class PerCameraBuffer { // TODO: This needs to account for stereo rendering public static int _InvCameraViewProj; public static int _ScaledScreenParams; } private static IRendererSetup s_DefaultRendererSetup; private static IRendererSetup defaultRendererSetup { get { if (s_DefaultRendererSetup == null) s_DefaultRendererSetup = new DefaultRendererSetup(); return s_DefaultRendererSetup; } } const string k_RenderCameraTag = "Render Camera"; CullResults m_CullResults; public ScriptableRenderer renderer { get; private set; } PipelineSettings settings { get; set; } internal struct PipelineSettings { public bool supportsCameraDepthTexture { get; private set; } public bool supportsCameraOpaqueTexture { get; private set; } public Downsampling opaqueDownsampling { get; private set; } public bool supportsHDR { get; private set; } public int msaaSampleCount { get; private set; } public float renderScale { get; private set; } public LightRenderingMode mainLightRenderingMode { get; private set; } public bool supportsMainLightShadows { get; private set; } public int mainLightShadowmapResolution { get; private set; } public LightRenderingMode additionalLightsRenderingMode { get; private set; } public int maxAdditionalLights { get; private set; } public bool supportsAdditionalLightShadows { get; private set; } public int additionalLightsShadowmapResolution { get; private set; } public float shadowDistance { get; private set; } public int cascadeCount { get; private set; } public float cascade2Split { get; private set; } public Vector3 cascade4Split { get; private set; } public float shadowDepthBias { get; private set; } public float shadowNormalBias { get; private set; } public bool supportsSoftShadows { get; private set; } public bool supportsDynamicBatching { get; private set; } public bool mixedLightingSupported { get; private set; } public static PipelineSettings Create(LightweightRenderPipelineAsset asset) { var cache = new PipelineSettings(); // General settings cache.supportsCameraDepthTexture = asset.supportsCameraDepthTexture; cache.supportsCameraOpaqueTexture = asset.supportsCameraOpaqueTexture; cache.opaqueDownsampling = asset.opaqueDownsampling; // Quality settings cache.msaaSampleCount = asset.msaaSampleCount; cache.supportsHDR = asset.supportsHDR; cache.renderScale = asset.renderScale; // Main directional light settings cache.mainLightRenderingMode = asset.mainLightRenderingMode; cache.supportsMainLightShadows = asset.supportsMainLightShadows; cache.mainLightShadowmapResolution = asset.mainLightShadowmapResolution; // Additional light settings cache.additionalLightsRenderingMode = asset.additionalLightsRenderingMode; cache.maxAdditionalLights = asset.maxAdditionalLightsCount; cache.supportsAdditionalLightShadows = asset.supportsAdditionalLightShadows; cache.additionalLightsShadowmapResolution = asset.additionalLightsShadowmapResolution; // Shadow settings cache.shadowDistance = asset.shadowDistance; cache.cascadeCount = asset.cascadeCount; cache.cascade2Split = asset.cascade2Split; cache.cascade4Split = asset.cascade4Split; cache.shadowDepthBias = asset.shadowDepthBias; cache.shadowNormalBias = asset.shadowNormalBias; cache.supportsSoftShadows = asset.supportsSoftShadows; // Advanced settings cache.supportsDynamicBatching = asset.supportsDynamicBatching; cache.mixedLightingSupported = asset.supportsMixedLighting; return cache; } } public LightweightRenderPipeline(LightweightRenderPipelineAsset asset) { settings = PipelineSettings.Create(asset); renderer = new ScriptableRenderer(asset); SetSupportedRenderingFeatures(); PerFrameBuffer._GlossyEnvironmentColor = Shader.PropertyToID("_GlossyEnvironmentColor"); PerFrameBuffer._SubtractiveShadowColor = Shader.PropertyToID("_SubtractiveShadowColor"); PerCameraBuffer._InvCameraViewProj = Shader.PropertyToID("_InvCameraViewProj"); PerCameraBuffer._ScaledScreenParams = Shader.PropertyToID("_ScaledScreenParams"); // Let engine know we have MSAA on for cases where we support MSAA backbuffer if (QualitySettings.antiAliasing != settings.msaaSampleCount) QualitySettings.antiAliasing = settings.msaaSampleCount; Shader.globalRenderPipeline = "LightweightPipeline"; Lightmapping.SetDelegate(lightsDelegate); } public sealed override void Dispose() { base.Dispose(); Shader.globalRenderPipeline = ""; SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); #if UNITY_EDITOR SceneViewDrawMode.ResetDrawMode(); #endif renderer.Dispose(); Lightmapping.ResetDelegate(); } public override void Render(ScriptableRenderContext renderContext, Camera[] cameras) { if (cameras == null || cameras.Length == 0) { Debug.LogWarning("The camera list passed to the render pipeline is either null or empty."); return; } base.Render(renderContext, cameras); BeginFrameRendering(cameras); GraphicsSettings.lightsUseLinearIntensity = true; SetupPerFrameShaderConstants(); SortCameras(cameras); foreach (Camera camera in cameras) { BeginCameraRendering(camera); foreach (var beforeCamera in camera.GetComponents<IBeforeCameraRender>()) beforeCamera.ExecuteBeforeCameraRender(this, renderContext, camera); RenderSingleCamera(this, renderContext, camera, ref m_CullResults, camera.GetComponent<IRendererSetup>()); } } public static void RenderSingleCamera(LightweightRenderPipeline pipelineInstance, ScriptableRenderContext context, Camera camera, ref CullResults cullResults, IRendererSetup setup = null) { if (pipelineInstance == null) { Debug.LogError("Trying to render a camera with an invalid render pipeline instance."); return; } CommandBuffer cmd = CommandBufferPool.Get(k_RenderCameraTag); using (new ProfilingSample(cmd, k_RenderCameraTag)) { CameraData cameraData; PipelineSettings settings = pipelineInstance.settings; ScriptableRenderer renderer = pipelineInstance.renderer; InitializeCameraData(settings, camera, out cameraData); SetupPerCameraShaderConstants(cameraData); ScriptableCullingParameters cullingParameters; if (!CullResults.GetCullingParameters(camera, cameraData.isStereoEnabled, out cullingParameters)) { CommandBufferPool.Release(cmd); return; } cullingParameters.shadowDistance = Mathf.Min(cameraData.maxShadowDistance, camera.farClipPlane); context.ExecuteCommandBuffer(cmd); cmd.Clear(); #if UNITY_EDITOR // Emit scene view UI if (cameraData.isSceneViewCamera) ScriptableRenderContext.EmitWorldGeometryForSceneView(camera); #endif CullResults.Cull(ref cullingParameters, context, ref cullResults); RenderingData renderingData; InitializeRenderingData(settings, ref cameraData, ref cullResults, renderer.maxVisibleAdditionalLights, renderer.maxPerObjectAdditionalLights, out renderingData); var setupToUse = setup; if (setupToUse == null) setupToUse = defaultRendererSetup; renderer.Clear(); setupToUse.Setup(renderer, ref renderingData); renderer.Execute(context, ref renderingData); context.ExecuteCommandBuffer(cmd); CommandBufferPool.Release(cmd); context.Submit(); #if UNITY_EDITOR Handles.DrawGizmos(camera); #endif } } static void SetSupportedRenderingFeatures() { #if UNITY_EDITOR SupportedRenderingFeatures.active = new SupportedRenderingFeatures() { reflectionProbeSupportFlags = SupportedRenderingFeatures.ReflectionProbeSupportFlags.None, defaultMixedLightingMode = SupportedRenderingFeatures.LightmapMixedBakeMode.Subtractive, supportedMixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeMode.Subtractive, supportedLightmapBakeTypes = LightmapBakeType.Baked | LightmapBakeType.Mixed, supportedLightmapsModes = LightmapsMode.CombinedDirectional | LightmapsMode.NonDirectional, rendererSupportsLightProbeProxyVolumes = false, rendererSupportsMotionVectors = false, rendererSupportsReceiveShadows = false, rendererSupportsReflectionProbes = true }; SceneViewDrawMode.SetupDrawMode(); #endif } static void InitializeCameraData(PipelineSettings settings, Camera camera, out CameraData cameraData) { const float kRenderScaleThreshold = 0.05f; cameraData.camera = camera; bool msaaEnabled = camera.allowMSAA && settings.msaaSampleCount > 1; if (msaaEnabled) cameraData.msaaSamples = (camera.targetTexture != null) ? camera.targetTexture.antiAliasing : settings.msaaSampleCount; else cameraData.msaaSamples = 1; cameraData.isSceneViewCamera = camera.cameraType == CameraType.SceneView; cameraData.isOffscreenRender = camera.targetTexture != null && !cameraData.isSceneViewCamera; cameraData.isStereoEnabled = IsStereoEnabled(camera); cameraData.isHdrEnabled = camera.allowHDR && settings.supportsHDR; cameraData.postProcessLayer = camera.GetComponent<PostProcessLayer>(); cameraData.postProcessEnabled = cameraData.postProcessLayer != null && cameraData.postProcessLayer.isActiveAndEnabled; Rect cameraRect = camera.rect; cameraData.isDefaultViewport = (!(Math.Abs(cameraRect.x) > 0.0f || Math.Abs(cameraRect.y) > 0.0f || Math.Abs(cameraRect.width) < 1.0f || Math.Abs(cameraRect.height) < 1.0f)); // If XR is enabled, use XR renderScale. // Discard variations lesser than kRenderScaleThreshold. // Scale is only enabled for gameview. float usedRenderScale = XRGraphics.enabled ? XRGraphics.eyeTextureResolutionScale : settings.renderScale; cameraData.renderScale = (Mathf.Abs(1.0f - usedRenderScale) < kRenderScaleThreshold) ? 1.0f : usedRenderScale; cameraData.renderScale = (camera.cameraType == CameraType.Game) ? cameraData.renderScale : 1.0f; cameraData.requiresDepthTexture = settings.supportsCameraDepthTexture || cameraData.isSceneViewCamera; cameraData.requiresOpaqueTexture = settings.supportsCameraOpaqueTexture; cameraData.opaqueTextureDownsampling = settings.opaqueDownsampling; bool anyShadowsEnabled = settings.supportsMainLightShadows || settings.supportsAdditionalLightShadows; cameraData.maxShadowDistance = (anyShadowsEnabled) ? settings.shadowDistance : 0.0f; AdditionalCameraData additionalCameraData = camera.gameObject.GetComponent<AdditionalCameraData>(); if (additionalCameraData != null) { cameraData.maxShadowDistance = (additionalCameraData.renderShadows) ? cameraData.maxShadowDistance : 0.0f; cameraData.requiresDepthTexture &= additionalCameraData.requiresDepthTexture; cameraData.requiresOpaqueTexture &= additionalCameraData.requiresColorTexture; } else if (!cameraData.isSceneViewCamera && camera.cameraType != CameraType.Reflection && camera.cameraType != CameraType.Preview) { cameraData.requiresDepthTexture = false; cameraData.requiresOpaqueTexture = false; } cameraData.requiresDepthTexture |= cameraData.postProcessEnabled; var commonOpaqueFlags = SortFlags.CommonOpaque; var noFrontToBackOpaqueFlags = SortFlags.SortingLayer | SortFlags.RenderQueue | SortFlags.OptimizeStateChanges | SortFlags.CanvasOrder; bool hasHSRGPU = SystemInfo.hasHiddenSurfaceRemovalOnGPU; bool canSkipFrontToBackSorting = (camera.opaqueSortMode == OpaqueSortMode.Default && hasHSRGPU) || camera.opaqueSortMode == OpaqueSortMode.NoDistanceSort; cameraData.defaultOpaqueSortFlags = canSkipFrontToBackSorting ? noFrontToBackOpaqueFlags : commonOpaqueFlags; } static void InitializeRenderingData(PipelineSettings settings, ref CameraData cameraData, ref CullResults cullResults, int maxVisibleAdditionalLights, int maxPerObjectAdditionalLights, out RenderingData renderingData) { List<VisibleLight> visibleLights = cullResults.visibleLights; List<int> additionalLightIndices = new List<int>(); bool hasDirectionalShadowCastingLight = false; bool hasPunctualShadowCastingLight = false; if (cameraData.maxShadowDistance > 0.0f) { for (int i = 0; i < visibleLights.Count; ++i) { Light light = visibleLights[i].light; bool castShadows = light != null && light.shadows != LightShadows.None; // LWRP doesn't support point light shadows yet castShadows &= visibleLights[i].lightType != LightType.Point; if (visibleLights[i].lightType == LightType.Directional) { hasDirectionalShadowCastingLight |= castShadows; } else if (additionalLightIndices.Count < maxVisibleAdditionalLights) { hasPunctualShadowCastingLight |= (castShadows && settings.additionalLightsRenderingMode == LightRenderingMode.PerPixel); additionalLightIndices.Add(i); } } } renderingData.cullResults = cullResults; renderingData.cameraData = cameraData; InitializeLightData(settings, visibleLights, additionalLightIndices, maxPerObjectAdditionalLights, out renderingData.lightData); InitializeShadowData(settings, visibleLights, hasDirectionalShadowCastingLight, hasPunctualShadowCastingLight && !renderingData.lightData.shadeAdditionalLightsPerVertex, out renderingData.shadowData); renderingData.supportsDynamicBatching = settings.supportsDynamicBatching; } static void InitializeShadowData(PipelineSettings settings, List<VisibleLight> visibleLights, bool hasDirectionalShadowCastingLight, bool hasPunctualShadowCastingLight, out ShadowData shadowData) { m_ShadowBiasData.Clear(); for (int i = 0; i < visibleLights.Count; ++i) { Light light = visibleLights[i].light; LWRPAdditionalLightData data = (light != null) ? light.gameObject.GetComponent<LWRPAdditionalLightData>() : null; if (data && !data.usePipelineSettings) m_ShadowBiasData.Add(new Vector4(light.shadowBias, light.shadowNormalBias, 0.0f, 0.0f)); else m_ShadowBiasData.Add(new Vector4(settings.shadowDepthBias, settings.shadowNormalBias, 0.0f, 0.0f)); } shadowData.bias = m_ShadowBiasData; // Until we can have keyword stripping forcing single cascade hard shadows on gles2 bool supportsScreenSpaceShadows = SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2; shadowData.supportsMainLightShadows = settings.supportsMainLightShadows && hasDirectionalShadowCastingLight; // we resolve shadows in screenspace when cascades are enabled to save ALU as computing cascade index + shadowCoord on fragment is expensive shadowData.requiresScreenSpaceShadowResolve = shadowData.supportsMainLightShadows && supportsScreenSpaceShadows && settings.cascadeCount > 1; shadowData.mainLightShadowCascadesCount = (shadowData.requiresScreenSpaceShadowResolve) ? settings.cascadeCount : 1; shadowData.mainLightShadowmapWidth = settings.mainLightShadowmapResolution; shadowData.mainLightShadowmapHeight = settings.mainLightShadowmapResolution; switch (shadowData.mainLightShadowCascadesCount) { case 1: shadowData.mainLightShadowCascadesSplit = new Vector3(1.0f, 0.0f, 0.0f); break; case 2: shadowData.mainLightShadowCascadesSplit = new Vector3(settings.cascade2Split, 1.0f, 0.0f); break; default: shadowData.mainLightShadowCascadesSplit = settings.cascade4Split; break; } shadowData.supportsAdditionalLightShadows = settings.supportsAdditionalLightShadows && hasPunctualShadowCastingLight; shadowData.additionalLightsShadowmapWidth = shadowData.additionalLightsShadowmapHeight = settings.additionalLightsShadowmapResolution; shadowData.supportsSoftShadows = settings.supportsSoftShadows && (shadowData.supportsMainLightShadows || shadowData.supportsAdditionalLightShadows); shadowData.shadowmapDepthBufferBits = 16; } static void InitializeLightData(PipelineSettings settings, List<VisibleLight> visibleLights, List<int> additionalLightIndices, int maxPerObjectAdditionalLights, out LightData lightData) { lightData.mainLightIndex = GetMainLight(settings, visibleLights); lightData.additionalLightsCount = (settings.additionalLightsRenderingMode != LightRenderingMode.Disabled) ? Math.Min(additionalLightIndices.Count, Math.Min(settings.maxAdditionalLights, maxPerObjectAdditionalLights)) : 0; lightData.shadeAdditionalLightsPerVertex = settings.additionalLightsRenderingMode == LightRenderingMode.PerVertex; lightData.visibleLights = visibleLights; lightData.additionalLightIndices = additionalLightIndices; lightData.supportsMixedLighting = settings.mixedLightingSupported; } // Main Light is always a directional light static int GetMainLight(PipelineSettings settings, List<VisibleLight> visibleLights) { int totalVisibleLights = visibleLights.Count; if (totalVisibleLights == 0 || settings.mainLightRenderingMode != LightRenderingMode.PerPixel) return -1; for (int i = 0; i < totalVisibleLights; ++i) { VisibleLight currLight = visibleLights[i]; // Particle system lights have the light property as null. We sort lights so all particles lights // come last. Therefore, if first light is particle light then all lights are particle lights. // In this case we either have no main light or already found it. if (currLight.light == null) break; // In case no shadow light is present we will return the brightest directional light if (currLight.lightType == LightType.Directional) return i; } return -1; } static void SetupPerFrameShaderConstants() { // When glossy reflections are OFF in the shader we set a constant color to use as indirect specular SphericalHarmonicsL2 ambientSH = RenderSettings.ambientProbe; Color linearGlossyEnvColor = new Color(ambientSH[0, 0], ambientSH[1, 0], ambientSH[2, 0]) * RenderSettings.reflectionIntensity; Color glossyEnvColor = CoreUtils.ConvertLinearToActiveColorSpace(linearGlossyEnvColor); Shader.SetGlobalVector(PerFrameBuffer._GlossyEnvironmentColor, glossyEnvColor); // Used when subtractive mode is selected Shader.SetGlobalVector(PerFrameBuffer._SubtractiveShadowColor, CoreUtils.ConvertSRGBToActiveColorSpace(RenderSettings.subtractiveShadowColor)); } static void SetupPerCameraShaderConstants(CameraData cameraData) { Camera camera = cameraData.camera; float cameraWidth = (float)cameraData.camera.pixelWidth * cameraData.renderScale; float cameraHeight = (float)cameraData.camera.pixelHeight * cameraData.renderScale; Shader.SetGlobalVector(PerCameraBuffer._ScaledScreenParams, new Vector4(cameraWidth, cameraHeight, 1.0f + 1.0f / cameraWidth, 1.0f + 1.0f / cameraHeight)); Matrix4x4 projMatrix = GL.GetGPUProjectionMatrix(camera.projectionMatrix, false); Matrix4x4 viewMatrix = camera.worldToCameraMatrix; Matrix4x4 viewProjMatrix = projMatrix * viewMatrix; Matrix4x4 invViewProjMatrix = Matrix4x4.Inverse(viewProjMatrix); Shader.SetGlobalMatrix(PerCameraBuffer._InvCameraViewProj, invViewProjMatrix); } public static Lightmapping.RequestLightsDelegate lightsDelegate = (Light[] requests, NativeArray<LightDataGI> lightsOutput) => { LightDataGI lightData = new LightDataGI(); for (int i = 0; i < requests.Length; i++) { Light light = requests[i]; switch (light.type) { case LightType.Directional: DirectionalLight directionalLight = new DirectionalLight(); LightmapperUtils.Extract(light, ref directionalLight); lightData.Init(ref directionalLight); break; case LightType.Point: PointLight pointLight = new PointLight(); LightmapperUtils.Extract(light, ref pointLight); lightData.Init(ref pointLight); break; case LightType.Spot: SpotLight spotLight = new SpotLight(); LightmapperUtils.Extract(light, ref spotLight); lightData.Init(ref spotLight); break; case LightType.Area: RectangleLight rectangleLight = new RectangleLight(); LightmapperUtils.Extract(light, ref rectangleLight); lightData.Init(ref rectangleLight); break; default: lightData.InitNoBake(light.GetInstanceID()); break; } lightData.falloff = FalloffType.InverseSquared; lightsOutput[i] = lightData; } }; } }
49.749507
212
0.651627
[ "BSD-2-Clause" ]
1-10/VisualEffectGraphSample
GitHub/com.unity.render-pipelines.lightweight/Runtime/LightweightRenderPipeline.cs
25,223
C#
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using QuantConnect.Algorithm.Framework.Alphas; using QuantConnect.Algorithm.Framework.Execution; using QuantConnect.Algorithm.Framework.Portfolio; using QuantConnect.Algorithm.Framework.Selection; using QuantConnect.Interfaces; namespace QuantConnect.Algorithm.CSharp { /// <summary> /// Test algorithm using <see cref="InsightWeightingPortfolioConstructionModel"/> and <see cref="ConstantAlphaModel"/> /// generating a constant <see cref="Insight"/> with a 0.25 weight /// </summary> public class InsightWeightingFrameworkAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition { /// <summary> /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized. /// </summary> public override void Initialize() { // Set requested data resolution UniverseSettings.Resolution = Resolution.Minute; SetStartDate(2013, 10, 07); //Set Start Date SetEndDate(2013, 10, 11); //Set End Date SetCash(100000); //Set Strategy Cash // set algorithm framework models SetUniverseSelection(new ManualUniverseSelectionModel(QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA))); SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, null, 0.25)); SetPortfolioConstruction(new InsightWeightingPortfolioConstructionModel()); SetExecution(new ImmediateExecutionModel()); } public override void OnEndOfAlgorithm() { if (// holdings value should be 0.25 - to avoid price fluctuation issue we compare with 0.28 and 0.23 Portfolio.TotalHoldingsValue > Portfolio.TotalPortfolioValue * 0.28m || Portfolio.TotalHoldingsValue < Portfolio.TotalPortfolioValue * 0.23m) { throw new Exception($"Unexpected Total Holdings Value: {Portfolio.TotalHoldingsValue}"); } } /// <summary> /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm. /// </summary> public bool CanRunLocally { get; } = true; /// <summary> /// This is used by the regression test system to indicate which languages this algorithm is written in. /// </summary> public Language[] Languages { get; } = { Language.CSharp, Language.Python }; /// <summary> /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm /// </summary> public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string> { {"Total Trades", "6"}, {"Average Win", "0.00%"}, {"Average Loss", "0.00%"}, {"Compounding Annual Return", "34.982%"}, {"Drawdown", "0.600%"}, {"Expectancy", "-0.495"}, {"Net Profit", "0.412%"}, {"Sharpe Ratio", "4.016"}, {"Loss Rate", "67%"}, {"Win Rate", "33%"}, {"Profit-Loss Ratio", "0.52"}, {"Alpha", "0.146"}, {"Beta", "0.077"}, {"Annual Standard Deviation", "0.043"}, {"Annual Variance", "0.002"}, {"Information Ratio", "-1.027"}, {"Tracking Error", "0.179"}, {"Treynor Ratio", "2.239"}, {"Total Fees", "$6.00"}, {"Total Insights Generated", "100"}, {"Total Insights Closed", "99"}, {"Total Insights Analysis Completed", "99"}, {"Long Insight Count", "100"}, {"Short Insight Count", "0"}, {"Long/Short Ratio", "100%"}, {"Estimated Monthly Alpha Value", "$148197.8440"}, {"Total Accumulated Estimated Alpha Value", "$25522.9620"}, {"Mean Population Estimated Insight Value", "$257.8077"}, {"Mean Population Direction", "54.5455%"}, {"Mean Population Magnitude", "54.5455%"}, {"Rolling Averaged Population Direction", "59.8056%"}, {"Rolling Averaged Population Magnitude", "59.8056%"} }; } }
45.741071
149
0.617802
[ "Apache-2.0" ]
AENotFound/Lean
Algorithm.CSharp/InsightWeightingFrameworkAlgorithm.cs
5,125
C#
using UnityEngine; public struct Matrix3x3 { public static Matrix3x3 identity { get { return _identity; } } public static Matrix3x3 zero { get { return _zero; } } private static Matrix3x3 _identity, _zero; public float m00, m01, m02, m10, m11, m12, m20, m21, m22; static Matrix3x3() { _identity = new Matrix3x3(); _zero = new Matrix3x3(); _zero.m00 = _zero.m01 = _zero.m02 = _zero.m10 = _zero.m11 = _zero.m12 = _zero.m20 = _zero.m21 = _zero.m22 = 0f; } public float determinant { get { return m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m12 * m21) + m02 * (m10 * m21 - m11 * m20); } } public float this[int i, int j] { get { if (i == 0 && j == 0) return m00; else if (i == 0 && j == 1) return m01; else if (i == 0 && j == 2) return m02; else if (i == 1 && j == 0) return m10; else if (i == 1 && j == 1) return m11; else if (i == 1 && j == 2) return m12; else if (i == 2 && j == 0) return m20; else if (i == 2 && j == 1) return m21; else // if (i == 2 && j == 2) return m22; } set { if (i == 0 && j == 0) m00 = value; else if (i == 0 && j == 1) m01 = value; else if (i == 0 && j == 2) m02 = value; else if (i == 1 && j == 0) m10 = value; else if (i == 1 && j == 1) m11 = value; else if (i == 1 && j == 2) m12 = value; else if (i == 2 && j == 0) m20 = value; else if (i == 2 && j == 1) m21 = value; else // if (i == 2 && j == 2) m22 = value; } } public Matrix3x3 inverse { get { float detA = determinant; Matrix3x3 invA = Matrix3x3.zero; invA.m00 = (m11 * m22 - m12 * m21) / detA; invA.m01 = (m02 * m21 - m01 * m22) / detA; invA.m02 = (m01 * m12 - m02 * m11) / detA; invA.m10 = (m12 * m20 - m10 * m22) / detA; invA.m11 = (m00 * m22 - m02 * m20) / detA; invA.m12 = (m02 * m10 - m00 * m12) / detA; invA.m20 = (m10 * m21 - m11 * m20) / detA; invA.m21 = (m01 * m20 - m00 * m21) / detA; invA.m22 = (m00 * m11 - m01 * m10) / detA; return invA; } } public Matrix3x3 transpose { get { Matrix3x3 transA = this; transA.m01 = this.m10; transA.m02 = this.m20; transA.m10 = this.m01; transA.m12 = this.m21; transA.m20 = this.m02; transA.m21 = this.m12; return transA; } } public Vector3 GetColumn(int i) { return new Vector3(this[0, i], this[1, i], this[2, i]); } public void SetColumn(int i, Vector3 v) { this[0, i] = v.x; this[1, i] = v.y; this[2, i] = v.z; } public Vector3 GetRow(int i) { return new Vector3(this[i, 0], this[i, 1], this[i, 2]); } public void SetRow(int i, Vector3 v) { this[i, 0] = v.x; this[i, 1] = v.y; this[i, 2] = v.z; } public Vector3 MultiplyPoint(Vector3 p) { return new Vector3(m00 * p.x + m01 * p.y + m02 * p.z, m10 * p.x + m11 * p.y + m12 * p.z, m20 * p.x + m21 * p.y + m22 * p.z); } public void ToAngleAxis(out float angle, out Vector3 axis) { float eps = 0.01f; if (Mathf.Abs(m01 - m10) < eps && Mathf.Abs(m02 - m20) < eps && Mathf.Abs(m12 - m21) < eps) { if (Mathf.Abs(m01 + m10) < eps && Mathf.Abs(m02 + m20) < eps && Mathf.Abs(m12 + m21) < eps && Mathf.Abs(m00 + m11 + m22 - 3f) < eps) { angle = 0f; axis = new Vector3(1f, 0f, 0f); return; } angle = 180f; float xx = (m00 + 1f) / 2f; float yy = (m11 + 1f) / 2f; float zz = (m22 + 1f) / 2f; float xy = (m01 + m10) / 4f; float xz = (m02 + m20) / 4f; float yz = (m12 + m21) / 4f; float sqrt22 = Mathf.Sqrt(2f)/2f; if (xx > yy && xx > zz) { if (xx < eps) { axis = new Vector3(0f, sqrt22, sqrt22); } else { float sqrtxx = Mathf.Sqrt(xx); axis = new Vector3(sqrtxx, xy / sqrtxx, xz / sqrtxx); } } else if (yy > zz) { if (yy < eps) { axis = new Vector3(sqrt22, 0f, sqrt22); } else { float sqrtyy = Mathf.Sqrt(yy); axis = new Vector3(xy / sqrtyy, sqrtyy, yz / sqrtyy); } } else { if (zz < eps) { axis = new Vector3(sqrt22, sqrt22, 0f); } else { float sqrtzz = Mathf.Sqrt(zz); axis = new Vector3(xz / sqrtzz, yz / sqrtzz, sqrtzz); } } return; } float m2112 = m21 - m12; float m0220 = m02 - m20; float m1001 = m10 - m01; float s = Mathf.Sqrt(m2112 * m2112 + m0220 * m0220 + m1001 * m1001); if (Mathf.Abs(s) < 0.00001f) s = 1f; angle = Mathf.Acos((m00 + m11 + m22 - 1f) / 2f) * Mathf.Rad2Deg; axis = new Vector3(m2112 / s, m0220 / s, m1001 / s); } public Quaternion ToRotation() { float angle; Vector3 axis; ToAngleAxis(out angle, out axis); return Quaternion.AngleAxis(angle, axis); } public override string ToString() { return string.Format("({0} {1} {2}; {3} {4} {5}; {6} {7} {8})", m00, m01, m02, m10, m11, m12, m20, m21, m22); } public static Matrix3x3 operator *(Matrix3x3 mat1, Matrix3x3 mat2) { Matrix3x3 mat = Matrix3x3.zero; mat.m00 = mat1.m00 * mat2.m00 + mat1.m01 * mat2.m10 + mat1.m02 * mat2.m20; mat.m01 = mat1.m00 * mat2.m01 + mat1.m01 * mat2.m11 + mat1.m02 * mat2.m21; mat.m02 = mat1.m00 * mat2.m02 + mat1.m01 * mat2.m12 + mat1.m02 * mat2.m22; mat.m10 = mat1.m10 * mat2.m00 + mat1.m11 * mat2.m10 + mat1.m12 * mat2.m20; mat.m11 = mat1.m10 * mat2.m01 + mat1.m11 * mat2.m11 + mat1.m12 * mat2.m21; mat.m12 = mat1.m10 * mat2.m02 + mat1.m11 * mat2.m12 + mat1.m12 * mat2.m22; mat.m20 = mat1.m20 * mat2.m00 + mat1.m21 * mat2.m10 + mat1.m22 * mat2.m20; mat.m21 = mat1.m20 * mat2.m01 + mat1.m21 * mat2.m11 + mat1.m22 * mat2.m21; mat.m22 = mat1.m20 * mat2.m02 + mat1.m21 * mat2.m12 + mat1.m22 * mat2.m22; return mat; } public static Matrix3x3 operator +(Matrix3x3 mat1, Matrix3x3 mat2) { Matrix3x3 mat = Matrix3x3.zero; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) mat[i, j] = mat1[i, j] + mat2[i, j]; return mat; } public static Matrix3x3 operator -(Matrix3x3 mat1, Matrix3x3 mat2) { Matrix3x3 mat = Matrix3x3.zero; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) mat[i, j] = mat1[i, j] - mat2[i, j]; return mat; } public static Matrix3x3 operator *(Matrix3x3 mat, float s) { Matrix3x3 mat1 = Matrix3x3.zero; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) mat1[i, j] = mat[i, j] * s; return mat1; } public static Matrix3x3 operator *(float s, Matrix3x3 mat) { return mat * s; } public static Matrix3x3 operator /(Matrix3x3 mat, float s) { return mat * (1f / s); } public static Matrix3x3 MultiplyVectors(Vector3 v1, Vector3 v2) { Matrix3x3 mat = Matrix3x3.zero; mat.m00 = v1.x * v2.x; mat.m01 = v1.x * v2.y; mat.m02 = v1.x * v2.z; mat.m10 = v1.y * v2.x; mat.m11 = v1.y * v2.y; mat.m12 = v1.y * v2.z; mat.m20 = v1.z * v2.x; mat.m21 = v1.z * v2.y; mat.m22 = v1.z * v2.z; return mat; } public static Matrix3x3 Rotation(Quaternion q) { Matrix3x3 mat = Matrix3x3.zero; mat.m00 = 1f - 2f * q.y * q.y - 2f * q.z * q.z; mat.m01 = 2f * q.x * q.y - 2f * q.z * q.w; mat.m02 = 2f * q.x * q.z + 2f * q.y * q.w; mat.m10 = 2f * q.x * q.y + 2f * q.z * q.w; mat.m11 = 1f - 2f * q.x * q.x - 2f * q.z * q.z; mat.m12 = 2f * q.y * q.z - 2f * q.x * q.w; mat.m20 = 2f * q.x * q.z - 2f * q.y * q.w; mat.m21 = 2f * q.y * q.z + 2f * q.x * q.w; mat.m22 = 1f - 2f * q.x * q.x - 2f * q.y * q.y; return mat; } public static Matrix3x3 Scale(Vector3 s) { Matrix3x3 mat = Matrix3x3.identity; mat.m00 = s.x; mat.m11 = s.y; mat.m22 = s.z; return mat; } }
28.431085
82
0.422383
[ "BSD-3-Clause" ]
uwgraphics/Leap
LeapUnity/Assets/Utils/Math/Matrix3x3.cs
9,697
C#
namespace Koios.Core.Model { public class KManagedObjectField : KObjectField { public bool IsUpdated { get; private set; } public object OriginalValue { get; private set; } public KManagedObjectField(KSchemaField field, object value, bool isUpdated, object originalValue) : base(field, value) { IsUpdated = isUpdated; OriginalValue = originalValue; } } }
26.705882
106
0.612335
[ "MIT" ]
jonrp/Koios
Koios.Core/Model/KManagedObjectField.cs
456
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.WafV2.Outputs { [OutputType] public sealed class WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatement { /// <summary> /// The operator to use to compare the request part to the size setting. Valid values include: `EQ`, `NE`, `LE`, `LT`, `GE`, or `GT`. /// </summary> public readonly string ComparisonOperator; /// <summary> /// The part of a web request that you want AWS WAF to inspect. See Field to Match below for details. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatch? FieldToMatch; /// <summary> /// The size, in bytes, to compare to the request part, after any transformations. Valid values are integers between 0 and 21474836480, inclusive. /// </summary> public readonly int Size; /// <summary> /// Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. See Text Transformation below for details. /// </summary> public readonly ImmutableArray<Outputs.WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementTextTransformation> TextTransformations; [OutputConstructor] private WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatement( string comparisonOperator, Outputs.WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementFieldToMatch? fieldToMatch, int size, ImmutableArray<Outputs.WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatementTextTransformation> textTransformations) { ComparisonOperator = comparisonOperator; FieldToMatch = fieldToMatch; Size = size; TextTransformations = textTransformations; } } }
49.36
191
0.73906
[ "ECL-2.0", "Apache-2.0" ]
Otanikotani/pulumi-aws
sdk/dotnet/WafV2/Outputs/WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementSizeConstraintStatement.cs
2,468
C#
// Copyright (c) MOSA Project. Licensed under the New BSD License. namespace Mosa.Platform.x86.Intrinsic { /// <summary> /// /// </summary> internal sealed class SetCR4 : SetControlRegisterBase { /// <summary> /// Initializes a new instance of the <see cref="SetCR4"/> class. /// </summary> public SetCR4() : base(ControlRegister.CR4) { } } }
19.263158
67
0.650273
[ "BSD-3-Clause" ]
Kintaro/MOSA-Project
Source/Mosa.Platform.x86/Intrinsic/SetCR4.cs
368
C#