private void saveDynamixSettingsLogic() { // UI to class DynamixSettings updatedSettings = new DynamixSettings(); updatedSettings.Enabled = enableDynamixCB.Checked; updatedSettings.Password = dynamix_user_key_TB.Text; updatedSettings.Hosts = hostsBoxDynamix.Items.Cast <String>().ToList(); // Save the options using our static class string result = DynamixHelper.SaveOptions(updatedSettings); // Display any errors if (result != string.Empty) { customError err = new customError("You have the following problems with your Dynamix settings!", result); err.intervalForTimer = 30000; err.Show(); errorCount++; } else { successCount++; saveSuccess += "Your " + DynamixHelper.serviceName + " settings were successfully saved! \n"; } }
private void runDynamixDNSUpdate() { if (dynamixSettings.Hosts.Any() && !string.IsNullOrEmpty(dynamixSettings.Password) && dynamixSettings.Enabled) { string messages = DynamixHelper.RunUpdates(dynamixSettings, IPAddress); parseMessagesAndShowResults(messages); } }
private void retrieveDynamixHostsButton_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(dynamix_user_key_TB.Text)) { var hosts = DynamixHelper.CurrentHosts(dynamix_user_key_TB.Text); if (hosts.Any()) { hostsBoxDynamix.Items.Clear(); foreach (var host in hosts) { hostsBoxDynamix.Items.Add(host); } } else { MessageBox.Show("Failed to retrieve " + DynamixHelper.serviceName + " hosts.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Enter your account user key first before attempting to retrieve hosts.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void getSavedOptions() { appSettings = AppHelper.LoadOptions(); // Reading Saved Options: switch (appSettings.TimeIntervalMode) { default: case 1: timer1.Interval = appSettings.TimeInterval * 1000; break; case 2: timer1.Interval = appSettings.TimeInterval * 1000 * 60; break; case 3: timer1.Interval = appSettings.TimeInterval * 1000 * 3600; break; } if (appSettings.AutoStart) { timer1.Enabled = true; timer2.Enabled = true; scanButton.Visible = false; stopScanButton.Visible = true; } else { timer1.Enabled = false; timer2.Enabled = false; scanButton.Visible = true; stopScanButton.Visible = false; } switch (appSettings.IPService) { case 1: urlForIPCheck = "https://dynamix.run/ip.php"; break; case 3: urlForIPCheck = "http://dinofly.com/misc/ipcheck.php"; break; case 2: urlForIPCheck = "http://grabip.tk"; break; default: urlForIPCheck = "https://dynamix.run/ip.php"; break; } if (File.Exists(phpPathFile)) { phpPath = File.ReadAllText(phpPathFile); } if (appSettings.RunDynamicServices) { XpertDNSSettings = XpertDNSHelper.LoadOptions(); dynamixSettings = DynamixHelper.LoadOptions(); afraidDNSSettings = AfraidDNSHelper.LoadOptions(); noIPDNSSettings = NoIPHelper.LoadOptions(); } }
private void getDynamixSettings() { dynamixSettings = DynamixHelper.LoadOptions(this); }