예제 #1
0
        protected override void ShowRecord()
        {
            //todo: add the document view name to the task label
            //todo: fast machine, this doesn't really seem to do any good. I think maybe the parts that
            //are taking a longtime are not getting Breath().
            //todo: test on a machine that is slow enough to see if this is helpful or not!
            using (ProgressState progress = FwXWindow.CreatePredictiveProgressState(m_mediator, this.m_vectorName))
            {
                progress.Breath();

                Debug.Assert(m_rootSite != null);

                progress.Breath();

                base.ShowRecord();

                Clerk.SaveOnChangeRecord();

                progress.Breath();

                if (Clerk.CurrentObject == null)
                {
                    m_rootSite.Hide();
                    return;
                }
                try
                {
                    progress.SetMilestone();

                    m_rootSite.Show();
                    using (new WaitCursor(this))
                    {
                        IChangeRootObject root = m_rootSite as IChangeRootObject;
                        if (root != null && !Clerk.SuspendLoadingRecordUntilOnJumpToRecord)
                        {
                            root.SetRoot(Clerk.CurrentObject.Hvo);
                        }
                    }
                }
                catch (Exception error)
                {
                    if (m_mediator.PropertyTable.GetBoolProperty("DoingAutomatedTest", false))
                    {
                        throw;
                    }
                    else                        //don't really need to make the program stop just because we could not show this record.
                    {
                        IApp app = (IApp)m_mediator.PropertyTable.GetValue("App");
                        ErrorReporter.ReportException(error, app.SettingsKey,
                                                      m_mediator.FeedbackInfoProvider.SupportEmailAddress, null, false);
                    }
                }
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: sillsdev/WorldPad
        private void Do(double secs, string label)
        {
            m_state.SetMilestone(label);
            int mils = (int)(secs * 1000);
            int step = 100;

            for (int m = 0; m < mils; m += step)
            {
                m_state.Breath();
                System.Threading.Thread.Sleep(step);
            }
        }