/// <summary>
 /// Start the SpreadDetailSubscription.
 /// </summary>
 private void startSpreadDetailSubscription()
 {
     m_autospreaderManager      = m_TTAPI.Session.TTAPI.AutospreaderManager;
     m_spreadDetailSubscription = new SpreadDetailSubscription(m_TTAPI.Session, Dispatcher.Current);
     m_spreadDetailSubscription.SpreadDetailsAdded   += new EventHandler <SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.SpreadDetailsUpdated += new EventHandler <SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.SpreadDetailsDeleted += new EventHandler <SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.Start();
 }
        /// <summary>
        /// Dispose of all the TT API objects and shutdown the TT API
        /// </summary>
        public void shutdownTTAPI()
        {
            if (!m_shutdownInProcess)
            {
                // Dispose of all request objects
                if (m_spreadDetailSubscription != null)
                {
                    m_spreadDetailSubscription.SpreadDetailsAdded   -= spreadDetailsChanged;
                    m_spreadDetailSubscription.SpreadDetailsDeleted -= spreadDetailsChanged;
                    m_spreadDetailSubscription.SpreadDetailsUpdated -= spreadDetailsChanged;
                    m_spreadDetailSubscription.Dispose();
                    m_spreadDetailSubscription = null;
                }

                TTAPI.ShutdownCompleted += new EventHandler(TTAPI_ShutdownCompleted);
                TTAPI.Shutdown();
            }

            // only run shutdown once
            m_shutdownInProcess = true;
        }
 /// <summary>
 /// Start the SpreadDetailSubscription.
 /// </summary>
 private void startSpreadDetailSubscription()
 {
     m_autospreaderManager = m_session.TTAPI.AutospreaderManager;
     m_spreadDetailSubscription = new SpreadDetailSubscription(m_session, m_dispatcher);
     m_spreadDetailSubscription.SpreadDetailsAdded += new EventHandler<SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.SpreadDetailsUpdated += new EventHandler<SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.SpreadDetailsDeleted += new EventHandler<SpreadDetailsEventArgs>(spreadDetailsChanged);
     m_spreadDetailSubscription.Start();
 }
        /// <summary>
        /// Dispose of all the TT API objects and shutdown the TT API 
        /// </summary>
        public void shutdownTTAPI()
        {
            if (!m_shutdownInProcess)
            {
                // Dispose of all request objects
                if (m_spreadDetailSubscription != null)
                {
                    m_spreadDetailSubscription.SpreadDetailsAdded -= spreadDetailsChanged;
                    m_spreadDetailSubscription.SpreadDetailsDeleted -= spreadDetailsChanged;
                    m_spreadDetailSubscription.SpreadDetailsUpdated -= spreadDetailsChanged;
                    m_spreadDetailSubscription.Dispose();
                    m_spreadDetailSubscription = null;
                }

                TTAPI.ShutdownCompleted += new EventHandler(TTAPI_ShutdownCompleted);
                TTAPI.Shutdown();
            }

            // only run shutdown once
            m_shutdownInProcess = true;
        }