示例#1
0
        static void TestJSONv1()
        {
            t1 ot1 = new t1()
            {
                p1 = 12,
                p2 = "dsfg",
                p3 = new t2 {
                    p1 = DateTime.UtcNow, p2 = "uioziuz"
                },
                p4 = new List <t2> {
                    new t2 {
                        p1 = DateTime.UtcNow.AddDays(12), p2 = "k1"
                    },
                    new t2 {
                        p1 = DateTime.UtcNow.AddDays(7), p2 = "k2"
                    }
                }
            };

            var jsonSet = new Biser.JsonSettings {
                DateFormat = Biser.JsonSettings.DateTimeStyle.ISO
            };

            Biser.JsonEncoder enc = new Biser.JsonEncoder(ot1, jsonSet);
            string            es  = enc.GetJSON(Biser.JsonSettings.JsonStringStyle.Prettify);
            var ot2 = t1.BiserJsonDecode(es, settings: jsonSet);
        }
示例#2
0
 // [Route("GetMovieSetting")]
 public IActionResult GetMovieSetting([FromBody] t1 t1)//[FromQuery]
 {
     return(new ObjectResult(new {
         Name = "Movie " + t1.idx.ToString(),
         ReleaseDate = DateTime.Now
     }));
 }
示例#3
0
            public static t1 BiserJsonDecode(string enc = null, Biser.JsonDecoder extDecoder = null, Biser.JsonSettings settings = null) //!!!!!!!!!!!!!! change return type
            {
                Biser.JsonDecoder decoder = null;

                if (extDecoder == null)
                {
                    if (enc == null || String.IsNullOrEmpty(enc))
                    {
                        return(null);
                    }
                    decoder = new Biser.JsonDecoder(enc, settings);
                    if (decoder.CheckNull())
                    {
                        return(null);
                    }
                }
                else
                {
                    //JSONSettings of the existing decoder will be used
                    decoder = extDecoder;
                }

                t1 m = new t1();  //!!!!!!!!!!!!!! change return type

                foreach (var props in decoder.GetDictionary <string>())
                {
                    switch (props)
                    {
                    case "p1":
                        m.p1 = decoder.GetInt();
                        break;

                    case "p2":
                        m.p2 = decoder.GetString();
                        break;

                    case "p3":
                        m.p3 = t2.BiserJsonDecode(null, decoder);
                        break;

                    case "p4":
                        m.p4 = decoder.CheckNull() ? null : new List <t2>();
                        if (m.p4 != null)
                        {
                            foreach (var el in decoder.GetList())
                            {
                                m.p4.Add(t2.BiserJsonDecode(null, decoder));
                            }
                        }
                        break;

                    default:
                        decoder.SkipValue();    //MUST BE HERE
                        break;
                    }
                }
                return(m);
            }
示例#4
0
 // Base class arguments first in the signature
 public Derived(Type1 t1, Type2 t2, Type3 t3, Type4 t4 = null) : Base(t1, t2)
 {
     _t3 = t3;
     if (t4 == null)
     {
         _t4 = DEFAULT_T4_VALUE;
     }
     else
     {
         _t4 = t4;
     }
 }
示例#5
0
        public static void Main(String[] args)
        {
            System.Diagnostics.Debug.WriteLine("hello world.");
            t1 t1 = new t1();
            t2 t2 = new t2();
            t2 t3 = new t2();

            System.Diagnostics.Debug.WriteLine(t1.Test());
            System.Diagnostics.Debug.WriteLine(t2.Test());
            System.Diagnostics.Debug.WriteLine(t2.Test(5));
            System.Diagnostics.Debug.WriteLine(t3.Test(5));
            System.Diagnostics.Debug.WriteLine("good bye world.");
        }
 foreach (var(t1, t2) in source)
示例#7
0
 public t1e(t1 t1 = default)
 {
     this.m_t1Ref = new ptr <t1>(t1);
 }
 await Task.WhenAll(t1, t2);
示例#9
0
 var(t1, t2) = tuple;
 var(t1, t2) = tasks;
 // Test out two guys, who are sub-classes to make sure the most specific is called.
 public static int MultiSignatureHierarchyStatic(testClass a, t1 c)
 {
     return(c.i);
 }
 // Test out two guys, who are sub-classes to make sure the most specific is called.
 public int MultiSignatureHierarchy(t1 c)
 {
     return(c.i);
 }
示例#13
0
 await Task.WhenAll(t1, t2, t3, t4, t5);
示例#14
0
 var(t1, f1) = await @this.Item1;
 var(t1, operation) = value;
示例#16
0
文件: e.cs 项目: zjmit/go2cs
 // t1.M should not appear as method in a Tx type.
 private static void M(this t1 _p0)
 {
 }
示例#17
0
 => MergeDictionariesRecursively(t1, t2),
示例#18
0
文件: e_t1Struct.cs 项目: zjmit/go2cs
 public T1(t1 t1 = default, t2 t2 = default)
 {
     this.m_t1Ref = new ptr <t1>(t1);
     this.m_t2Ref = new ptr <t2>(t2);
 }
示例#19
0
 await Task.WhenAny(t1, t2);