static void Main(string[] args) { Console.WriteLine("KARDEX DE INGENIERÍA BIOMÉDICA \n"); Class1.Datos(); Console.WriteLine("Servicios: \n"); int servicio; Console.WriteLine("1. Clases según el semestre que cursas"); Console.WriteLine("2. Calificaciones finales"); Console.WriteLine("3. Especialidades de la carrera"); servicio = int.Parse(Console.ReadLine()); switch (servicio) { case 1: Class2.Semestre(); break; case 2: Class3.Calificaciones(); break; case 3: Class4.Especialidades(); break; default: Console.WriteLine("Esta opción no existe"); break; } Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine(""); Console.WriteLine("-------------------------------"); Console.WriteLine(""); Class1 argument = new Class1(); argument.Print(); Class1 argument1 = new Class1(228); argument1.Print(); Class1 argument2 = new Class1(1488, 1337); argument2.Print(); Console.WriteLine(""); Console.WriteLine("-------------------------------"); Console.WriteLine(""); Class2 text1 = new Class2(); Class2 text2 = new Class2(); Class2 text3 = new Class2(); text1.Write(); text1.Print(); text2.Write("Сессия"); text2.Print(); text3.Write("Сессия сдана"); text3.Print(); Console.WriteLine(""); Console.WriteLine("-------------------------------"); Console.WriteLine(""); Class3 triangle = new Class3(15, 7, 1); Console.WriteLine("-------------------------------"); Class3 triangle2 = new Class3(12, 5, 13); Console.WriteLine(""); Console.WriteLine("-------------------------------"); Console.WriteLine(""); Console.ReadLine(); }
static void Main(string[] args) { string[] aaa = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; List<string> bbb = new List<string> { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" }; Dictionary<string, string> ccc = new Dictionary<string, string>() { { "aaa", "aaaaa"}, { "bbb", "bbbbb"}, { "ccc", "ccccc"}, { "ddd", "ddddd"} }; Console.WriteLine(Class1.SerializeObject(aaa)); Console.WriteLine(Class2.SerializeObject(bbb)); Console.WriteLine(Class3.SerializeObject(ccc)); Console.ReadKey(); }
public static void ExtemsionMethod() { Class3 c = new Class3(); c.Display(); c.Print(); c.NewMethod11(); c.NewMethod15(); Class1 c1 = new Class1(); c1.Display(); c1.Print(); c1.NewMethod(); c1.NewMethod13(); c1.NewMethod14(); }
public static void NewMethod15(this Class3 obj) { Console.WriteLine("I am extended Class3 NewMethod15"); }
public static void NewMethod11(this Class3 obj) //extension method, static, this { Console.WriteLine("Hello I am extended method"); }
static void Main(string[] args) { Class3.Start(); }