Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 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;
     }
 } 
Ejemplo n.º 3
0
        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
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        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();
            }
        }