Inheritance: ATMLCommonLibrary.forms.ATMLForm
Esempio n. 1
0
        private void btnSavePinConfiguration_Click(object sender, EventArgs e)
        {
            string      text      = cbConnectorType.Text;
            dbConnector connector = PromptForNewConnector(text, cbConnectorType, cbConnectorMatingType);

            if (connector != null)
            {
                List <ConnectorPin> pins = connectorPinList.ConnectorPins;
                var form = new ConnectorConfigurationForm(connector, pins);
                form.Configuration = cmbConnectorPinConfiguration.SelectedItem as dbConnectorConfiguration;
                if (DialogResult.OK == form.ShowDialog())
                {
                    dbConnectorConfiguration configuration = form.Configuration;
                    foreach (object item in cmbConnectorPinConfiguration.Items)
                    {
                        if (configuration.configName.Equals(((dbConnectorConfiguration)item).configName))
                        {
                            cmbConnectorPinConfiguration.Items.Remove(item);
                            break;
                        }
                    }
                    cmbConnectorPinConfiguration.SelectedIndex = cmbConnectorPinConfiguration.Items.Add(form.Configuration);
                }
            }
        }
 private void btnSavePinConfiguration_Click( object sender, EventArgs e )
 {
     string text = cbConnectorType.Text;
     dbConnector connector = PromptForNewConnector( text, cbConnectorType, cbConnectorMatingType );
     if (connector != null)
     {
         List<ConnectorPin> pins = connectorPinList.ConnectorPins;
         var form = new ConnectorConfigurationForm( connector, pins );
         form.Configuration = cmbConnectorPinConfiguration.SelectedItem as dbConnectorConfiguration;
         if (DialogResult.OK == form.ShowDialog())
         {
             dbConnectorConfiguration configuration = form.Configuration;
             foreach (object item in cmbConnectorPinConfiguration.Items)
             {
                 if (configuration.configName.Equals( ( (dbConnectorConfiguration) item ).configName ))
                 {
                     cmbConnectorPinConfiguration.Items.Remove( item );
                     break;
                 }
             }
             cmbConnectorPinConfiguration.SelectedIndex = cmbConnectorPinConfiguration.Items.Add(form.Configuration);
         }
     }
 }