static void Main(string[] args) { CopywriterCollection collection1 = new CopywriterCollection("Collection 1"); CopywriterCollection collection2 = new CopywriterCollection("Collection 2"); Journal journal1 = new Journal(); Journal journal2 = new Journal(); collection1.CopywriterCountChanged += journal1.CopywriterCountChanged; collection1.CopywriterReferenceChanged += journal1.CopywriterReferenceChanged; collection1.CopywriterReferenceChanged += journal2.CopywriterReferenceChanged; collection2.CopywriterReferenceChanged += journal2.CopywriterReferenceChanged; collection1.AddDefaults(); collection1.AddDefaults(); collection1.AddDefaults(); collection1.Remove(1); collection1[0].Nickname = "Arkos"; collection1[0] = new Copywriter(new Person(), "Ortem", new Level(), 1000); collection1.AddCopywriters(new Copywriter()); collection2.AddDefaults(); collection2.AddDefaults(); collection2.Remove(0); collection2[0].Nickname = "ArkosLUL"; collection2.AddCopywriters(new Copywriter(new Person(), "ArkosOmegaLUL", new Level(), 150)); collection2[1] = new Copywriter(new Person(), "ArkosLUL", new Level(), 200); Console.WriteLine(journal1.ToString()); Console.WriteLine(journal2.ToString()); Console.ReadKey(); }
static void Main(string[] args) { CopywriterCollection <string> dictionary1 = new CopywriterCollection <string>("First collection"); CopywriterCollection <string> dictionary2 = new CopywriterCollection <string>("Second collection"); Journal <string> journal = new Journal <string>(); dictionary1.CopywritersChanged += journal.CopywritersChanged; dictionary2.CopywritersChanged += journal.CopywritersChanged; Copywriter Mark = new Copywriter(new Person("Mark", "Wolf", new DateTime(1967, 01, 01)), "Boss of this gym", Level.MidLevel, 4); Copywriter Van = new Copywriter(new Person("Van", "Darkholme", new DateTime(1972, 10, 24)), "Dungeon Master", (Level)2, 3); Copywriter Aniki = new Copywriter(new Person("Billy", "Herrington", new DateTime(1969, 07, 14)), "Big Brother", (Level)2, 1); Copywriter Arkos = new Copywriter(new Person("Artem", "Kosogov", new DateTime(2000, 05, 26)), "Arkos", (Level)2, 2); dictionary1.AddCopywritersToDictionary("111", Arkos); dictionary1.AddCopywritersToDictionary("112", Aniki); dictionary1.AddCopywritersToDictionary("113", Van); dictionary2.AddCopywritersToDictionary("111", Mark); dictionary1["112"].Nickname = "Aniki"; dictionary1["111"].Rating = 3; dictionary1.Remove(Arkos); Arkos.Rating = 4; Console.WriteLine(journal.ToString()); List <Copywriter> sortedList = dictionary1.GetSortedListOfCopywriters(); foreach (var cw in sortedList) { Console.WriteLine(cw.ToString()); } Console.ReadKey(); }