void sm_OnStatusChange(object sender, clsSettingsManager.InternalState s) { _in_action = false; if (s == clsSettingsManager.InternalState.idle) { foreach (clsSettingsManager sm in _settings_managers) { _in_action = (sm.State != clsSettingsManager.InternalState.idle); break; } } clsSettingsManager thisSM = (clsSettingsManager)sender; System.Diagnostics.Debug.WriteLine(thisSM.Username + " Status changed to " + s.ToString()); }
void sm_OnSuccess(object sender, clsSettingsManager.FailureCodes f) { clsSettingsManager thisSM = (clsSettingsManager)sender; if (_logger != null) _logger.appendFile(DateTime.Now.ToString() + "-" + thisSM.Username + " Success @ " + f.ToString()); }
void sm_OnStatusChange(object sender, clsSettingsManager.InternalState s) { if (this.InvokeRequired) { GenericDelegate dlg = delegate() { clsSettingsManager sm = (clsSettingsManager)sender; ListViewItem item = _index_of_lv_by_username(sm.Username); if (item == null) return; item.SubItems[2].Text = s.ToString(); item.SubItems[1].Text = sm.VideoID; }; lvSMs.Invoke(dlg); } else { clsSettingsManager sm = (clsSettingsManager)sender; ListViewItem item = _index_of_lv_by_username(sm.Username); if (item == null) return; item.SubItems[2].Text = s.ToString(); item.SubItems[1].Text = sm.VideoID; } }