Пример #1
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);
        }