Пример #1
0
 public bool Equals(DADTestC o)
 {
     if (o == null)
     {
         return(false);
     }
     else
     {
         return((this.i1 == o.i1) && (this.s1.Equals(o.s1)) && (this.s2.Equals(o.s2)));
     }
 }
Пример #2
0
        private object analisa(string field)
        {
            if (field[7].ToString().Equals("A"))
            {
                int      tamanho    = field.Length - 10;
                string   argsJuntos = field.Substring(9, tamanho);
                string[] args       = argsJuntos.Split('"');
                int      arg1       = Int32.Parse(args[0]);
                string   arg2       = args[1];

                DADTestA dadA = new DADTestA(arg1, arg2);
                //Type type = dadA.GetType();
                //object instance = Activator.CreateInstance(type);
                return(dadA);
            }
            if (field[7].ToString().Equals("B"))
            {
                int      tamanho    = field.Length - 10;
                string   argsJuntos = field.Substring(9, tamanho);
                string[] args       = argsJuntos.Split('"');
                int      arg1       = Int32.Parse(args[0]);
                string   arg2       = args[1];
                int      arg3       = Int32.Parse(args[2]);

                DADTestB dadB = new DADTestB(arg1, arg2, arg3);
                //Type type = dadB.GetType();
                //object instance = Activator.CreateInstance(type);
                return(dadB);
            }
            if (field[7].ToString().Equals("C"))
            {
                int      tamanho    = field.Length - 10;
                string   argsJuntos = field.Substring(9, tamanho);
                string[] args       = argsJuntos.Split('"');
                int      arg1       = Int32.Parse(args[0]);
                string   arg2       = args[1];
                string   arg3       = args[3];

                DADTestC dadC = new DADTestC(arg1, arg2, arg3);
                //Type type = dadC.GetType();
                //object instance = Activator.CreateInstance(type);
                return(dadC);
            }
            return(null);
        }