Пример #1
0
        public void Process()
        {
            // Display the help
            if (_arguments.Any(a => a.Equals("?") || a.Equals("-help")))
            {
                DisplayHelp();
            }

            else if (!ConsoleHelpers.AllCommandExist(_arguments, typeof(Arguments)))
            {
                return;
            }

            // Proceed a cleanup of the folder .smk-meta
            else if (ConsoleHelpers.CommandArgExists(_arguments, Arguments.RemoveArtifacts))
            {
                CleanArtefacts();
            }

            // Generate a new key
            else if (ConsoleHelpers.CommandArgExists(_arguments, Arguments.NewKey))
            {
                DisplayHeader();
                string value = ConsoleHelpers.GetCommandArgValue(_arguments, Arguments.NewKey);
                TripleDES.GenerateKey(value, _logger);
                _logger.WriteLine(string.Format(ErrorResources.Engine_KeyFileGenerated, value));
                DisplayFooter();
            }
            // Run a backup
            else
            {
                Backup();
            }
        }
Пример #2
0
        public void Process()
        {
            // Display the help
            if (_arguments.Any(a => a.Equals("?") || a.Equals("-help")))
            {
                DisplayHelp();
            }

            else if (!ConsoleHelpers.AllCommandExist(_arguments, typeof(Arguments)))
            {
                return;
            }

            Recover();
        }
Пример #3
0
        /// <summary>
        /// Take an action in according to the arguments
        /// </summary>
        public void Process()
        {
            // Display the help
            if (_arguments.Any(a => a.Equals("?") || a.Equals("-help")))
            {
                DisplayHelp();
                return;
            }

            else if (!ConsoleHelpers.AllCommandExist(_arguments, typeof(Arguments)))
            {
                return;
            }

            // Generate a new key
            else
            {
                DisplayHeader();
                string value = ConsoleHelpers.GetCommandArgValue(_arguments, Arguments.File);
                TripleDES.GenerateKey(value, _logger);
                _logger.WriteLine(string.Format(ErrorResources.Engine_KeyFileGenerated, value));
                DisplayFooter();
            }
        }