Example #1
0
        public static void pitch(string _ip)
        {
            Client.Client cl = new Client.Client(_ip, 5255, "jak", "kaj");
            cl.Connect();

            TestClass tcl1 = new TestClass(true);

            tcl1.b        = new double[] { 666.66, 777.777 };
            tcl1.inrr     = new Innerer(true);
            tcl1.a        = 871;
            tcl1.dsa._asd = "merge";

            List <ClassElement> al = new List <ClassElement> ();
            ClassParser         cp = new ClassParser();

            cp.Traverse(tcl1, "gigel");
            al = cp.ListOfFields;

            cl.List = al;
            bool b = cl.Send();

            if (!b)
            {
                Console.WriteLine("Nope");
            }
        }
Example #2
0
        /// <summary>
        /// Modify this to suit your needs
        /// </summary>
        public void Test()
        {
            long then = DateTime.Now.Ticks;

            asd ass = new asd();

            ass._asd = "123";
#if DEBUG
            System.Console.WriteLine(ass is ISerializable);
#endif

            TestClass tcls = new TestClass(true);
            tcls.a        = 999;
            tcls.b        = new double[] { 999.123, 999e-4 };
            tcls.dsa._asd = "better show";
            oldInst       = tcls;
            ClassParser cprs = new ClassParser();
            cprs.Traverse(tcls);
            al = cprs.ListOfFields;

            Console.WriteLine("Done. Phase 1 too {0}00ns", DateTime.Now.Ticks - then);

//			ArrayList testArrayList = new ArrayList ();
//			testArrayList.Add ("asd");
//			testArrayList.Add (2.0);
//			//testArrayList.Add (testArrayList);
//			ArrayList dsa = new ArrayList ();
//			dsa.Add ("blabla");
//			dsa.Add (false);
//			testArrayList.Add (dsa);
//			cprs.Traverse (testArrayList);
//			al = cprs.ListOfFields;
//			oldInst = testArrayList;

            DataSource = al.ToArray();

            Panel bottom = new Panel();
            bottom.Height = 25;
            bottom.Dock   = DockStyle.Bottom;

            Button btnSave = new Button();
//			btnSave.Dock = DockStyle.Left;
            btnSave.Click      += (o, e) => save(o, e);
            btnSave.Text        = "S&ave";
            btnSave.UseMnemonic = true;
            btnSave.Left        = this.Size.Width / 2 - 10 - btnSave.Width;
            bottom.Controls.Add(btnSave);

            Button btn = new Button();
//			btn.Dock = DockStyle.Right;
            btn.Click      += (o, e) => secondPhase(o, e);
            btn.Text        = "&Next";
            btn.UseMnemonic = true;
            btn.Left        = this.Size.Width / 2 + 10;
            bottom.Controls.Add(btn);

            this.Controls.Add(bottom);
        }
Example #3
0
        /// <summary>
        /// Disassemble o and serialize it to the database server
        /// </summary>
        /// <param name="o">
        /// A <see cref="System.Object"/>
        /// </param>
        /// <param name="_nameOfO">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="_forceListFlush">
        /// Forces flushing the List. By default, the list contents, if any, are left intact.
        /// A <see cref="System.Boolean"/>
        /// </param>
        /// <returns>
        /// A <see cref="System.Boolean"/>
        /// </returns>
        public bool Send(object o, string _nameOfO, bool _forceListFlush)
        {
            if (tcpclnt_ == null || !(tcpclnt_.Connected))
            {
#if DEBUG
                Console.WriteLine("tcpclnt connected? {0}",
                                  (tcpclnt_ != null) ? tcpclnt_.Connected : false);
#endif
                return(false);
            }
            using (ClassParser cprs = new ClassParser())
            {
                cprs.Traverse(o, _nameOfO);
                if (_forceListFlush)
                {
                    List = null;
                }
                List = cprs.ListOfFields;
            }

            return(Send());
        }