static void Main(string[] args) { MobileOperator Life = new MobileOperator(); var user1 = new MobileAccount(); var user2 = new MobileAccount(); var user3 = new MobileAccount(); var Serializator = new MySerializator(); user1 = Serializator.DeSerializationJSON("JSONDima.json"); user2 = Serializator.DeSerializationJSON("JSONWeronika.json"); user3 = Serializator.DeSerializationJSON("JSONKate.json"); if (user1.Validate() && user2.Validate() && user3.Validate()) { Life.Registrate(user1); Life.Registrate(user2); Life.Registrate(user3); user1.Call(user2.Number); user2.Call(user1.Number); XMLOperations.FindByName("XMLMobileOperator.xml", "Dima"); MobileAccount user4 = XMLOperations.GetByName("XMLMobileOperator.xml", "Dima"); Console.WriteLine(user4.Name); List <string> sample = XMLOperations.Sample("XMLMobileOperator.xml", "Name"); foreach (var number in sample) { Console.WriteLine(number); } //XMLOperations.AddElementToXML("XMLMobileOperator.xml", user1); XMLOperations.RemuveByName("XMLMobileOperator.xml", "Kate"); } Console.ReadLine(); }
static void Main(string[] args) { MobileOperator Life = new MobileOperator(); MobileAccount user1 = new MobileAccount("Dima", "Kobets", new DateTime(1996, 12, 27), "*****@*****.**"); MobileAccount user2 = new MobileAccount("Weronika", "Nikolaeva", new DateTime(1996, 2, 12), "*****@*****.**"); MobileAccount user3 = new MobileAccount("Kate", "Kos", new DateTime(1996, 12, 2), "*****@*****.**"); if (user1.Validate() && user2.Validate() && user3.Validate()) { Life.Registrate(user1); Life.Registrate(user2); Life.Registrate(user3); user1.AddToBook(user2); user1.AddToBook(user3); user2.AddToBook(user1); user2.AddToBook(user3); user3.AddToBook(user1); user3.AddToBook(user2); MySerializator.BinarySerialization(user1); MySerializator.BinarySerialization(user2); MySerializator.BinarySerialization(user3); MySerializator.XMLSerialization(user1); MySerializator.XMLSerialization(user2); MySerializator.XMLSerialization(user3); MySerializator.JSONSerialization(user1); MySerializator.JSONSerialization(user2); MySerializator.JSONSerialization(user3); MySerializator.ProtoBufSerialization(user1); MySerializator.ProtoBufSerialization(user2); MySerializator.ProtoBufSerialization(user3); } Console.ReadLine(); }
static void Main(string[] args) { MobileOperator Life = new MobileOperator(); //MobileAccount user1 = new MobileAccount("Dima", "Kobets", new DateTime(1996,12,27), "*****@*****.**"); //MobileAccount user2 = new MobileAccount("Weronika", "Nikolaeva", new DateTime(1996,2,12), "*****@*****.**"); //MobileAccount user3 = new MobileAccount("Kate", "Kos", new DateTime(1996, 12, 2), "*****@*****.**"); var user1 = new MobileAccount(); var user2 = new MobileAccount(); var user3 = new MobileAccount(); var Serializator = new MySerializator(); user1 = Serializator.DeSerializationJSON("JSONDima.json"); user2 = Serializator.DeSerializationJSON("JSONWeronika.json"); user3 = Serializator.DeSerializationJSON("JSONKate.json"); if (user1.Validate() && user2.Validate() && user3.Validate()) { Life.Registrate(user1); Life.Registrate(user2); Life.Registrate(user3); user1.AddToBook(user2); user1.AddToBook(user3); user2.AddToBook(user1); user2.AddToBook(user3); user3.AddToBook(user1); user3.AddToBook(user2); user1.Call(user2.Number); user2.Call(user1.Number); } Console.ReadLine(); }