public void ODEvent_Fired(ODEventArgs e) { //We don't know what thread will cause a progress status change, so invoke this method as a delegate if necessary. if (this.InvokeRequired) { this.Invoke((Action) delegate() { ODEvent_Fired(e); }); return; } //Make sure that this ODEvent is for FormProgressStatus and that the Tag is not null and is a string. if (e.Name != _odEventName || e.Tag == null) { return; } ProgressBarHelper progHelper = new ProgressBarHelper(""); bool hasProgHelper = false; string status = ""; if (e.Tag.GetType() == typeof(string)) { status = ((string)e.Tag); } else if (e.Tag.GetType() == typeof(ProgressBarHelper)) { progHelper = (ProgressBarHelper)e.Tag; status = progHelper.LabelValue; hasProgHelper = true; } else //Unsupported type passed in. { return; } UpdateProgress(status, progHelper, hasProgHelper, status.ToUpper() == "DEFCON 1"); }
private void PatientEvent_Fired(ODEventArgs e) { if (((e.Tag as Patient)?.PatNum ?? -1) == FormOpenDental.CurPatNum) { RefreshDashboard(); } }
///<summary></summary> public static void Fire(ODEventArgs e) { if (Fired != null) { Fired(e); } }
private void WikiSaveEvent_Fired(ODEventArgs e) { if (e.EventType == ODEventType.WikiSave) { SaveDraft_Click(false); } }
private void StopRecurringCharges(ODEventArgs args) { if (args.EventType == ODEventType.Shutdown) { _charger.StopCharges(true); } }
private void PatientDashboardDataEvent_Fired(ODEventArgs e) { if (e == null || e.Tag == null) { return; } SetData(e); }
public void eClipboardChangedEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.eClipboard || this.IsDisposed) { return; } FillGridMobileAppDevices(); }
private void DbMonitorEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.QueryMonitor || !(e.Tag is DbQueryObj)) { return; } _queueQueries.Enqueue(e.Tag as DbQueryObj); }
public void PatientChangedEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.Patient || e.Tag.GetType() != typeof(long) || this.IsDisposed) { return; } FillPat(); }
public void PatientChangedEvent_Fired(ODEventArgs e) { if (e.Name != "FormOpenDental" || e.Tag.GetType() != typeof(long) || this.IsDisposed) { return; } FillPat(); }
public void ODEvent_Fired(ODEventArgs e) { //We don't know what thread will cause a progress status change, so invoke this method as a delegate if necessary. if (this.InvokeRequired) { this.Invoke((Action) delegate() { ODEvent_Fired(e); }); return; } //Make sure that this ODEvent is for FormProgressExtended and that the Tag is not null and is a string. if (e.Name != _odEventName || e.Tag == null) { return; } ProgressBarHelper progHelper = new ProgressBarHelper(""); bool hasProgHelper = false; string status = ""; if (e.Tag.GetType() == typeof(string)) { status = ((string)e.Tag); } else if (e.Tag.GetType() == typeof(ProgressBarHelper)) { progHelper = (ProgressBarHelper)e.Tag; status = progHelper.LabelValue; hasProgHelper = true; } else //Unsupported type passed in. { return; } //When the developer wants to close the window, they will send an ODEvent with "DEFCON 1" to signal this form to shut everything down. if (status.ToUpper() == "DEFCON 1") { DialogResult = DialogResult.OK; Close(); return; } labelProgress.Text = status + "... (" + progHelper.PercentValue + ")"; if (hasProgHelper) { if (progHelper.BlockMax != 0) { progressBar.Maximum = progHelper.BlockMax; } if (progHelper.BlockValue != 0) { //When the progress bar draws itself it gradually fills in the bar. This causes the progress bar to be much further behind the percent //label when the program loads quickly. A trick to get around this is to set the value and then set the value to a lower value. progressBar.Value = progHelper.BlockValue; progressBar.Value = Math.Max(progHelper.BlockValue - 1, 0); progressBar.Value = progHelper.BlockValue; } } Application.DoEvents(); //So that the label updates with the new status. }
private void ODEvent_Fired(ODEventArgs e) { //Make sure that this ODEvent is for the Job Manager and that the Tag is not null and is a string. if (e.Name != "Job Manager" || e.Tag == null || e.Tag.GetType() != typeof(string)) { return; } _jobLinks = JobLinks.GetJobLinks(_jobNum); FillGrid(); }
private void PatientChangedEvent_Fired(ODEventArgs e) { if (e.Name != "FormOpenDental" || e.Tag.GetType() != typeof(long)) { return; } //The tag for this event is the newly selected PatNum _view.SetPatNum((long)e.Tag); if (IsPersistent && (_userOdPrefUpdateDateTimeNewPat == null || PIn.Bool(_userOdPrefUpdateDateTimeNewPat.ValueString))) { _view.UpdateButNow(); } }
private void SetData(ODEventArgs e) { PatientDashboardDataEventArgs data; if (e.Tag is PatientDashboardDataEventArgs) { data = (PatientDashboardDataEventArgs)e.Tag; } else { data = new PatientDashboardDataEventArgs(e.Tag); } StartRefreshThread((widget) => widget.TrySetData(data), SET_THREAD_NAME); }
private void PatientChangedEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.Patient || e.Tag.GetType() != typeof(long)) { return; } //The tag for this event is the newly selected PatNum long patNum = (long)e.Tag; _commlogCur.PatNum = patNum; textPatientName.Text = Patients.GetLim(patNum).GetNameFL(); if (_isPersistent && (_userOdPrefUpdateDateTimeNewPat == null || PIn.Bool(_userOdPrefUpdateDateTimeNewPat.ValueString))) { UpdateButNow(); } }
private static void UserodChangedEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.Userod || e.Tag.GetType() != typeof(long)) { return; } if (_client == null) { return; } if (_client.IsConnected) { ODException.SwallowAnyException(new Action(() => _client.Disconnect())); //disconnect if necessary, user must press the button to launch } ODException.SwallowAnyException(new Action(() => _client.Dispose())); _client = null; }
public void Fire(ODEventArgs e) { DateTime start = DateTime.Now; while (!_hasProgressOpened || start.AddSeconds(3) < DateTime.Now) { Thread.Sleep(10); } if (e.Tag is ProgressBarHelper) { ProgressBarHelper progBarHelper = (ProgressBarHelper)e.Tag; if (progBarHelper.ProgressStyle == ProgBarStyle.NoneSpecified) { progBarHelper.ProgressStyle = _progBarStyle; } } _event.FireEvent(e); }
private void AppointmentEvent_Fired(ODEventArgs e) { if (PatCur == null) { return; } bool isRefreshRequired = false; List <Appointment> listAppts = new List <Appointment>(); if (e.Tag is Appointment) { listAppts.Add((Appointment)e.Tag); } else if (e.Tag is List <Appointment> ) { listAppts = (List <Appointment>)e.Tag; } else { return; //Event fired with unexpected Tag. } foreach (Appointment appt in listAppts) { if (appt.PatNum == PatCur.PatNum) { isRefreshRequired = true; break; } } if (isRefreshRequired) { //_isInDashboard flag will already be set by this point which is used for enabling/disabling the vertical scroll bar when this control is //used in the Patient Dashboard, so we don't care if we pass a sheetField or not. RefreshData(PatCur, null); RefreshView(); } }
///<summary>This event will be added to the PatientChangedEvent.Fired handler when the DexisIntegrator button is pressed. When this fires we ///will send the command to Dexis Integrator to change pats if the connection is still active and the program link is still enabled. If the ///program link is no longer enabled we will unsubscribe this event from the PatientChangedEvent.Fired handler and dispose of _client. If the ///PatNum tagged to ODEventArgs e is invalid we will also dispose of _client so the user will have to press the button again to launch.</summary> private static void PatientChangedEvent_Fired(ODEventArgs e) { if (e.EventType != ODEventType.Patient || e.Tag.GetType() != typeof(long)) { return; } Program prog = Programs.GetCur(ProgramName.DexisIntegrator); Patient pat = null; if (prog.Enabled && _client != null && _client.IsConnected) //prog enabled and connection made (i.e. user previously pressed the button) { pat = Patients.GetPat((long)e.Tag); //the tag for this event is the newly selected PatNum } if (pat != null) //pat is not null, so prog is enabled and connection has been previously made (i.e. user has pressed the button) { SendData(prog, pat); return; } //pat==null, i.e. invalid PatNum (e.g. log off and back on as different user so PatNum==0), the prog isn't enabled or no connection //we will disconnect and set the _client to null. User will have to press the button again to reconnect to the service if (!prog.Enabled) //prog was enabled (otherwise this event wouldn't be triggered) but now is not enabled { PatientChangedEvent.Fired -= PatientChangedEvent_Fired; //remove this event from PatientChangedEvent so changing pats won't cause this to fire UserodChangedEvent.Fired -= UserodChangedEvent_Fired; } if (_client == null) { return; } if (_client.IsConnected) { ODException.SwallowAnyException(new Action(() => _client.Disconnect())); //disconnect if necessary, user must press the button to launch } ODException.SwallowAnyException(new Action(() => _client.Dispose())); _client = null; //setting to null will cause a new _client connection the next time they press the button }
private void PatientChangedEvent_Fired(ODEventArgs e) { RefreshDashboard(); }
public void FireEvent(ODEventArgs e) { Fire(e); }
public void ODEvent_Fired(ODEventArgs e) { //We don't know what thread will cause a progress status change, so invoke this method as a delegate if necessary. if (this.InvokeRequired) { this.Invoke((Action) delegate() { ODEvent_Fired(e); }); return; } //Make sure that this ODEvent is for FormProgressExtended and that the Tag is not null and is a string. if (e.Name != _odEventName || e.Tag == null) { return; } ProgressBarHelper progHelper = new ProgressBarHelper(""); bool hasProgHelper = false; string status = ""; if (e.Tag.GetType() == typeof(string)) { status = ((string)e.Tag); } else if (e.Tag.GetType() == typeof(ProgressBarHelper)) { progHelper = (ProgressBarHelper)e.Tag; status = progHelper.LabelValue; hasProgHelper = true; } else //Unsupported type passed in. { return; } //When the developer wants to close the window, they will send an ODEvent with "DEFCON 1" to signal this form to shut everything down. if (status.ToUpper() == "DEFCON 1") { DialogResult = DialogResult.OK; Close(); return; } if (hasProgHelper) { switch (progHelper.ProgressBarEventType) { case ProgBarEventType.BringToFront: this.TopMost = true; this.TopMost = false; break; case ProgBarEventType.Header: this.Text = status; break; case ProgBarEventType.ProgressLog: label4.Text = status; break; case ProgBarEventType.TextMsg: status = status.Trim(); //Get rid of leading and trailing new lines. textMsg.AppendText((string.IsNullOrWhiteSpace(textMsg.Text) ? "" : "\r\n") + status.PadRight(60)); break; case ProgBarEventType.WarningOff: case ProgBarEventType.AllowResume: labelWarning.Visible = false; butPause.Enabled = true; butPause.Text = Lan.g(this, "Resume"); break; case ProgBarEventType.Done: butCancel.Visible = true; //can sometimes be set to invisible with HideButtons. Show if previously invisible. butCancel.Text = Lan.g(this, "Close"); butPause.Enabled = false; _isDone = true; break; case ProgBarEventType.HideButtons: //hide pause and cancel. Call Done when "close button" should appear. butPause.Visible = false; butCancel.Visible = false; break; case ProgBarEventType.ProgressBar: default: if (!_listProgressBars.Exists(x => x.TagString.ToLower() == progHelper.TagString.ToLower())) //if not already added { ODProgressBar progBar = AddNewProgressBar(progHelper.LabelValue, progHelper.LabelTop, progHelper.PercentValue, progHelper.BlockValue, progHelper.BlockMax, progHelper.TagString, progHelper.ProgressStyle, progHelper.MarqueeSpeed, progHelper.IsValHidden, progHelper.IsTopHidden, progHelper.IsPercentHidden); if (progBar == null) { break; } _listProgressBars.Add(progBar); } else { ODProgressBar odBar = _listProgressBars.Find(x => x.TagString.ToLower() == progHelper.TagString.ToLower()); UpdateProgressBar(odBar, progHelper); } break; } } Application.DoEvents(); //So that the label updates with the new status. }
public void FireEvent(ODEventArgs e) { Fired?.Invoke(e); }
private void CredentialsFailedAfterLoginEvent_Fired1(ODEventArgs e) { //If we don't subscribe to this event then the failed event will keep firing over and over. RemotingClient.HasLoginFailed = true; throw new Exception("Incorrect username and password"); }
///<summary></summary> public void Fire(ODEventArgs e) { }