/// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates and opens a <see cref="DummyFootnoteView"/> in a form. Loads scripture
        /// footnotes from the DB.
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public void CreateFootnoteView(FdoCache cache)
        {
            CheckDisposed();

            Cache = cache;
            FwStyleSheet styleSheet = new FwStyleSheet();

            ILangProject lgproj    = Cache.LangProject;
            IScripture   scripture = lgproj.TranslatedScriptureOA;

            styleSheet.Init(Cache, scripture.Hvo,
                            (int)Scripture.ScriptureTags.kflidStyles);

            m_footnoteView        = new DummyFootnoteView(Cache);
            m_footnoteView.Anchor = AnchorStyles.Top | AnchorStyles.Left |
                                    AnchorStyles.Right | AnchorStyles.Bottom;
            m_footnoteView.Dock = DockStyle.Fill;
            m_footnoteView.Name = "footnoteView";
            // make sure book filter is created before view constructor is created.
            int nbook = m_footnoteView.BookFilter.BookCount;

            m_footnoteView.MakeRoot();
            m_footnoteView.Visible    = true;
            m_footnoteView.StyleSheet = styleSheet;
            Controls.Add(m_footnoteView);
            m_footnoteView.ActivateView();
        }
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// -----------------------------------------------------------------------------------
        protected override void Dispose(bool fDisposing)
        {
            System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            if (fDisposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (m_footnoteView != null)
                {
                    // Remove m_footnoteView and dispose it here, so the call to base.Dispose doesn't crash.
                    // It tries to do the save settings in the Persistence object,
                    // which just went belly up
                    // in the above components.Dispose call.
                    Controls.Remove(m_footnoteView);
                    if (m_footnoteView != null)
                    {
                        m_footnoteView.Dispose();
                    }
                }
                // No. since we don't own it.
                // "The Lord gaveth, and the Lord hath to taketh away."
                // Cache.Dispose();
            }
            m_footnoteView = null;
            Cache          = null;

            base.Dispose(fDisposing);
        }
Example #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.
                if (m_footnoteForm != null)
                {
                    m_footnoteForm.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_footnoteForm = null;
            m_footnoteView = null;             // m_footnoteForm made it, and disposes it.
            m_genesis      = null;

            base.Dispose(disposing);
        }
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Close the footnote view
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public override void TestTearDown()
        {
            m_footnoteView = null;             // m_footnoteForm made it, and disposes it.
            m_footnoteForm.Close();            // This should also dispose it.
            m_footnoteForm = null;
            m_Jude         = null;

            base.TestTearDown();             // If it isn't last, we get some C++ error
        }
Example #5
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Close the footnote view
		/// </summary>
		/// -----------------------------------------------------------------------------------
		public override void TestTearDown()
		{
			m_footnoteView = null; // m_footnoteForm made it, and disposes it.
			m_footnoteForm.Close(); // This should also dispose it.
			m_footnoteForm = null;
			m_Jude = null;

			base.TestTearDown(); // If it isn't last, we get some C++ error
		}
Example #6
0
        public override void Exit()
        {
            CheckDisposed();

            m_footnoteView = null;             // m_footnoteForm made it, and disposes it.
            m_footnoteForm.Close();            // This should also dispose it.
            m_footnoteForm = null;

            base.Exit();             // If it isn't last, we get some C++ error
        }
Example #7
0
		public void Init()
		{
			m_footnoteForm = new DummyFootnoteViewForm();
			m_footnoteForm.DeleteRegistryKey();
			m_footnoteForm.CreateFootnoteView();

			//Application.DoEvents();
			m_footnoteForm.Show();
			m_footnoteView = m_footnoteForm.FootnoteView;
			m_cache = m_footnoteForm.Cache;
			IScripture scr = m_cache.LangProject.TranslatedScriptureOA;
			Application.DoEvents();
		}
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Create a new footnote view
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public override void TestSetup()
        {
            base.TestSetup();

            m_footnoteForm = new DummyFootnoteViewForm();
            m_footnoteForm.DeleteRegistryKey();
            m_footnoteForm.CreateFootnoteView(Cache);

            //Application.DoEvents();
            m_footnoteForm.Show();
            m_footnoteView = m_footnoteForm.FootnoteView;
            m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
            m_scr.RestartFootnoteSequence = true;
            Application.DoEvents();
        }
Example #9
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Create a new footnote view
		/// </summary>
		/// -----------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();

			m_footnoteForm = new DummyFootnoteViewForm();
			m_footnoteForm.DeleteRegistryKey();
			m_footnoteForm.CreateFootnoteView(Cache);

			//Application.DoEvents();
			m_footnoteForm.Show();
			m_footnoteView = m_footnoteForm.FootnoteView;
			m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
			m_scr.RestartFootnoteSequence = true;
			Application.DoEvents();
		}
Example #10
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();

            m_scrInMemoryCache.InitializeWritingSystemEncodings();
            m_footnoteForm = new DummyFootnoteViewForm();
            m_footnoteForm.DeleteRegistryKey();
            m_footnoteForm.CreateFootnoteView(Cache);

            Application.DoEvents();
            m_footnoteForm.Show();
            m_footnoteView = m_footnoteForm.FootnoteView;
            m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
            m_scr.RestartFootnoteSequence  = true;
            m_scr.DisplayFootnoteReference = true;
            Application.DoEvents();
        }
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Create a new footnote view
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public override void TestSetup()
        {
            base.TestSetup();

            m_scr.CrossRefsCombinedWithFootnotes = true;
            m_scr.FootnoteMarkerType             = FootnoteMarkerTypes.SymbolicFootnoteMarker;
            m_scr.FootnoteMarkerSymbol           = "#";
            m_scr.DisplayFootnoteReference       = true;

            m_footnoteForm = new DummyFootnoteViewForm();
            m_footnoteForm.DeleteRegistryKey();
            m_footnoteForm.CreateFootnoteView(Cache);

            m_footnoteForm.Show();
            m_footnoteView = m_footnoteForm.FootnoteView;
            m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
            Application.DoEvents();
        }
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Create a new footnote view
		/// </summary>
		/// -----------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();

			m_scr.CrossRefsCombinedWithFootnotes = true;
			m_scr.FootnoteMarkerType = FootnoteMarkerTypes.SymbolicFootnoteMarker;
			m_scr.FootnoteMarkerSymbol = "#";
			m_scr.DisplayFootnoteReference = true;

			m_footnoteForm = new DummyFootnoteViewForm();
			m_footnoteForm.DeleteRegistryKey();
			m_footnoteForm.CreateFootnoteView(Cache);

			m_footnoteForm.Show();
			m_footnoteView = m_footnoteForm.FootnoteView;
			m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
			Application.DoEvents();
		}
		/// <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_footnoteForm != null)
					m_footnoteForm.Dispose();
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			m_footnoteView = null; // m_footnoteForm made it, and disposes it.
			m_footnoteForm = null;

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

            m_scrInMemoryCache.InitializeWritingSystemEncodings();
            m_scr.CrossRefsCombinedWithFootnotes = true;
            m_scr.FootnoteMarkerType             = FootnoteMarkerTypes.SymbolicFootnoteMarker;
            m_scr.FootnoteMarkerSymbol           = "#";
            m_scr.DisplayFootnoteReference       = true;

            m_footnoteForm = new DummyFootnoteViewForm();
            m_footnoteForm.DeleteRegistryKey();
            m_footnoteForm.CreateFootnoteView(Cache);

            m_footnoteForm.Show();
            m_footnoteView = m_footnoteForm.FootnoteView;
            m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
            Application.DoEvents();
        }
Example #15
0
		public override void Initialize()
		{
			CheckDisposed();
			base.Initialize();

			m_scrInMemoryCache.InitializeWritingSystemEncodings();
			m_wsUrdu = InMemoryFdoCache.s_wsHvos.Ur;

			m_footnoteForm = new DummyFootnoteViewForm();
			m_footnoteForm.DeleteRegistryKey();
			m_footnoteForm.CreateFootnoteView(Cache);

			//Application.DoEvents();
			m_footnoteForm.Show();
			m_footnoteView = m_footnoteForm.FootnoteView;
			m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
			m_scr.RestartFootnoteSequence = true;
			Application.DoEvents();
		}
Example #16
0
		public override void Exit()
		{
			CheckDisposed();

			m_footnoteView = null; // m_footnoteForm made it, and disposes it.
			m_footnoteForm.Close(); // This should also dispose it.
			m_footnoteForm = null;
			m_genesis = null;

			base.Exit(); // If it isn't last, we get some C++ error
		}
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Creates and opens a <see cref="DummyFootnoteView"/> in a form. Loads scripture
		/// footnotes from the DB.
		/// </summary>
		/// -----------------------------------------------------------------------------------
		public void CreateFootnoteView(FdoCache cache)
		{
			CheckDisposed();

			Cache = cache;
			FwStyleSheet styleSheet = new FwStyleSheet();

			ILangProject lgproj = Cache.LangProject;
			IScripture scripture = lgproj.TranslatedScriptureOA;
			styleSheet.Init(Cache, scripture.Hvo,
				(int)Scripture.ScriptureTags.kflidStyles);

			m_footnoteView = new DummyFootnoteView(Cache);
			m_footnoteView.Anchor = AnchorStyles.Top | AnchorStyles.Left |
				AnchorStyles.Right | AnchorStyles.Bottom;
			m_footnoteView.Dock = DockStyle.Fill;
			m_footnoteView.Name = "footnoteView";
			// make sure book filter is created before view constructor is created.
			int nbook = m_footnoteView.BookFilter.BookCount;
			m_footnoteView.MakeRoot();
			m_footnoteView.Visible = true;
			m_footnoteView.StyleSheet = styleSheet;
			Controls.Add(m_footnoteView);
			m_footnoteView.ActivateView();
		}
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// -----------------------------------------------------------------------------------
		protected override void Dispose( bool fDisposing )
		{
			if (fDisposing)
			{
				if(components != null)
				{
					components.Dispose();
				}
				if (m_footnoteView != null)
				{
					// Remove m_footnoteView and dispose it here, so the call to base.Dispose doesn't crash.
					// It tries to do the save settings in the Persistence object,
					// which just went belly up
					// in the above components.Dispose call.
					Controls.Remove(m_footnoteView);
					if (m_footnoteView != null)
						m_footnoteView.Dispose();
				}
				// No. since we don't own it.
				// "The Lord gaveth, and the Lord hath to taketh away."
				// Cache.Dispose();
			}
			m_footnoteView = null;
			Cache = null;

			base.Dispose( fDisposing );
		}
Example #19
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Create a new footnote view
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public override void TestSetup()
        {
            base.TestSetup();
            m_footnoteForm = new DummyFootnoteViewForm();
            m_footnoteForm.DeleteRegistryKey();
            m_footnoteForm.CreateFootnoteView(Cache);

            //Application.DoEvents();
            m_footnoteForm.Show();
            m_footnoteView = m_footnoteForm.FootnoteView;
            Application.DoEvents();
        }
Example #20
0
		public void CleanUp()
		{
			if (m_cache != null)
			{
				if (m_cache.CanUndo)
					m_cache.Undo();
				if (m_cache.DatabaseAccessor.IsTransactionOpen())
					m_cache.DatabaseAccessor.RollbackTrans();
			}
			else
			{
				Debug.WriteLine("Null cache in cleanup, something went wrong.");
			}
			m_cache = null;
			m_footnoteView = null;
			m_footnoteForm.Close();
			m_footnoteForm = null;
		}
Example #21
0
 /// -----------------------------------------------------------------------------------
 /// <summary>
 /// Close the footnote view
 /// </summary>
 /// -----------------------------------------------------------------------------------
 public override void TestTearDown()
 {
     m_footnoteView = null;
     m_footnoteForm.Close();
     m_footnoteForm = null;
     base.TestTearDown();
 }
		public override void Initialize()
		{
			CheckDisposed();
			base.Initialize();

			m_scrInMemoryCache.InitializeWritingSystemEncodings();
			m_scr.CrossRefsCombinedWithFootnotes = true;
			m_scr.FootnoteMarkerType = FootnoteMarkerTypes.SymbolicFootnoteMarker;
			m_scr.FootnoteMarkerSymbol = "#";
			m_scr.DisplayFootnoteReference = true;

			m_footnoteForm = new DummyFootnoteViewForm();
			m_footnoteForm.DeleteRegistryKey();
			m_footnoteForm.CreateFootnoteView(Cache);

			m_footnoteForm.Show();
			m_footnoteView = m_footnoteForm.FootnoteView;
			m_footnoteView.RootBox.MakeSimpleSel(true, true, false, true);
			Application.DoEvents();
		}