public void SetInstanceFields() { InstanceByteField = 0; InstanceSByteField = 1; InstanceUInt16Field = 2; InstanceInt16Field = 3; InstanceUInt32Field = 4; InstanceInt32Field = 5; InstanceUInt64Field = 6; InstanceInt64Field = 7; InstanceDoubleField = 8; InstanceSingleField = 9; InstanceDecimalField = 10; InstanceCharField = 'a'; InstanceBooleanField = true; InstanceStringField = "testing"; InstanceObjectField = new SimpleStruct(1111); InstanceEnumField = EnumInt64.B; InstanceDateTimeField = new DateTime(50000); InstanceSimpleStructField = new SimpleStruct(1234); InstanceSimpleGenericStructField = new SimpleGenericStruct <ushort>(32); InstanceNullableStructNotNullField = new SimpleStruct(56); InstanceNullableStructNullField = null; InstanceSimpleClassField = new SimpleClass(54); InstanceSimpleGenericClassField = new SimpleGenericClass <string>("string"); InstanceSimpleInterfaceField = new ClassImplementSimpleInterface(87); }
public static void GenericValueTypeLocals(bool call_other = false) { var gvclass_arr = new SimpleGenericStruct <Point>[] { new SimpleGenericStruct <Point> { Id = "gvclass_arr#1#Id", Color = RGB.Red, Value = new Point { X = 100, Y = 200, Id = "gvclass_arr#1#Value#Id", Color = RGB.Red } }, new SimpleGenericStruct <Point> { Id = "gvclass_arr#2#Id", Color = RGB.Blue, Value = new Point { X = 10, Y = 20, Id = "gvclass_arr#2#Value#Id", Color = RGB.Green } } }; var gvclass_arr_empty = new SimpleGenericStruct <Point> [0]; SimpleGenericStruct <Point>[] gvclass_arr_null = null; if (call_other) { OtherMethod(); } Console.WriteLine($"gvclass_arr: {gvclass_arr.Length}, {gvclass_arr_empty.Length}, {gvclass_arr_null?.Length}"); }
public static void SetStaticFields() { StaticByteField = 0; StaticSByteField = 1; StaticUInt16Field = 2; StaticInt16Field = 3; StaticUInt32Field = 4; StaticInt32Field = 5; StaticUInt64Field = 6; StaticInt64Field = 7; StaticDoubleField = 8; StaticSingleField = 9; StaticDecimalField = 10; StaticCharField = 'a'; StaticBooleanField = true; StaticStringField = "testing"; StaticObjectField = new SimpleStruct(1111); StaticEnumField = EnumInt64.B; StaticDateTimeField = new DateTime(50000); StaticSimpleStructField = new SimpleStruct(1234); StaticSimpleGenericStructField = new SimpleGenericStruct <ushort>(32); StaticNullableStructNotNullField = new SimpleStruct(56); StaticNullableStructNullField = null; StaticSimpleClassField = new SimpleClass(54); StaticSimpleGenericClassField = new SimpleGenericClass <string>("string"); StaticSimpleInterfaceField = new ClassImplementSimpleInterface(87); }
public static async Task <bool> ValueTypeLocalsAsync(bool call_other = false) { var gvclass_arr = new SimpleGenericStruct <Point>[] { new SimpleGenericStruct <Point> { Id = "gvclass_arr#1#Id", Color = RGB.Red, Value = new Point { X = 100, Y = 200, Id = "gvclass_arr#1#Value#Id", Color = RGB.Red } }, new SimpleGenericStruct <Point> { Id = "gvclass_arr#2#Id", Color = RGB.Blue, Value = new Point { X = 10, Y = 20, Id = "gvclass_arr#2#Value#Id", Color = RGB.Green } } }; var gvclass_arr_empty = new SimpleGenericStruct <Point> [0]; SimpleGenericStruct <Point>[] gvclass_arr_null = null; Console.WriteLine($"ValueTypeLocalsAsync: call_other: {call_other}"); SimpleGenericStruct <Point> gvclass; Point[] points = null; if (call_other) { (gvclass, points) = await new ArrayTestsClass().InstanceMethodValueTypeLocalsAsync <SimpleGenericStruct <Point> >(gvclass_arr[0]); Console.WriteLine($"* gvclass: {gvclass}, points: {points.Length}"); } Console.WriteLine($"gvclass_arr: {gvclass_arr.Length}, {gvclass_arr_empty.Length}, {gvclass_arr_null?.Length}"); return(true); }