/// ------------------------------------------------------------------------------------ /// <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> /// Called when the logos position handler got created. /// </summary> /// ------------------------------------------------------------------------------------ private void OnLogosPositionHandlerCreated(object sender, CreatedEventArgs e) { m_positionHandler = e.PositionHandler; m_eventHandler = new EventHandler <PositionChangedEventArgs>(OnPositionChanged); m_positionHandler.PositionChanged += m_eventHandler; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Called when the logos position handler got created. /// </summary> /// ------------------------------------------------------------------------------------ private void OnLogosPositionHandlerCreated(object sender, CreatedEventArgs e) { m_positionHandler = e.PositionHandler; m_eventHandler = new EventHandler<PositionChangedEventArgs>(OnPositionChanged); m_positionHandler.PositionChanged += m_eventHandler; }