Example #1
0
        public Automator(string ConfigFileName, Translation GlobalTranslation)
        {
            tsl = GlobalTranslation;
            // Read the Config File
            CurrentConfig = ReadConfigFile(CurrentConfig,ConfigFileName);
            PrintMessagesToConsole(CurrentConfig,tsl);

               // Get login / password from console
               GetCredentials(ref CurrentConfig.OutputUserLogin, ref CurrentConfig.OutputUserPassword, "[LOGININPUT]", "[PASSWORDINPUT]");

            // Create MezzoObject
            myMezzoObject = new MezzoObject(CurrentConfig.OutputUserLogin, CurrentConfig.OutputUserPassword, CurrentConfig.OutputServerUrl);
            // Change workspace
            myMezzoObject.ChangeWorkspace(CurrentConfig.OutputWorkspaceId);
            Utils.MaMessage(String.Format(tsl.T("[CONNECTED]"), DateTime.Now.ToString(TimeFormat), myMezzoObject.UserCurrentFullName), Utils.maMessageLineType.WriteLine, Utils.maMessageOutput.ConsoleAndLog, CurrentConfig.LogFile);
            Utils.MaMessage("");
        }
Example #2
0
        private void PrintMessagesToConsole(Config CurrentConfig, Translation tsl)
        {
            // Welcome message
            Utils.MaMessage("", Utils.maMessageLineType.WriteLine, Utils.maMessageOutput.Log, CurrentConfig.LogFile);
            Utils.MaMessage("============================================================", Utils.maMessageLineType.WriteLine, Utils.maMessageOutput.Log, CurrentConfig.LogFile);
            Utils.MaMessage(String.Format(tsl.T("[COPYRIGHT]"),VersionNumber),Utils.maMessageLineType.WriteLine,Utils.maMessageOutput.ConsoleAndLog,CurrentConfig.LogFile);
            Utils.MaMessage(String.Format(tsl.T("[STARTED]"), DateTime.Now.ToString()), Utils.maMessageLineType.WriteLine, Utils.maMessageOutput.ConsoleAndLog, CurrentConfig.LogFile);
            // Run mode message
            if (CurrentConfig.AutomationDelay == 0)
                Utils.MaMessage(tsl.T("[RUNONCE]"));
            else
                Utils.MaMessage(String.Format(tsl.T("[TRIGGER]"), CurrentConfig.AutomationDelay.ToString()));

            Utils.MaMessage(tsl.T("[CTRLC]"), Utils.maMessageLineType.WriteLine);
            Utils.MaMessage("");

               // Get login / password from console
            Utils.MaMessage(String.Format(tsl.T("[CONNECTING]"), DateTime.Now.ToString(TimeFormat), CurrentConfig.OutputServerUrl), Utils.maMessageLineType.WriteLine, Utils.maMessageOutput.ConsoleAndLog, CurrentConfig.LogFile);
        }