コード例 #1
0
        private void EditServerDialog_Load(object sender, EventArgs e)
        {
            labelError.Text = string.Empty;

            if (_Settings == null)
            {
                ClientTimeout.Value    = 300;
                ServerPort.Text        = "104";
                ServerMaxClients.Text  = "0";
                StartMode.Text         = "Automatic";
                ReconnectTimeout.Value = 300;
                AddInTimeout.Value     = 300;
                Text = Resources.AddNewServer;
                labelRestart.Text         = string.Empty;
                TemporaryDirectory.Text   = Path.GetTempPath();
                checkBoxImageCopy.Checked = false;
                MaxPduLength.Text         = "46726";
            }
            else
            {
                Text                             = Resources.EditServer + " [" + _Settings.AETitle + "]";
                ServerAE.Text                    = _Settings.AETitle;
                ServerAE.Enabled                 = false;
                ServerAllowAnonymous.Checked     = _Settings.AllowAnonymous;
                ServerDescription.Text           = _Settings.Description;
                IpType                           = _Settings.IpType;
                ServerMaxClients.Text            = _Settings.MaxClients.ToString();
                ServerPort.Text                  = _Settings.Port.ToString();
                ServerSecure.Checked             = _Settings.Secure;
                ClientTimeout.Value              = Convert.ToDecimal(_Settings.ClientTimeout);
                TemporaryDirectory.Text          = _Settings.TemporaryDirectory;
                ImplementationClass.Text         = _Settings.ImplementationClass;
                ImplementationVersionName.Text   = _Settings.ImplementationVersionName;
                DisplayName.Text                 = _Settings.DisplayName;
                MaxPduLength.Text                = _Settings.MaxPduLength.ToString();
                ReconnectTimeout.Value           = Convert.ToDecimal(_Settings.ReconnectTimeout);
                AddInTimeout.Value               = Convert.ToDecimal(_Settings.AddInTimeout);
                NoDelay.Checked                  = _Settings.NoDelay;
                ReceiveBuffer.Text               = _Settings.ReceiveBufferSize.ToString();
                SendBuffer.Text                  = _Settings.SendBufferSize.ToString();
                StartMode.Text                   = _Settings.StartMode;
                AllowMultipleConnections.Checked = _Settings.AllowMultipleConnections;
                if (StartMode.SelectedIndex == -1)
                {
                    StartMode.SelectedIndex = 0;
                }
                labelRestart.Text         = "Server will need to be restarted for changes to take effect";
                checkBoxImageCopy.Checked = _Settings.DataSetImageCopy;
                numericUpDownPipes.Value  = Convert.ToDecimal(_Settings.AdministrativePipes);
            }
            UpdateIpRadioButtons();

            if (DirFocus)
            {
                TemporaryDirectory.Focus();
                TemporaryDirectory.SelectAll();
            }
            else
            {
                ServerAE.Focus();
            }
            ServerAE_TextChanged(null, null);
        }