Exemple #1
0
        public override void TestSetup()
        {
            base.TestSetup();

            // Save value of user prompt setting - restored in Cleanup.
            m_saveShowPrompts = Options.ShowEmptyParagraphPromptsSetting;
            Options.ShowEmptyParagraphPromptsSetting = false;
            m_saveSegmentedBT = Options.UseInterlinearBackTranslation;
            Options.UseInterlinearBackTranslation = CreateSegmentedBt;

            Debug.Assert(m_draftForm == null, "m_draftForm is not null.");
            //if (m_draftForm != null)
            //	m_draftForm.Dispose();
            m_draftForm = new DummyDraftViewForm(Cache);
            m_draftForm.DeleteRegistryKey();
            m_draftForm.CreateDraftView(Cache, CreateBtDraftView);

            m_draftView        = m_draftForm.DraftView;
            m_draftView.Width  = 300;
            m_draftView.Height = 290;
            m_draftView.CallOnLayout();

            // Set the selection at the start of the view
            m_draftView.RootBox.MakeSimpleSel(true, true, false, true);
        }
Exemple #2
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_draftForm != null)
                {
                    m_draftForm.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_draftForm   = null;
            m_btDraftView = null;
            m_book        = null;

            base.Dispose(disposing);
        }
Exemple #3
0
        /// ----------------------------------------------------------------------------------------
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        /// ----------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            try
            {
                if (disposing)
                {
                    // Dispose managed resources here.
                    if (m_btDraftForm != null)
                    {
                        m_btDraftForm.Dispose();
                    }
                }
            }
            finally
            {
                // Dispose unmanaged resources here, whether disposing is true or false.
                m_btDraftForm = null;
                m_btDraftView = null;

                base.Dispose(disposing);
            }
        }
Exemple #4
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();

            // Save value of user prompt setting - restored in Cleanup.
            m_saveShowPrompts = Options.ShowEmptyParagraphPromptsSetting;
            Options.ShowEmptyParagraphPromptsSetting = false;

            Debug.Assert(m_btDraftForm == null, "m_btDraftForm is not null.");
            //if (m_btDraftForm != null)
            //	m_btDraftForm.Dispose();
            m_btDraftForm = new DummyDraftViewForm();
            m_btDraftForm.DeleteRegistryKey();
            m_btDraftForm.CreateDraftView(Cache, true);
            m_btDraftForm.Show();

            m_btDraftView        = m_btDraftForm.DraftView;
            m_btDraftView.Width  = 300;
            m_btDraftView.Height = 290;
            m_btDraftView.CallOnLayout();
            m_scr.RestartFootnoteSequence = true;

//			Application.DoEvents();
        }
Exemple #5
0
        public override void Exit()
        {
            CheckDisposed();

            m_btDraftView = null;
            m_draftForm.Close();
            m_draftForm = null;

            base.Exit();
        }
Exemple #6
0
        public override void TestTearDown()
        {
            m_draftView = null;
            m_draftForm.Close();
            m_draftForm = null;

            base.TestTearDown();

            // Restore prompt setting
            Options.ShowEmptyParagraphPromptsSetting = m_saveShowPrompts;
            Options.UseInterlinearBackTranslation    = m_saveSegmentedBT;
        }
Exemple #7
0
        public override void Exit()
        {
            CheckDisposed();

            m_btDraftView = null;
            m_btDraftForm.Close();
            m_btDraftForm = null;

            // Restore prompt setting
            Options.ShowEmptyParagraphPromptsSetting = m_saveShowPrompts;
            base.Exit();
        }
Exemple #8
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();

            m_draftForm = new DummyDraftViewForm();
            m_draftForm.DeleteRegistryKey();
            m_draftForm.CreateDraftView(Cache, true);

            m_btDraftView        = m_draftForm.DraftView;
            m_btDraftView.Width  = 300;
            m_btDraftView.Height = 290;
            m_btDraftView.CallOnLayout();
        }
Exemple #9
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();

            m_draftForm = new DummyDraftViewForm();
            m_draftForm.DeleteRegistryKey();
            m_draftForm.CreateDraftView(Cache, true);

            m_btDraftView        = m_draftForm.DraftView;
            m_btDraftView.Width  = 300;
            m_btDraftView.Height = 290;
            m_btDraftView.CallOnLayout();

            m_btDraftView.RootBox.Reconstruct();             // update the view
            // Set the selection at the start of the section
            m_btDraftView.TeEditingHelper.SetInsertionPoint(0, 0, 0, 0, false);
        }