Example #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:FocusMessageHandling"/> class.
 /// </summary>
 /// <param name="refTracker">The scripture reference tracker to be used for handling
 /// reference changes</param>
 /// ------------------------------------------------------------------------------------
 public FocusMessageHandling(IScrRefTracker refTracker)
 {
     if (refTracker == null)
     {
         throw new ArgumentNullException("refTracker");
     }
     m_refTracker = refTracker;
     LogosPositionHandlerFactory.Created += OnLogosPositionHandlerCreated;
 }
Example #2
0
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:IgnoreSynchMessages"/> class.
 /// </summary>
 /// <param name="mainWnd">The main window (which is useful to us only if it turns
 /// out to implement IScrRefTracker.</param>
 /// --------------------------------------------------------------------------------
 public IgnoreSynchMessages(FwMainWnd mainWnd)
 {
     m_refTracker = mainWnd as IScrRefTracker;
     if (m_refTracker != null)
     {
         m_origIgnoreAnySyncMessages        = m_refTracker.IgnoreAnySyncMessages;
         m_refTracker.IgnoreAnySyncMessages = true;
     }
 }
Example #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <param name="fDisposeManagedObjs"><c>true</c> to release both managed and unmanaged
        /// resources; <c>false</c> to release only unmanaged resources.</param>
        /// ------------------------------------------------------------------------------------
        protected virtual void Dispose(bool fDisposeManagedObjs)
        {
            System.Diagnostics.Debug.WriteLineIf(!fDisposeManagedObjs, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            if (fDisposeManagedObjs)
            {
                LogosPositionHandlerFactory.Created -= OnLogosPositionHandlerCreated;

                if (m_positionHandler != null)
                {
                    m_positionHandler.PositionChanged -= m_eventHandler;
                    m_positionHandler.Dispose();
                }
            }

            m_positionHandler = null;
            m_eventHandler    = null;
            m_refTracker      = null;
        }
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FocusMessageHandling"/> class.
		/// </summary>
		/// <param name="refTracker">The scripture reference tracker to be used for handling
		/// reference changes</param>
		/// ------------------------------------------------------------------------------------
		public FocusMessageHandling(IScrRefTracker refTracker)
		{
			if (refTracker == null)
				throw new ArgumentNullException("refTracker");
			m_refTracker = refTracker;
			LogosPositionHandlerFactory.Created += OnLogosPositionHandlerCreated;
		}
		/// --------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:IgnoreSynchMessages"/> class.
		/// </summary>
		/// <param name="mainWnd">The main window (which is useful to us only if it turns
		/// out to implement IScrRefTracker.</param>
		/// --------------------------------------------------------------------------------
		public IgnoreSynchMessages(FwMainWnd mainWnd)
		{
			m_refTracker = mainWnd as IScrRefTracker;
			if (m_refTracker != null)
			{
				m_origIgnoreAnySyncMessages = m_refTracker.IgnoreAnySyncMessages;
				m_refTracker.IgnoreAnySyncMessages = true;
			}
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Releases unmanaged and - optionally - managed resources
		/// </summary>
		/// <param name="fDisposeManagedObjs"><c>true</c> to release both managed and unmanaged
		/// resources; <c>false</c> to release only unmanaged resources.</param>
		/// ------------------------------------------------------------------------------------
		protected virtual void Dispose(bool fDisposeManagedObjs)
		{
			System.Diagnostics.Debug.WriteLineIf(!fDisposeManagedObjs, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			if (fDisposeManagedObjs)
			{
				LogosPositionHandlerFactory.Created -= OnLogosPositionHandlerCreated;

				if (m_positionHandler != null)
				{
					m_positionHandler.PositionChanged -= m_eventHandler;
					m_positionHandler.Dispose();
				}
			}

			m_positionHandler = null;
			m_eventHandler = null;
			m_refTracker = null;
		}