private void event_GenerateNewScript()
        {
            try {
                string scriptName;
                string labelText   = "New Script Name:";
                string buttonText  = "Save Script";
                string messageText = "Message: Existing script with the same name will be replaced.";

                FormDataRetrieval dataRetrieval;
                dataRetrieval = new FormDataRetrieval(labelText, buttonText, messageText);
                DialogResult dialogResult = dataRetrieval.ShowDialog();

                if (dialogResult == DialogResult.OK)
                {
                    scriptName = dataRetrieval.dataValue.ToUpper();
                    event_SaveScript(scriptName);
                    scriptList.Add(scriptName);
                    dropdownScriptList.Items.Add(scriptName);
                    labelScript.Text = "Script: " + scriptName;
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        //***************************************************************************************************************
        // Action Events Handler Methods
        //***************************************************************************************************************



        private string event_RetrieveName(string buttonText)
        {
            string            labelText = "Name:";
            FormDataRetrieval dataRetrieval;

            dataRetrieval = new FormDataRetrieval(formMain.settingsInfo["UiColor"], labelText, buttonText, String.Empty);
            DialogResult dialogResult = dataRetrieval.ShowDialog();

            if (dialogResult != DialogResult.OK)
            {
                return(String.Empty);
            }
            else
            {
                return(dataRetrieval.UserSpecifiedDataValue.Replace(" ", "_"));
            }
        }
Exemplo n.º 3
0
        private string event_RetrieveComponentName(string buttonText, string messageText)
        {
            string            labelText = "Component Name:";
            FormDataRetrieval dataRetrieval;

            dataRetrieval = new FormDataRetrieval(formMain.settingsInfo["UiColor"], labelText, buttonText, messageText);
            var dialogResult = dataRetrieval.ShowDialog();

            if (dialogResult != DialogResult.OK)
            {
                return("");
            }
            else
            {
                return(dataRetrieval.UserSpecifiedDataValue);
            }
        }
Exemplo n.º 4
0
        private void action_CreateTable(object sender, EventArgs e)
        {
            try {
                string tableName;
                string labelText   = "New Table Name:";
                string buttonText  = "Create Table";
                string messageText = "Message: A new table will be created with 'TestCaseID' as the only column.";

                FormDataRetrieval dataRetrieval;
                dataRetrieval = new FormDataRetrieval(labelText, buttonText, messageText);
                DialogResult dialogResult = dataRetrieval.ShowDialog();

                if (dialogResult == DialogResult.OK)
                {
                    tableName = dataRetrieval.dataValue.ToUpper();
                    event_GenerateNewTable(tableName);
                }
            }
            catch (Exception ex) {
                MessageBox.Show("ERROR: action_CreateTable" + "\n" + ex.Message);
            }
        }
Exemplo n.º 5
0
        private void action_DeleteTable(object sender, EventArgs e)
        {
            try {
                string tableName;
                string labelText   = "Name of Table to Delete:";
                string buttonText  = "Delete Table";
                string messageText = "Message: The specified table will be deleted. This action cannot be undone.";

                FormDataRetrieval dataRetrieval;
                dataRetrieval = new FormDataRetrieval(labelText, buttonText, messageText);
                DialogResult dialogResult = dataRetrieval.ShowDialog();

                if (dialogResult == DialogResult.OK)
                {
                    tableName = dataRetrieval.dataValue.ToUpper();
                    event_DeleteExistingTable(tableName);
                }
            }
            catch (Exception ex) {
                MessageBox.Show("ERROR: action_DeleteTable" + "\n" + ex.Message);
            }
        }
Exemplo n.º 6
0
        private void action_DeleteScript(object sender, EventArgs e)
        {
            try {
                string scriptName;
                string labelText   = "Script Name To Delete:";
                string buttonText  = "Delete Script";
                string messageText = "Message: Deleting a script cannot be undone.";

                FormDataRetrieval dataRetrieval;
                dataRetrieval = new FormDataRetrieval(labelText, buttonText, messageText);
                var dialogResult = dataRetrieval.ShowDialog();

                if (dialogResult == DialogResult.OK)
                {
                    scriptName = dataRetrieval.dataValue.ToUpper();
                    string scriptPath = scriptsDirectory + "\\" + scriptName + ".xml";
                    event_DeleteSpecifiedScript(scriptPath, scriptName);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 7
0
        private string event_RetrieveScriptName(string buttonText)
        {
            string scriptName;

            try {
                FormDataRetrieval dataRetrieval = new FormDataRetrieval(
                    formMain.settingsInfo["UiColor"],
                    "Script Name:",
                    buttonText,
                    "Message: Only use alpha-characters.");

                if (dataRetrieval.ShowDialog() != DialogResult.OK)
                {
                    return(String.Empty);
                }
                scriptName = dataRetrieval.UserSpecifiedDataValue.Trim().Replace(" ", "");
            }
            catch (Exception ex) {
                scriptName = "";
                MessageBox.Show(ex.Message);
            }

            return(scriptName);
        }