private void BuildAlternateCommandChannel() { if ((object)CurrentItem != null) { ConnectionStringBuilder csb = new ConnectionStringBuilder(ConnectionStringBuilder.ConnectionType.AlternateCommandChannel); if (!string.IsNullOrEmpty(CurrentItem.AlternateCommandChannel)) { csb.ConnectionString = CurrentItem.AlternateCommandChannel; } if (CurrentItem.ProtocolID != null && m_protocolLookupList[(int)CurrentItem.ProtocolID] == "Gateway Transport") { csb.PgConnection = true; } else { csb.PgConnection = false; } csb.Closed += delegate { if (csb.DialogResult.GetValueOrDefault()) { CurrentItem.AlternateCommandChannel = csb.ConnectionString; } }; csb.Owner = Application.Current.MainWindow; csb.WindowStartupLocation = WindowStartupLocation.CenterOwner; csb.ShowDialog(); } }
private void cmdBuildConnStr_Click(object sender, EventArgs e) { ConnectionStringBuilder csb = new ConnectionStringBuilder(); csb.ConnectionString = txtConnectionString.Text; if (csb.ShowDialog() == System.Windows.Forms.DialogResult.OK) { txtConnectionString.Text = csb.ConnectionString; } }
private void BuildDataChannel() { if (CurrentItem != null) { ConnectionStringBuilder csb = new ConnectionStringBuilder(ConnectionStringBuilder.ConnectionType.DataChannel); if (!string.IsNullOrEmpty(CurrentItem.DataChannel)) { csb.ConnectionString = CurrentItem.DataChannel; } csb.Closed += new EventHandler(delegate(object popupWindow, EventArgs eargs) { if ((bool)csb.DialogResult) { CurrentItem.DataChannel = csb.ConnectionString; } }); csb.Owner = System.Windows.Application.Current.MainWindow; csb.WindowStartupLocation = WindowStartupLocation.CenterOwner; csb.ShowDialog(); } }
void ButtonBuildCommandChannel_Click(object sender, RoutedEventArgs e) { ConnectionStringBuilder csb = new ConnectionStringBuilder(ConnectionStringBuilder.ConnectionType.CommandChannel); if (!string.IsNullOrEmpty(TextBoxCommandChannel.Text)) { csb.ConnectionString = TextBoxCommandChannel.Text; } csb.Closed += new EventHandler(delegate(object popupWindow, EventArgs eargs) { if ((bool)csb.DialogResult) { TextBoxCommandChannel.Text = csb.ConnectionString; } }); #if !SILVERLIGHT csb.Owner = Window.GetWindow(this); csb.WindowStartupLocation = WindowStartupLocation.CenterOwner; csb.ShowDialog(); #else csb.Show(); #endif }
private void BuildConnectionString() { if ((object)CurrentItem != null) { ConnectionStringBuilder csb = new ConnectionStringBuilder(ConnectionStringBuilder.ConnectionType.DeviceConnection); if (!string.IsNullOrEmpty(CurrentItem.ConnectionString)) { csb.ConnectionString = CurrentItem.ConnectionString; } csb.Closed += delegate { if (csb.DialogResult.GetValueOrDefault()) { CurrentItem.ConnectionString = csb.ConnectionString; } }; csb.Owner = Application.Current.MainWindow; csb.WindowStartupLocation = WindowStartupLocation.CenterOwner; csb.ShowDialog(); } }
private void BuildDataChannel() { if (CurrentItem != null) { ConnectionStringBuilder csb = new ConnectionStringBuilder(ConnectionStringBuilder.ConnectionType.DataChannel); if (!string.IsNullOrEmpty(CurrentItem.DataChannel)) { csb.ConnectionString = CurrentItem.DataChannel; } csb.Closed += delegate { if ((bool)csb.DialogResult) { CurrentItem.DataChannel = csb.ConnectionString; } }; csb.Owner = Application.Current.MainWindow; csb.WindowStartupLocation = WindowStartupLocation.CenterOwner; csb.ShowDialog(); } }