Пример #1
0
        private void button24_Click(object sender, EventArgs e)
        {
            Helper helper = new Helper("127.0.0.1", 9527);

            Q q = helper.GetQ("Queue1");

            TestObj o = q.De <TestObj>();

            if (o == null)
            {
                WriteMsg("Queue is empty .\r\n");
                return;
            }

            WriteObj("Dequeue", o);
            WriteLine();
        }
Пример #2
0
        private void button23_Click(object sender, EventArgs e)
        {
            TestObj o = new TestObj();

            o.i   = 2;
            o.d   = 3.14;
            o.f   = 1.22f; //  未加 [S] 标记的 Field 不会序列化
            o.Dt  = DateTime.Now;
            o.Str = "Hello world .";
            o.de  = 6.6666667M; //  未加 [S] 标记的 Property 不会序列化

            Helper helper = new Helper("127.0.0.1", 9527);

            Q q = helper.GetQ("Queue1");

            q.En(o);

            WriteMsg("Enqueue a instance of TestObj success .\r\n");
        }