Esempio n. 1
0
        private void PrefixListForm_Load(object sender, EventArgs e)
        {
            Table table = shadow.GetPrefixListTable();

            CommonForm.LoadPrefixListDataGridView(prefixListGridView, table);
            prefixListGridView.Focus();
        }
Esempio n. 2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Hide();
            Table table = CommonForm.UnloadPrefixListDataGridView(prefixListGridView);

            shadow.SetPrefixListTable(table);
        }
Esempio n. 3
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Table table;

            Hide();

            // State Name
            string stateId = CommonForm.UnloadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox);

            shadow.SetStateId(stateId);

            // Prompts
            table = CommonForm.UnloadPromptDataGridView(promptsDataGridView);
            shadow.SetPrompts(table);

            // Transitions
            table = CommonForm.UnloadTransitionDataGridView(transitionsDataGridView);
            shadow.SetTransitions(table);

            // Special Settings
            table = CommonForm.UnloadSpecialSettingsTextBox(specialSettingsTextBox);
            shadow.SetSpecialSettings(table);

            // Developer Notes
            table = CommonForm.UnloadDeveloperNotesTextBox(developerNotesTextBox);
            shadow.SetDeveloperNotes(table);

            // Design Notes
            table = CommonForm.UnloadDesignNotesTextBox(designNotesTextBox);
            shadow.SetDesignNotes(table);
        }
Esempio n. 4
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Hide();
            Table table = CommonForm.UnloadChangeLogDataGridView(changeLogGridView);

            shadow.SetChangeLog(table);
        }
Esempio n. 5
0
        private void ChangeLogForm_Load(object sender, EventArgs e)
        {
            Table table = shadow.GetChangeLog();

            CommonForm.LoadChangeLogDataGridView(changeLogGridView, table);
            changeLogGridView.Focus();
        }
Esempio n. 6
0
        public void RedoFormPromptIdsIfNecessary(string promptIdFormat)
        {
            int wordCol     = promptsDataGridView.Columns[PromptTypeRow.WordingColumnName].Index;
            int promptIdCol = promptsDataGridView.Columns[PromptTypeRow.IdColumnName].Index;

            CommonForm.FixPrompts(promptsDataGridView, wordCol, promptIdCol);
        }
Esempio n. 7
0
        private void PlayForm_Load(object sender, EventArgs e)
        {
            Table table;

            // State Name
            string stateId = shadow.GetStateId();

            CommonForm.LoadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox, stateId);

            // Initialize Prompts
            table = shadow.GetPrompts();
            CommonForm.LoadPromptDataGridView(promptsDataGridView, table);

            // Initialize Transitions
            table = shadow.GetTransitions();
            CommonForm.LoadTransitionDataGridView(transitionsDataGridView, table);

            // Special Settings
            table = shadow.GetSpecialSettings();
            CommonForm.LoadSpecialSettingsTextBox(specialSettingsTextBox, table);

            // Developer Notes
            table = shadow.GetDeveloperNotes();
            CommonForm.LoadDeveloperNotesTextBox(developerNotesTextBox, table);

            // Design Notes
            table = shadow.GetDesignNotes();
            CommonForm.LoadDesignNotesTextBox(designNotesTextBox, table);

            statePrefixTextBox.Focus();
        }
Esempio n. 8
0
        public void RedoFormPromptIdsIfNecessary(string promptIdFormat)
        {
            int wordCol     = promptsDataGridView.Columns[PromptTypeRow.WordingColumnName].Index;
            int promptIdCol = promptsDataGridView.Columns[PromptTypeRow.IdColumnName].Index;

            CommonForm.FixPrompts(promptsDataGridView, wordCol, promptIdCol);
            //Set for Confirmation grid
            //promptIdCol does not exist for confirmation
            wordCol = confirmationDataGridView.Columns[PromptTypeRow.WordingColumnName].Index;
            CommonForm.FixPrompts(confirmationDataGridView, wordCol, promptIdCol);
        }
Esempio n. 9
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Hide();

            string chosen = CommonForm.UnloadSubDialogListBox(subDialogListBox);

            if (chosen != null && chosen.Length > 0)
            {
                shadow.SetSubDialogUID(chosen);
            }
        }
Esempio n. 10
0
        public static void FixPrompts(DataGridView view, int wordCol, int promptIdCol)
        {
            string promptType      = string.Empty;
            char   letter          = Strings.DefaultPromptLetter;
            int    promptTypeIndex = 0;

            //null out prompt id field
            for (int cnt = 0; cnt < view.RowCount - 1; cnt++)
            {
                view[promptIdCol, cnt].Value = null;
            }

            for (int cnt = 0; cnt < view.RowCount - 1; cnt++)
            {
                if (!view[wordCol, cnt].Value.Equals(null) && !view[wordCol, cnt].Value.Equals(""))
                {
                    int promptIdIndex = view.Columns[PromptTypeRow.IdColumnName].Index;

                    if (view.Columns[PromptTypeRow.TypeColumnName] != null)
                    {
                        promptTypeIndex = view.Columns[PromptTypeRow.TypeColumnName].Index;
                        promptType      = view[promptTypeIndex, cnt].Value as string;
                    }
                    else
                    if (view.Columns[ConfirmationPromptRow.OptionColumnName] != null)
                    {
                        //default confirmation
                        letter = Strings.DefaultConfirmationPromptLetter;
                    }

                    if (promptType != null && promptType.Length > 0)
                    {
                        letter = promptType.ToLower().Substring(0, 1)[0];
                        //JDL added fix to prevent letter from stepping on the confirmation reserved letter
                        if (letter == Strings.DefaultConfirmationPromptLetter)
                        {
                            letter = Strings.DefaultExitBridgePromptLetter; //JDK added a new prompt letter "x"
                        }
                    }
                    //Update prompt id's
                    CommonForm.CalculateDefaultPromptIdIfAppropriate(view, cnt, wordCol, promptIdCol, letter, false);
                }
            }
        }
Esempio n. 11
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Table table;

            Hide();

            // State Name
            string stateId = CommonForm.UnloadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox);

            shadow.SetStateId(stateId);

            // Developer Notes
            table = CommonForm.UnloadDeveloperNotesTextBox(developerNotesTextBox);
            shadow.SetDeveloperNotes(table);

            // Design Notes
            table = CommonForm.UnloadDesignNotesTextBox(designNotesTextBox);
            shadow.SetDesignNotes(table);
        }
Esempio n. 12
0
        private void SubDialogForm_Load(object sender, EventArgs e)
        {
            Table table;

            // State Name
            string stateId = shadow.GetStateId();

            CommonForm.LoadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox, stateId);

            // Developer Notes
            table = shadow.GetDeveloperNotes();
            CommonForm.LoadDeveloperNotesTextBox(developerNotesTextBox, table);


            // Design Notes
            table = shadow.GetDesignNotes();
            CommonForm.LoadDesignNotesTextBox(designNotesTextBox, table);

            statePrefixTextBox.Focus();
        }
Esempio n. 13
0
        private void InteractionForm_Load(object sender, EventArgs e)
        {
            Table table;

            // State Name
            string stateId = shadow.GetStateId();

            CommonForm.LoadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox, stateId);

            // Initialize Prompts
            table = shadow.GetPromptTypes();
            CommonForm.LoadPromptTypeDataGridView(promptsDataGridView, table);

            // Initialize Transitions
            table = shadow.GetCommandTransitions();
            CommonForm.LoadCommandTransitionDataGridView(commandsDataGridView, table);

            // Initialize Confirmations
            table = shadow.GetConfirmationPrompts();
            CommonForm.LoadConfirmationPromptGridView(confirmationDataGridView, table, commandsDataGridView);

            // Initialize MaxHandling
            table = shadow.GetMaxHandling();
            CommonForm.LoadMaxHandlingGridView(maxHandlingDataGridView, table);

            // Special Settings
            table = shadow.GetSpecialSettings();
            CommonForm.LoadSpecialSettingsTextBox(specialSettingsTextBox, table);

            // Developer Notes
            table = shadow.GetDeveloperNotes();
            CommonForm.LoadDeveloperNotesTextBox(developerNotesTextBox, table);

            // Design Notes
            table = shadow.GetDesignNotes();
            CommonForm.LoadDesignNotesTextBox(designNotesTextBox, table);

            statePrefixTextBox.Focus();
        }
Esempio n. 14
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Table table;

            // make sure the commands and confirmations are in sync
            DataGridViewComboBoxColumn confirmColumn = commandsDataGridView.Columns[ConfirmationPromptRow.OptionColumnName] as DataGridViewComboBoxColumn;

            List <string> commandsToConfirm = CommonForm.GetOptionsRequiringConfirmation(commandsDataGridView);
            List <string> confirmations     = new List <string>();

            for (int i = 0; i < confirmationDataGridView.Rows.Count; i++)
            {
                string option = confirmationDataGridView.Rows[i].Cells[ConfirmationPromptRow.OptionColumnName].Value as string;

                // it's one row of nothing if there are no commands
                if (option == null)
                {
                    break;
                }

                // some old junk apparently had the [] in the confirmation option
                if (option.Length > 0)
                {
                    int firstBracket = option.IndexOf(Strings.LabelStartBracket);
                    int lastBracket  = option.IndexOf(Strings.LabelEndBracket);
                    if (firstBracket >= 0 && lastBracket >= 0 && lastBracket > firstBracket)
                    {
                        option = option.Remove(firstBracket, lastBracket - firstBracket + 1);
                    }
                }

                confirmations.Add(option);
            }

            List <string> errorCommands      = new List <string>();
            List <string> errorConfirmations = new List <string>();

            // make sure every command is covered
            foreach (string s in commandsToConfirm)
            {
                bool found = false;
                foreach (string t in confirmations)
                {
                    if (s.Trim().Equals(t.Trim()))
                    {
                        found = true;
                        break;
                    }
                }
                if (!found)
                {
                    errorCommands.Add(s);
                }
            }
            foreach (string s in confirmations)
            {
                bool found = false;
                foreach (string t in commandsToConfirm)
                {
                    if (s.Trim().Equals(t.Trim()))
                    {
                        found = true;
                        break;
                    }
                }
                if (!found && s.Trim().Length != 0)
                {
                    errorConfirmations.Add(s);
                }
            }

            if (errorCommands.Count > 0 || errorConfirmations.Count > 0)
            {
                string msg = string.Empty;
                if (errorCommands.Count > 0)
                {
                    msg += "The following commands require confirmation:";
                    foreach (string s in errorCommands)
                    {
                        if (s.Equals(string.Empty))
                        {
                            msg += "\n    (blank)";
                        }
                        else
                        {
                            msg += "\n    " + s;
                        }
                    }
                }
                if (errorConfirmations.Count > 0)
                {
                    if (errorCommands.Count > 0)
                    {
                        msg += "\n\n and the ";
                    }
                    else
                    {
                        msg += "The ";
                    }
                    msg += "following confirmations are not needed:";
                    foreach (string s in errorConfirmations)
                    {
                        if (s.Equals(string.Empty))
                        {
                            msg += "\n    (blank)";
                        }
                        else
                        {
                            msg += "\n    " + s;
                        }
                    }
                }

                msg += "\n\n" + "Are you sure you want to continue?";
                System.Windows.Forms.DialogResult result;
                result = System.Windows.Forms.MessageBox.Show(msg, "Confirmation Error", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);

                if (result == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }
            }

            Hide();

            // State Name
            string stateId = CommonForm.UnloadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox);

            shadow.SetStateId(stateId);

            // Prompts
            table = CommonForm.UnloadPromptTypeDataGridView(promptsDataGridView);
            shadow.SetPromptTypes(table);

            // Transitions
            table = CommonForm.UnloadCommandTransitionDataGridView(commandsDataGridView);
            shadow.SetCommandTransitions(table);

            // Confirmations
            table = CommonForm.UnloadConfirmationPromptGridView(confirmationDataGridView);
            shadow.SetConfirmationPrompts(table);

            // MaxHandling
            table = CommonForm.UnloadMaxHandlingGridView(maxHandlingDataGridView);
            shadow.SetMaxHandling(table);

            // Special Settings
            table = CommonForm.UnloadSpecialSettingsTextBox(specialSettingsTextBox);
            shadow.SetSpecialSettings(table);

            // Developer Notes
            table = CommonForm.UnloadDeveloperNotesTextBox(developerNotesTextBox);
            shadow.SetDeveloperNotes(table);

            // Design Notes
            table = CommonForm.UnloadDesignNotesTextBox(designNotesTextBox);
            shadow.SetDesignNotes(table);
        }
Esempio n. 15
0
        private void Start_Load(object sender, EventArgs e)
        {
            // Default Settings
            // I didn't like showing these in a table, so these are handled custom.
            Table table = shadow.GetDefaultSettings();

            modeComboBox.Format               -= new ListControlConvertEventHandler(OnControlFormat);
            bargeInComboBox.Format            -= new ListControlConvertEventHandler(OnControlFormat);
            promptIdFormatComboBox.Format     -= new ListControlConvertEventHandler(OnControlFormat);
            retriesComboBox.Format            -= new ListControlConvertEventHandler(OnControlFormat);
            timeoutsComboBox.Format           -= new ListControlConvertEventHandler(OnControlFormat);
            disconfirmsComboBox.Format        -= new ListControlConvertEventHandler(OnControlFormat);
            modeComboBox.Format               += new ListControlConvertEventHandler(OnControlFormat);
            bargeInComboBox.Format            += new ListControlConvertEventHandler(OnControlFormat);
            promptIdFormatComboBox.Format     += new ListControlConvertEventHandler(OnControlFormat);
            retriesComboBox.Format            += new ListControlConvertEventHandler(OnControlFormat);
            timeoutsComboBox.Format           += new ListControlConvertEventHandler(OnControlFormat);
            disconfirmsComboBox.Format        += new ListControlConvertEventHandler(OnControlFormat);
            sortOrderComboBox.Format          += new ListControlConvertEventHandler(OnControlFormat);
            defaultConfirmTypeComboBox.Format += new ListControlConvertEventHandler(OnControlFormat);

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string name       = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
                string value      = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
                string dateString = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);

                System.Drawing.Color?color = null;
                DateTime             date;
                if (DateTime.TryParse(dateString, out date))
                {
                    color = Common.GetHighlightColor(date);
                }

                if (name.Equals(Strings.DefaultSettingsMode))
                {
                    originalMode = value;
                    CommonForm.LoadModeComboBox(modeComboBox, value);
                    if (color != null)
                    {
                        modeComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsBargeIn))
                {
                    originalBargeIn = value;
                    CommonForm.LoadYNComboBox(bargeInComboBox, value);
                    if (color != null)
                    {
                        bargeInComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsPromptIDFormat))
                {
                    originalPromptIdFormat = value;
                    CommonForm.LoadPromptIdFormatComboBox(promptIdFormatComboBox, value);
                    if (color != null)
                    {
                        promptIdFormatComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsRetriesInTotalErrors))
                {
                    originalRetries = value;
                    CommonForm.LoadYNComboBox(retriesComboBox, value);
                    if (color != null)
                    {
                        retriesComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsTimeoutsInTotalErrors))
                {
                    originalTimeouts = value;
                    CommonForm.LoadYNComboBox(timeoutsComboBox, value);
                    if (color != null)
                    {
                        timeoutsComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsDisconfirmsInTotalErrors))
                {
                    originalDisconfirms = value;
                    CommonForm.LoadYNComboBox(disconfirmsComboBox, value);
                    if (color != null)
                    {
                        disconfirmsComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsStateSortOrder))
                {
                    originalSortOrder = value;
                    CommonForm.LoadSortOrderComboBox(sortOrderComboBox, value);
                    if (color != null)
                    {
                        sortOrderComboBox.BackColor = color.Value;
                    }
                }
                else if (name.Equals(Strings.DefaultSettingsConfirmMode))
                {
                    originalDefaultConfirmType = value;
                    CommonForm.LoadDefaultConfirmTypeComboBox(defaultConfirmTypeComboBox, value);
                    if (color != null)
                    {
                        defaultConfirmTypeComboBox.BackColor = color.Value;
                    }
                }
            }

            // Initialization Name/Value Pairs
            table = shadow.GetInitialization();
            CommonForm.LoadNameValuePairDataGridView(initializationDataGridView, table);

            // Initialize Global Prompt Types
            table = shadow.GetPromptTypes();
            CommonForm.LoadPromptTypeDataGridView(promptsDataGridView, table);

            // Initialize Global Command Transitions
            table = shadow.GetCommandTransitions();
            CommonForm.LoadStartCommandTransitionDataGridView(commandsDataGridView, table);

            // Initialize Global Confirmation Prompts
            table = shadow.GetConfirmationPrompts();
            CommonForm.LoadConfirmationPromptGridView(confirmationsDataGridView, table, commandsDataGridView);

            // Initialize Max Handling
            table = shadow.GetMaxHandling();
            CommonForm.LoadMaxHandlingGridView(maxHandlingDataGridView, table);
        }
Esempio n. 16
0
        private void OK_Click(object sender, EventArgs e)
        {
            Table table;

            Hide();

            // Default Settings
            string mode               = CommonForm.UnloadModeComboBox(modeComboBox);
            string bargeIn            = CommonForm.UnloadYNComboBox(bargeInComboBox);
            string promptIdFormat     = CommonForm.UnloadPromptIdFormatComboBox(promptIdFormatComboBox);
            string retries            = CommonForm.UnloadYNComboBox(retriesComboBox);
            string timeouts           = CommonForm.UnloadYNComboBox(timeoutsComboBox);
            string disconfirms        = CommonForm.UnloadYNComboBox(disconfirmsComboBox);
            string sortOrder          = CommonForm.UnloadSortOrderComboBox(sortOrderComboBox);
            string defaultConfirmType = CommonForm.UnloadDefaultConfirmTypeComboBox(defaultConfirmTypeComboBox);

            table = shadow.GetDefaultSettings();
            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
                if (name.Equals(Strings.DefaultSettingsMode))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, mode, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsBargeIn))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, bargeIn, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsPromptIDFormat))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, promptIdFormat, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsRetriesInTotalErrors))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, retries, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsTimeoutsInTotalErrors))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, timeouts, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsDisconfirmsInTotalErrors))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, disconfirms, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsStateSortOrder))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, sortOrder, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
                else if (name.Equals(Strings.DefaultSettingsConfirmMode))
                {
                    CommonForm.SetTableDataAndDateIfNecessary(table, r, defaultConfirmType, TableColumns.NameValuePairs.Value, TableColumns.NameValuePairs.ValueDateStamp);
                }
            }

            shadow.SetDefaultSettings(table);

            // Initialization Name/Value Pairs
            table = CommonForm.UnloadNameValuePairDataGridView(initializationDataGridView);
            shadow.SetInitialization(table);

            // Initialize Global Prompt Types
            table = CommonForm.UnloadPromptTypeDataGridView(promptsDataGridView);
            shadow.SetPromptTypes(table);

            // Initialize Global Command Transitions
            table = CommonForm.UnloadStartCommandTransitionDataGridView(commandsDataGridView);
            shadow.SetCommandTransitions(table);

            // Initialize Global Confirmation Prompts
            table = CommonForm.UnloadConfirmationPromptGridView(confirmationsDataGridView);
            shadow.SetConfirmationPrompts(table);

            // Initialize Max Handling
            table = CommonForm.UnloadMaxHandlingGridView(maxHandlingDataGridView);
            shadow.SetMaxHandling(table);
        }
Esempio n. 17
0
 private void CallSubDialogForm_Load(object sender, EventArgs e)
 {
     CommonForm.LoadSubDialogListBox(subDialogListBox, shadow.GetSubDialogUID());
 }