Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace World1
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Days days = Days.Fr;
- Console.WriteLine("My PI = {0}", Person.PI);
- Console.WriteLine("Only for read = {0}", Person.onlyRead);
- // int counter = 0;
- Person person1 = new Person("Stoyan", 51);
- // person1.Name = "Stoyan";
- // person1.Age = 51;
- // counter++;
- Person person2 = new Person(20, "Mario", "Bobi", "Kristian", "Stoyan", "Anton");
- // person2.Name = "Mario";
- // person2.Age = 20;
- // counter++;
- Person person3 = new Person();
- // counter++;
- IncreasPopulation();
- person1.IntroduceYourSelf();
- person2.IntroduceYourSelf();
- person3.IntroduceYourSelf();
- Person.Nationality = "German";
- person1.IntroduceYourSelf();
- person2.IntroduceYourSelf();
- person3.IntroduceYourSelf();
- // Console.WriteLine("The population of my kingdom is {0}", counter);
- Console.WriteLine("The population of my kingdom is {0}", Person.Counter);
- Console.WriteLine("National Income = {0}", Person.GetNationalIncome());
- Person student1 = new Student("Kircho", 25, "4314324234");
- student1.IntroduceYourSelf();
- Student student2 = new Student();
- Athlete athlete1 = new Athlete("Krisi", 25, "box");
- athlete1.IntroduceYourSelf();
- Executor exec = new Executor(student1);
- exec.MakeHimSpeak();
- Console.WriteLine(student1); // .ToString()
- /*
- Console.WriteLine("My name is {0}! I am {1} years old! My balance is {2}",
- person1.Name, person1.Age, person1.Balance);
- Console.WriteLine("My name is {0}! I am {1} years old!",
- person2.Name, person2.Age);
- Console.WriteLine("My name is {0}! I am {1} years old!",
- person3.Name, person3.Age);
- */
- Console.WriteLine(Days.Fr);
- Console.WriteLine((int)Days.Fr);
- Console.WriteLine(Days.Fr is Days);
- Manager<Student> man1 = new Manager<Student>();
- man1.AddEntity(student2);
- man1.AddEntity(student2);
- man1.AddEntity(student2);
- man1.RemoveEntity();
- man1.RemoveEntity();
- Console.WriteLine(man1.GetNumberOfEntities());
- Console.WriteLine("=========================================");
- var autoPerson1 = new AutoPerson { Name = "Stoyan", Age = 51};
- // autoPerson1.Name = "Stoyan";
- // autoPerson1.Age = 51;
- Console.WriteLine("Atoperson Name = {0} Age = {1}",
- autoPerson1.Name, autoPerson1.Age);
- var name = "Stoyan";
- var age = 51;
- Console.WriteLine("Name = {0} Age = {1}", name, age);
- // List<AutoPerson> people = new List<AutoPerson>();
- // people.Add(autoPerson1);
- // AutoPerson autoperson2 = new AutoPerson();
- // people.Add(autoPerson2);
- List<AutoPerson> people = new List<AutoPerson>() {
- new AutoPerson { Name = "Scott", Age = 43 }, // read only properties
- new AutoPerson { Name = "Susan", Age = 15 },
- new AutoPerson { Name = "Ivan", Age = 16 },
- new AutoPerson { Name = "Peter", Age = 16 }
- };
- foreach (AutoPerson person in people)
- {
- Console.WriteLine(person.Name);
- }
- var anonymousPerson = new { Name = "Marion", Age = 19, Gender = "female" };
- var anonymousArray = new[] { new { Name = "Stoyan", Age = 51 }, new { Name = "Stoyan", Age = 34 } }; // new { Type = "Product1", Price = 34.56}
- // anonymousPerson.Name = "NotPossible Only for reading";
- DelegateTest delegateTest = new DelegateTest();
- DelegateTest.Test();
- person1.onIntroduce = OnIntroduce;
- // person1.onIntroduce = OnIntroduce;
- person1.IntroduceYourSelf();
- Console.WriteLine("This is a valid e-mail {0}", myEmail.IsValidEmailAddress());
- // IEnumerable
- var result = from p in people
- where p.Name.StartsWith("S")
- orderby p.Age descending
- select new { p.Name, p.Age, sex = 2 };
- foreach (var personI in result)
- {
- Console.WriteLine("Found {0} {1}", personI.Name, personI.Age);
- }
- }
- private static void IncreasPopulation()
- {
- Person person1 = new Person("Petko", 15);
- }
- public enum Days
- {
- Mo, Tu, We, Th, Fr = 1400, Sa, Su
- }
- private static void OnIntroduce(string message)
- {
- Console.WriteLine("===== Hahahah This guy {0} again introduced him self", message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment