Exemple #1
0
        static void Main(string[] args)
        {
            MyEnum     me  = MyEnum.your;
            MyStruct   ms  = new MyStruct(1, 2, 3);
            Object     obj = new object();
            Class1     c1  = new Class1(1, 2, 3);
            IInterface iif = new ClassFace();

            int[]  arrint = new int[] { 10, 11, 12 };
            Class1 c2     = new Class1(2, 3, 4);

            Class1[]   arrc1             = new Class1[] { c1, c2 };
            ArrayList  arrlist           = new ArrayList(); arrlist.Add("{}");
            List <int> intlist           = new List <int>(); intlist.Add(999);
            Hashtable  has               = new Hashtable(); has.Add('2', 5);
            Dictionary <float, byte> dic = new Dictionary <float, byte>(); dic.Add(1.5f, 15);
            Queue            arrqueue    = new Queue(); arrqueue.Enqueue(c2);
            Queue <double>   queue       = new Queue <double>(); queue.Enqueue(15.63);
            Stack            arratack    = new Stack(); arratack.Push(me);
            Stack <decimal>  stack       = new Stack <decimal>(); stack.Push(47);
            List <ArrayList> aar1        = new List <ArrayList>(); aar1.Add(arrlist);

            ArrayList[] a  = new ArrayList[] { arrlist };
            ClassFace   cf = new ClassFace();


            MyClass mc1 = new MyClass(me, -10, 15, '=', -99, 89, 15, -45, 25, -78, true, ms, obj, "你好!AVB+", c1, iif, Print, arrint,
                                      arrc1, arrlist, intlist, has, dic, arrqueue, queue, arratack, stack, aar1, a, cf, 96, 100);

            //cf.my = mc1;

            XmlSerializerHelper.InstanceToFileByXml(mc1, "D:\\Desktop\\xml2.xml");
            MyClass m0 = XmlSerializerHelper.FileToInstanceByXml <MyClass>("D:\\Desktop\\xml2.xml"); m0.Print();


            MemoryStream stream = XmlSerializerHelper.InstanceToMemoryByXml(mc1);
            MyClass      cc     = XmlSerializerHelper.MemoryToInstanceByXml <MyClass>(stream, 0); cc.Print();


            Console.Read();
        }
Exemple #2
0
    //public Hashtable has;
    //public Dictionary<float, byte> dic;
    //public Queue arrqueue;
    //public Queue<double> queue;
    //public Stack arrsta;
    //public Stack<decimal> sta;

    //public ArrayList[] a;

    public MyClass(MyEnum enu, sbyte sby, byte @by, char ch,
                   short sh, ushort ush, uint uin, long lo, ulong ulo,
                   int num, bool isbo, MyStruct ms, object obj, string str,
                   Class1 c1, IInterface ii, Action ac, int[] arrint, Class1[] arrClass1S,
                   ArrayList arrlist, List <int> list, Hashtable has, Dictionary <float, byte> dic,
                   Queue arrqueue, Queue <double> queue, Stack arrsta, Stack <decimal> sta, List <ArrayList> arrl, ArrayList[] a, ClassFace cf, sbyte Sby, byte face)
    {
        this.enu1 = enu;
        this.sby  = sby;
        this.@by  = @by;
        this.ch   = ch;
        this.sh   = sh;
        this.ush  = ush;
        this.uin  = uin;
        this.lo   = lo;
        this.ulo  = ulo;
        this.num  = num;
        this.isbo = isbo;
        this.ms   = ms;
        this.obj  = obj;
        this.str  = str;
        this.c1   = c1;
        //this.ii = ii;
        //this.ac = ac;
        this.arrint  = arrint;
        ArrClass1s   = arrClass1S;
        this.arrlist = arrlist;
        this.list    = list;
        //this.has = has;
        //this.dic = dic;
        //this.arrqueue = arrqueue;
        //this.queue = queue;
        //this.arrsta = arrsta;
        //this.sta = sta;
        this.arrl = arrl;
        //this.a = a;
        this.cf   = cf;
        this.Sby  = Sby;
        this.face = face;
    }