Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 private void PatientEvent_Fired(ODEventArgs e)
 {
     if (((e.Tag as Patient)?.PatNum ?? -1) == FormOpenDental.CurPatNum)
     {
         RefreshDashboard();
     }
 }
Ejemplo n.º 3
0
 ///<summary></summary>
 public static void Fire(ODEventArgs e)
 {
     if (Fired != null)
     {
         Fired(e);
     }
 }
Ejemplo n.º 4
0
 private void WikiSaveEvent_Fired(ODEventArgs e)
 {
     if (e.EventType == ODEventType.WikiSave)
     {
         SaveDraft_Click(false);
     }
 }
Ejemplo n.º 5
0
 private void StopRecurringCharges(ODEventArgs args)
 {
     if (args.EventType == ODEventType.Shutdown)
     {
         _charger.StopCharges(true);
     }
 }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 8
0
 private void DbMonitorEvent_Fired(ODEventArgs e)
 {
     if (e.EventType != ODEventType.QueryMonitor || !(e.Tag is DbQueryObj))
     {
         return;
     }
     _queueQueries.Enqueue(e.Tag as DbQueryObj);
 }
Ejemplo n.º 9
0
 public void PatientChangedEvent_Fired(ODEventArgs e)
 {
     if (e.EventType != ODEventType.Patient || e.Tag.GetType() != typeof(long) || this.IsDisposed)
     {
         return;
     }
     FillPat();
 }
Ejemplo n.º 10
0
 public void PatientChangedEvent_Fired(ODEventArgs e)
 {
     if (e.Name != "FormOpenDental" || e.Tag.GetType() != typeof(long) || this.IsDisposed)
     {
         return;
     }
     FillPat();
 }
Ejemplo n.º 11
0
        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.
        }
Ejemplo n.º 12
0
 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();
 }
Ejemplo n.º 13
0
 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();
     }
 }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
        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();
            }
        }
Ejemplo n.º 16
0
 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;
 }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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();
            }
        }
Ejemplo n.º 19
0
        ///<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
        }
Ejemplo n.º 20
0
 private void PatientChangedEvent_Fired(ODEventArgs e)
 {
     RefreshDashboard();
 }
Ejemplo n.º 21
0
 public void FireEvent(ODEventArgs e)
 {
     Fire(e);
 }
Ejemplo n.º 22
0
        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.
        }
Ejemplo n.º 23
0
 public void FireEvent(ODEventArgs e)
 {
     Fired?.Invoke(e);
 }
Ejemplo n.º 24
0
 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");
 }
Ejemplo n.º 25
0
 ///<summary></summary>
 public void Fire(ODEventArgs e)
 {
 }