Example #1
0
        public static void Main(string[] args)
        {
            //PRUEBAS DE TIPOS DE DATOS

            /*int i=11;
             * Type tipo = i.GetType ();
             * //Console.WriteLine ("tipo.Name={0}, {1}", tipo.Name,tipo.FullName); ES PARA HACER REFERENCIA A LO DE DESOPUES DE LA COMA [0,1,2,3...]
             * showType (tipo);
             *
             * string cadena="Hola skoner";
             * Type tipo2 = cadena.GetType ();
             * //Console.WriteLine ("tipo2.Name={0}", tipo2.Name);
             * showType (tipo2);
             *
             * Type tipostring = typeof(string);
             * //Console.WriteLine ("tipostring.Name={0}", tipostring.Name);
             * showType (tipostring);
             *
             * Type tipobase = typeof(object);
             * showType (tipobase);
             *
             * Type tipoFoo = typeof(Foo);
             * showType (tipoFoo);
             * Foo foo = new Foo ();
             * //showObject (foo);*/

            Articulo articulo = new Articulo();

            /*articulo.Nombre="articulo 1";
             * articulo.Categoria=2;
             * articulo.Precio = decimal.Parse("7.5");*/
            setValues(articulo, new object[] { 33L, "nuevo articulo 1", 3L, decimal.Parse("11,11") }); // DEBEN IR EN EL ORDEN PUESTO EN LA CLASE DEL OBJETO
            showType(articulo.GetType());                                                              //IGUAL QUE Type tipoFoo = typeof(Foo);  showType (tipoFoo);
            showObject(articulo);
        }                                                                                              //DEL MAIN
Example #2
0
        public static void Main(string[] args)
        {
            object i = 33;
            Type type1 = i.GetType ();
            showType (type1);

            object s = "hola";
            Type type2 = s.GetType ();
            showType (type2);

            Type typeX = typeof(string);
            showType (typeX);

            Type typeFoo = typeof(Foo);
            showType (typeFoo);

            Type type0 = typeof(object);
            showType (type0);

            Articulo articulo = new Articulo ();
            showType (articulo.GetType ());

            articulo.Nombre = "nombre 33";
            articulo.Categoria = 2;
            articulo.Precio = 3.5m;
            showObject (articulo);
            setValues (articulo, new object[] { 33L, "numero 33 modificado", decimal.Parse("33.33") });
            showObject (articulo);
        }
Example #3
0
        public static void Main(string[] args)
        {
            object i     = 33;
            Type   type1 = i.GetType();

            showType(type1);

            object s     = "hola";
            Type   type2 = s.GetType();

            showType(type2);

            Type typeX = typeof(string);

            showType(typeX);


            Type typeFoo = typeof(Foo);

            showType(typeFoo);

            Type type0 = typeof(object);

            showType(type0);

            Articulo articulo = new Articulo();

            showType(articulo.GetType());

            articulo.Nombre    = "nombre 33";
            articulo.Categoria = 2;
            articulo.Precio    = 3.5m;
            showObject(articulo);
            setValues(articulo, new object[] { 33L, "numero 33 modificado", decimal.Parse("33.33") });
            showObject(articulo);
        }
Example #4
0
        public static void Main(string[] args)
        {
            /*		int i=10;
             *              Type type = i.GetType ();   //Tipo de i
             *              Console.WriteLine ("typeI.Name = {0}", type.Name);
             *
             *
             *
             *              string s = "Hola mundo";
             *              Type types = s.GetType ();  // Tipo de String
             *              Console.WriteLine ("typeI.Name = {0}", types.Name);
             *
             *
             *              Type typeX = typeof(string);  //Typeof se aplica a l
             *              Console.WriteLine ("typeI.Name = {0}", typeX.Name);
             *              showType (typeX);   //Llamas al metodo que muestre el tipo
             */

            //Type typeFoo = typeof(Foo);  //tipo de la clase
            //showType (typeFoo);

            /*
             * Type typeO = typeof(object);   //Tipo de los objetos ,Object no tiene base type
             * showType (typeO);
             */

            Articulo articulo = new Articulo();                 //Tipe de articulo

            showType(articulo.GetType());
            articulo.Nombre    = "nuevo 33";
            articulo.Categoria = 2;
            articulo.Precio    = decimal.Parse("3,5");
            showObject(articulo);
            setValues(articulo,
                      new object[] { 33L, "nuevo 33 modificado", 3L, decimal.Parse("33,33") });
        }
Example #5
0
        public static void Main(string[] args)
        {
            /*		int i=10;
            Type type = i.GetType ();   //Tipo de i
            Console.WriteLine ("typeI.Name = {0}", type.Name);

            string s = "Hola mundo";
            Type types = s.GetType ();  // Tipo de String
            Console.WriteLine ("typeI.Name = {0}", types.Name);

            Type typeX = typeof(string);  //Typeof se aplica a l
            Console.WriteLine ("typeI.Name = {0}", typeX.Name);
            showType (typeX);   //Llamas al metodo que muestre el tipo
             */

            //Type typeFoo = typeof(Foo);  //tipo de la clase
            //showType (typeFoo);
            /*
            Type typeO = typeof(object);   //Tipo de los objetos ,Object no tiene base type
            showType (typeO);
            */

            Articulo articulo = new Articulo ();    //Tipe de articulo

            showType(articulo.GetType());
            articulo.Nombre = "nuevo 33";
            articulo.Categoria = 2;
            articulo.Precio = decimal.Parse("3,5");
            showObject (articulo);
            setValues (articulo,
                      new object[]{33L,"nuevo 33 modificado",3L,decimal.Parse("33,33")});
        }
Example #6
0
        public static void Main(string[] args)
        {
            //PRUEBAS DE TIPOS DE DATOS
            /*int i=11;
            Type tipo = i.GetType ();
            //Console.WriteLine ("tipo.Name={0}, {1}", tipo.Name,tipo.FullName); ES PARA HACER REFERENCIA A LO DE DESOPUES DE LA COMA [0,1,2,3...]
            showType (tipo);

            string cadena="Hola skoner";
            Type tipo2 = cadena.GetType ();
            //Console.WriteLine ("tipo2.Name={0}", tipo2.Name);
            showType (tipo2);

            Type tipostring = typeof(string);
            //Console.WriteLine ("tipostring.Name={0}", tipostring.Name);
            showType (tipostring);

            Type tipobase = typeof(object);
            showType (tipobase);

            Type tipoFoo = typeof(Foo);
            showType (tipoFoo);
            Foo foo = new Foo ();
            //showObject (foo);*/

            Articulo articulo = new Articulo ();
            /*articulo.Nombre="articulo 1";
            articulo.Categoria=2;
            articulo.Precio = decimal.Parse("7.5");*/
            setValues (articulo, new object[] { 33L, "nuevo articulo 1", 3L, decimal.Parse("11,11") }); // DEBEN IR EN EL ORDEN PUESTO EN LA CLASE DEL OBJETO
            showType (articulo.GetType ()); //IGUAL QUE Type tipoFoo = typeof(Foo);  showType (tipoFoo);
            showObject (articulo);
        }