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