public void TestValueSeralize() { int i = 112312; this.TestValueSeralize(i); bool b = true; this.TestValueSeralize(b); float f = 1.21543f; this.TestValueSeralize(f); double d = 2734.231d; this.TestValueSeralize(d); long l = 5131851434123123141L; this.TestValueSeralize(l); string s = "192.168.1.37"; this.TestStringSeralize(s); testEnum e = testEnum.a; this.TestValueSeralize(e); DateTime date = new DateTime(1935, 1, 1, 15, 24, 6, 500); this.TestValueSeralize(date); }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tonumber(L, 1); testEnum o = (testEnum)arg0; ToLua.Push(L, o); return(1); }
private void button1_Click(object sender, EventArgs e1) { float a = 12; int b = 11; string c = "10"; bool d = true; bool e = false; List <string> f = new List <string>(); List <int> g = new List <int>(); testEnum h = testEnum.b; object[] test = new object[] { a, b, c, d, e, f, g, h }; for (int i = 0; i < test.Length; i++) { if (test[i] is float) { Console.WriteLine("this is float {0}", test[i]); } else if (test[i] is int) { Console.WriteLine("this is int {0}", test[i]); } else if (test[i] is string) { Console.WriteLine("this is string {0}", test[i]); } else if (test[i] is bool) { Console.WriteLine("this is bool {0}", test[i]); } else if (test[i].GetType() == typeof(List <object>)) { Console.WriteLine("this is List<string>", test[i].GetType()); } else if (test[i] is Enum) { Console.WriteLine("this is enum {0}", (int)h + ""); } } if (test[3].Equals(test[4])) { Console.WriteLine("they are euqual"); } else { Console.WriteLine("they are different"); } }
public static string ConvertToString(testEnum value) { return(_values[(int)value]); }
public int Create([FromBody, SwaggerExample("this is an example description"), MaxLength(39)] string description, testEnum anEnumField) { throw new NotImplementedException(); }
static void Push(IntPtr L, testEnum arg) { ToLua.Push(L, arg); }
public void ToEnum_Should_Be_Able_To_Convert_From_String(string input, testEnum expect, testEnum defaultValue) { Assert.Equal(expect, input.ToEnum(defaultValue)); }
public void ToEnum_Should_Fall_Back_To_Default(string input, testEnum output) { Assert.Equal(output, input.ToEnum(output)); }
public void Create(testEnum enums, string driver, int value) { Console.WriteLine("Command Create"); }
public bool TestHasFlag(testEnum e, testEnum f) { return EnumHelper.HasFlags<testEnum>(e, f); }