Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
    static int IntToEnum(IntPtr L)
    {
        int      arg0 = (int)LuaDLL.lua_tonumber(L, 1);
        testEnum o    = (testEnum)arg0;

        ToLua.Push(L, o);
        return(1);
    }
Exemplo n.º 3
0
        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");
            }
        }
Exemplo n.º 4
0
 public static string ConvertToString(testEnum value)
 {
     return(_values[(int)value]);
 }
Exemplo n.º 5
0
 public int Create([FromBody, SwaggerExample("this is an example description"), MaxLength(39)] string description, testEnum anEnumField)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 static void Push(IntPtr L, testEnum arg)
 {
     ToLua.Push(L, arg);
 }
Exemplo n.º 7
0
 public void ToEnum_Should_Be_Able_To_Convert_From_String(string input, testEnum expect, testEnum defaultValue)
 {
     Assert.Equal(expect, input.ToEnum(defaultValue));
 }
Exemplo n.º 8
0
 public void ToEnum_Should_Fall_Back_To_Default(string input, testEnum output)
 {
     Assert.Equal(output, input.ToEnum(output));
 }
Exemplo n.º 9
0
 public void ToEnum_Should_Fall_Back_To_Default(string input, testEnum output)
 {
     Assert.Equal(output, input.ToEnum(output));
 }
Exemplo n.º 10
0
 public void ToEnum_Should_Be_Able_To_Convert_From_String(string input, testEnum expect, testEnum defaultValue)
 {
     Assert.Equal(expect, input.ToEnum(defaultValue));
 }
 public int Create([FromBody, SwaggerExample("this is an example description"), MaxLength(39)] string description, testEnum anEnumField)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 public void Create(testEnum enums, string driver, int value)
 {
     Console.WriteLine("Command Create");
 }
Exemplo n.º 13
0
 public bool TestHasFlag(testEnum e, testEnum f)
 {
     return EnumHelper.HasFlags<testEnum>(e, f);
 }