Esempio n. 1
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();
        }
Esempio n. 2
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);
        }
Esempio n. 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)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_dummyDraftView = null;             // Should be disposed by the window, since it is one of its controls.

            base.Dispose(disposing);
        }
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates a dummy draft view in the main window.
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public void CreateDraftView()
        {
            // Check for verse bridge
            if (m_dummyDraftView != null)
            {
                m_dummyDraftView.Dispose();
            }
            m_dummyDraftView      = new DummyDraftView(Cache, false, Handle.ToInt32());
            m_dummyDraftView.Name = "dummyDraftView";

            m_dummyDraftView.Visible    = true;
            m_dummyDraftView.StyleSheet = StyleSheet;
            m_dummyDraftView.Anchor     = AnchorStyles.Top | AnchorStyles.Left |
                                          AnchorStyles.Right | AnchorStyles.Bottom;
            m_dummyDraftView.Dock = DockStyle.Fill;
            Controls.Add(m_dummyDraftView);
            m_rgClientViews.Add(m_dummyDraftView.GetType().Name, m_dummyDraftView);
            m_dummyDraftView.MakeRoot();             // JT needed to add this to get tests to pass.
            m_dummyDraftView.ActivateView();
            // m_dummyDraftView.TeEditingHelper.InTestMode = true;
        }
Esempio n. 5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates the dummy draft view.
        /// </summary>
        /// <param name="fForBT"><c>true</c> if the draft view is supposed to represent a BT
        /// </param>
        /// <param name="fMakeRoot"><c>true</c> if the root should be constructed; <c>false</c>
        /// if the caller will be responsible for making the rootbox later.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        private DummyDraftView CreateDummyDraftView(bool fForBT, bool fMakeRoot)
        {
            DummyDraftView draftView = new DummyDraftView(Cache, fForBT, Handle.ToInt32());

            draftView.Anchor = AnchorStyles.Top | AnchorStyles.Left |
                               AnchorStyles.Right | AnchorStyles.Bottom;
            draftView.Dock       = DockStyle.Fill;
            draftView.Name       = "draftView";
            draftView.StyleSheet = StyleSheet;
            if (m_rootb != null)
            {
                draftView.RootBox = m_rootb;
            }

            if (fMakeRoot)
            {
                draftView.MakeRoot();
                draftView.Visible = true;
                draftView.ActivateView();
            }

            return(draftView);
        }
Esempio n. 6
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates 2 sync'd draftviews in a form. Loads scripture from the DB.
        /// </summary>
        /// <param name="cache">The cache, believe it or not</param>
        /// -----------------------------------------------------------------------------------
        public RootSiteGroup CreateSyncDraftView(FdoCache cache)
        {
            CheckDisposed();

            Cache = cache;
            RootSiteGroup group = new RootSiteGroup(cache, (int)TeViewGroup.Scripture);

            DummyDraftView draft1 = CreateDummyDraftView(false, false);

            m_draftView = CreateDummyDraftView(false, false);
            group.AddToSyncGroup(draft1);
            group.AddToSyncGroup(m_draftView);
            group.ScrollingController = m_draftView;

            draft1.MakeRoot();
            draft1.Visible = true;
            m_draftView.MakeRoot();
            m_draftView.Visible = true;

            Controls.Add(group);
            group.Show();
            return(group);
        }