private void buttonSaveSettings_Click(object sender, EventArgs e) { tbStatus.ResetText(); try { tbStatus.AppendText("Saving with CMS... Please wait..."); // Simple settings ApplicationSettings.Default.ServerKey = textBoxServerKey.Text; ApplicationSettings.Default.LibraryPath = textBoxLibraryPath.Text.TrimEnd('\\'); ApplicationSettings.Default.ServerUri = textBoxXmdsUri.Text; ApplicationSettings.Default.HardwareKey = tbHardwareKey.Text; // Also tweak the address of the xmds1 xmds1.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=registerDisplay"; // Proxy Settings ApplicationSettings.Default.ProxyUser = textBoxProxyUser.Text; ApplicationSettings.Default.ProxyPassword = maskedTextBoxProxyPass.Text; ApplicationSettings.Default.ProxyDomain = textBoxProxyDomain.Text; // Change the default Proxy class OptionForm.SetGlobalProxy(); // Client settings ApplicationSettings.Default.SplashOverride = splashOverride.Text; // Commit these changes back to the user settings ApplicationSettings.Default.Save(); // Call register xmds1.RegisterDisplayAsync( ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, ApplicationSettings.Default.DisplayName, "windows", ApplicationSettings.Default.ClientVersion, ApplicationSettings.Default.ClientCodeVersion, Environment.OSVersion.ToString(), _hardwareKey.MacAddress, _hardwareKey.Channel, _hardwareKey.getXmrPublicKey()); } catch (Exception ex) { tbStatus.AppendText(ex.Message); } }
public OptionForm() { InitializeComponent(); // Set the icon Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); // Hide unnecessary fields if (Application.ProductName != "Xibo") { label17.Hide(); linkLabel1.Hide(); } // Get a hardware key here, just in case we havent been able to get one before _hardwareKey = new HardwareKey(); // XMDS completed event xmds1.RegisterDisplayCompleted += new XiboClient2.Processor.xmds.RegisterDisplayCompletedEventHandler(xmds1_RegisterDisplayCompleted); // Set global proxy information OptionForm.SetGlobalProxy(); // Settings Tab textBoxXmdsUri.Text = ApplicationSettings.Default.ServerUri; textBoxServerKey.Text = ApplicationSettings.Default.ServerKey; textBoxLibraryPath.Text = ApplicationSettings.Default.LibraryPath; tbHardwareKey.Text = ApplicationSettings.Default.HardwareKey; // Proxy Tab textBoxProxyUser.Text = ApplicationSettings.Default.ProxyUser; maskedTextBoxProxyPass.Text = ApplicationSettings.Default.ProxyPassword; textBoxProxyDomain.Text = ApplicationSettings.Default.ProxyDomain; // Appearance Tab splashOverride.Text = ApplicationSettings.Default.SplashOverride; Debug.WriteLine("Loaded Options Form", "OptionForm"); }