示例#1
0
文件: FormMain.cs 项目: QsDev/csharp
        /// <summary>
        /// LinkLabelSettings handler.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event arguments.</param>
        private void LinkLabelSettingsLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var formSettings = new FormSettings();

            formSettings.IpAddress   = this.settingsHelper.Settings.RoboHeadAddress;
            formSettings.SendPort    = this.settingsHelper.Settings.UdpSendPort;
            formSettings.ReceivePort = this.settingsHelper.Settings.UdpReceivePort;
            formSettings.ComPort     = this.settingsHelper.Settings.ComPort;
            formSettings.BaudRate    = this.settingsHelper.Settings.BaudRate;
            if (formSettings.ShowDialog(this) == DialogResult.OK)
            {
                this.settingsHelper.Settings.RoboHeadAddress = formSettings.IpAddress;
                this.settingsHelper.Settings.UdpSendPort     = formSettings.SendPort;
                this.settingsHelper.Settings.UdpReceivePort  = formSettings.ReceivePort;
                this.settingsHelper.Settings.ComPort         = formSettings.ComPort;
                this.settingsHelper.Settings.BaudRate        = formSettings.BaudRate;
                this.InitializeCommunication();
                this.settingsHelper.Save();
            }
        }
示例#2
0
 /// <summary>
 /// LinkLabelSettings handler.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event arguments.</param>
 private void LinkLabelSettingsLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     var formSettings = new FormSettings();
     formSettings.IpAddress = this.settingsHelper.Settings.RoboHeadAddress;
     formSettings.SendPort = this.settingsHelper.Settings.UdpSendPort;
     formSettings.ReceivePort = this.settingsHelper.Settings.UdpReceivePort;
     formSettings.ComPort = this.settingsHelper.Settings.ComPort;
     formSettings.BaudRate = this.settingsHelper.Settings.BaudRate;
     if (formSettings.ShowDialog(this) == DialogResult.OK)
     {
         this.settingsHelper.Settings.RoboHeadAddress = formSettings.IpAddress;
         this.settingsHelper.Settings.UdpSendPort = formSettings.SendPort;
         this.settingsHelper.Settings.UdpReceivePort = formSettings.ReceivePort;
         this.settingsHelper.Settings.ComPort = formSettings.ComPort;
         this.settingsHelper.Settings.BaudRate = formSettings.BaudRate;
         this.InitializeCommunication();
         this.settingsHelper.Save();
     }
 }