Exemple #1
0
        private void CodingItem(TypeCoding typeCoding)
        {
            StringBuilder resultMenuFile = ReadDataMenu();

            if (resultMenuFile != null)
            {
                CeazarCode ceazarCode = new CeazarCode();
                int?       num        = GerKeyMenu();
                if (num != null)
                {
                    StringBuilder result = null;
                    if (typeCoding == TypeCoding.ENCODING)
                    {
                        result = ceazarCode.EncodingUA(resultMenuFile, (int)num);
                    }
                    else
                    {
                        result = ceazarCode.DecodingUA(resultMenuFile, (int)num);
                    }
                    if (result != null)
                    {
                        WriteDataMenu(result);
                    }
                    else
                    {
                        Console.WriteLine(_messageError);
                    }
                }
                else
                {
                    Console.WriteLine(_messageError);
                }
            }
        }
Exemple #2
0
        private void DecodingWithoutKeyItem()
        {
            StringBuilder resultMenuFile = ReadDataMenu();

            if (resultMenuFile != null)
            {
                CeazarCode    ceazarCode = new CeazarCode();
                StringBuilder result     = ceazarCode.DecodingWithoutKey(resultMenuFile);
                if (result != null)
                {
                    WriteDataMenu(result);
                }
                else
                {
                    Console.WriteLine(_messageError);
                }
            }
        }