static void Main()
        {
            Random rnd = new();

            array = new ConsoleSymbol[10];
            for (int i = 0; i < array.Length; i++)
            {
                if (rnd.Next(2) == 0)
                {
                    array[i] = new((char)('A' + rnd.Next(26)), rnd.Next(200), rnd.Next(100));
                }
                else
                {
                    array[i] = new ColorConsoleSymbol((char)('A' + rnd.Next(26)), rnd.Next(200), rnd.Next(100),
                                                      (ConsoleColor)rnd.Next(16));
                }
            }
            BinaryFormat();
            XmlFormat();
            JsonFormat();
            DataContractFormat();
        }
        private static void Main(string[] args)
        {
            List <Color> listOfColors = new List <Color>()
            {
                Color.AliceBlue,
                Color.IndianRed,
                Color.AntiqueWhite,
                Color.Aquamarine,
                Color.Black,
                Color.Brown,
                Color.DarkBlue
            };

            ColorConsoleSymbol[] colorConsole = new ColorConsoleSymbol[10];
            List <ConsoleSymbol> listColor    = new List <ConsoleSymbol>();

            for (int i = 0; i < 10; i++)
            {
                var temp = new ColorConsoleSymbol(
                    (char)rnd.Next(97, 123),
                    rnd.Next(1, 100), rnd.Next(1, 50),
                    listOfColors[rnd.Next(1, 7)]);
                colorConsole[i] = temp;
                listColor.Add(temp);
            }
            var xmlSerialize = new XmlSerializer(typeof(List <ConsoleSymbol>), new[] { typeof(ColorConsoleSymbol) });

            using (var fileStreamWriter = new FileStream("Data.xml", FileMode.Create, FileAccess.Write))
            {
                using var streamWriter = new StreamWriter(fileStreamWriter);
                xmlSerialize.Serialize(streamWriter, listColor);
            }
            Console.WriteLine(Environment.NewLine + "XML десереализация: ");
            using (var fsReader = new FileStream("Data.xml", FileMode.Open, FileAccess.Read))
            {
                using var sReader = new StreamReader(fsReader);
                var symbolsDeserialize = (List <ConsoleSymbol>)xmlSerialize.Deserialize(sReader);
                foreach (var p in symbolsDeserialize)
                {
                    Console.WriteLine($"X: {p.X}, Y: {p.Y}");
                    Console.WriteLine(p);
                }
            }

            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream("people.dat", FileMode.OpenOrCreate))
            {
                formatter.Serialize(fs, colorConsole);
            }

            Console.WriteLine(Environment.NewLine + "Бинарная десереализация: ");
            using (FileStream fs = new FileStream("people.dat", FileMode.OpenOrCreate))
            {
                ColorConsoleSymbol[] deserilizePeople = (ColorConsoleSymbol[])formatter.Deserialize(fs);

                foreach (var p in deserilizePeople)
                {
                    Console.WriteLine($"X: {p.X}, Y: {p.Y}");
                    Console.WriteLine(p);
                }
            }
        }