Exemple #1
0
        static void Main()
        {
            system = new DocumentSystem();
            IList <string> allCommands = ReadAllCommands();

            ExecuteCommands(allCommands);
        }
Exemple #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            DocumentSystem test = new DocumentSystem();

            test.FirstInit();
        }
        private static void ExecuteCommand(string cmd, string parameters)
        {
            DocumentSystem documentSystem = new DocumentSystem();

            string[] cmdAttributes = parameters.Split(
                new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            if (cmd == "AddTextDocument")
            {
                documentSystem.AddTextDocument(cmdAttributes);
            }
            else if (cmd == "AddPDFDocument")
            {
                documentSystem.AddPdfDocument(cmdAttributes);
            }
            else if (cmd == "AddWordDocument")
            {
                documentSystem.AddWordDocument(cmdAttributes);
            }
            else if (cmd == "AddExcelDocument")
            {
                documentSystem.AddExcelDocument(cmdAttributes);
            }
            else if (cmd == "AddAudioDocument")
            {
                documentSystem.AddAudioDocument(cmdAttributes);
            }
            else if (cmd == "AddVideoDocument")
            {
                documentSystem.AddVideoDocument(cmdAttributes);
            }
            else if (cmd == "ListDocuments")
            {
                documentSystem.ListDocuments();
            }
            else if (cmd == "EncryptDocument")
            {
                documentSystem.EncryptDocument(parameters);
            }
            else if (cmd == "DecryptDocument")
            {
                documentSystem.DecryptDocument(parameters);
            }
            else if (cmd == "EncryptAllDocuments")
            {
                documentSystem.EncryptAllDocuments();
            }
            else if (cmd == "ChangeContent")
            {
                documentSystem.ChangeContent(cmdAttributes[0], cmdAttributes[1]);
            }
            else
            {
                throw new InvalidOperationException("Invalid command: " + cmd);
            }
        }
 static void Main()
 {
     system = new DocumentSystem();
     IList<string> allCommands = ReadAllCommands();
     ExecuteCommands(allCommands);
 }