Пример #1
0
        //[DllImport("Connect.dll", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
        //private extern static void _Enc7481_Set_Encoder(UInt16 intDirection, Int32 lngValue);
        static void Main(string[] args)
        {
            //Error u = new PwdError();
            //var l = new LoginR(new Login("haha", "1234567890"), u);
            //string s = JsonHelper.GetJson(l);
            //Log(s);
            //var o = JsonHelper.ParseFromJson<LoginR>(s);
            //Log(JsonHelper.GetJson(o));

            Log("Community:");
            Community c = new Community();
            Log(c.ToJson());

            Log("Notice:");
            c = new Notice();
            Log(c.ToJson());

            Log("Enquire:");
            c = new Enquire();
            Log(c.ToJson());

            Log("Respond:");
            c = new Respond((Enquire)c);
            Log(c.ToJson());

            Log("Ack:");
            c = new Ack(c);
            Log(c.ToJson());

            Console.WriteLine("\n------Finsh------");
            Console.ReadKey();
            Console.ReadKey();
        }
Пример #2
0
 /// <summary>
 /// 从对象创建回复
 /// </summary>
 /// <param name="toAck"></param>
 /// <returns></returns>
 public static Ack GetAck(Community toAck)
 {
     return new Ack(toAck.CommunityID);
 }
Пример #3
0
 //
 /// <summary>
 /// 从ID创建回复对象
 /// </summary>
 /// <param name="toAck"></param>
 public Ack(Community toAck)
 {
     netAttribute = Community.NetAttributes.Respond;
     ackID = toAck.CommunityID;
 }