private void Checker_DoWork(object sender, DoWorkEventArgs e) { // Get API Methods string Key = (string)e.Argument; DreamhostAPI API = new DreamhostAPI(Key); IEnumerable <string> Methods = API.ListAccessibleMethods(); // Add unavailable methods to list string[] RequiredMethods = { "dns-list_records", "dns-add_record", "dns-remove_record" }; List <string> MissingMethods = new List <string>(); foreach (string m in RequiredMethods) { if (!Methods.Contains(m)) { MissingMethods.Add(m); } } e.Result = MissingMethods; }
public AddEdit(DreamhostAPI API) { InitializeComponent(); this.API = API; this.AddRecord.DoWork += new DoWorkEventHandler(AddRecord_DoWork); this.AddRecord.RunWorkerCompleted += new RunWorkerCompletedEventHandler(AddRecord_RunWorkerCompleted); }
public AddEdit(DreamhostAPI API, DNSRecord Record) : this(API) { this.IsEdit = true; this.Record = Record; this.Text = "Edit Record"; this.textBoxRecord.Text = this.Record.record; this.textBoxComment.Text = this.Record.comment; this.textBoxValue.Text = this.Record.value; this.comboBoxType.Text = this.Record.type; this.textBoxRecord.Enabled = false; this.comboBoxType.Enabled = false; this.EditRecord.DoWork += new DoWorkEventHandler(EditRecord_DoWork); this.EditRecord.RunWorkerCompleted += new RunWorkerCompletedEventHandler(EditRecord_RunWorkerCompleted); }
private void Listing_Load(object sender, EventArgs e) { // Check API Key if (Properties.Settings.Default.APIKey == string.Empty && (new Settings().ShowDialog() == DialogResult.Cancel)) { Application.Exit(); } this.GetRecords.DoWork += new DoWorkEventHandler(GetRecords_DoWork); this.GetRecords.RunWorkerCompleted += new RunWorkerCompletedEventHandler(GetRecords_RunWorkerCompleted); this.DeleteRecord.DoWork += new DoWorkEventHandler(DeleteRecord_DoWork); this.DeleteRecord.RunWorkerCompleted += new RunWorkerCompletedEventHandler(DeleteRecord_RunWorkerCompleted); this.API = new DreamhostAPI(Properties.Settings.Default.APIKey); this.LoadRecords(); }