Beispiel #1
0
        /// <summary>
        /// The ITEventCOMCallsDisabled event is fired when calls to the iTunes COM interface
        /// will be deferred.  Typically, iTunes will defer COM calls when any modal dialog
        /// is being displayed. When the user dismisses the last modal dialog, COM calls will
        /// be enabled again, and any deferred COM calls will be executed. You can use this event
        /// to avoid making a COM call which will be deferred.
        /// </summary>
        /// <param name="reason"></param>

        private void DoCOMCallsDisabled(InteractionDisabledReason reason)
        {
            if (reason == InteractionDisabledReason.Dialog)
            {
                slim.EnterWriteLock();
                try
                {
                    if (waitSyncRoot != null)
                    {
                        // force main thread to block/wait for COM calls to be re-enabled;
                        // blocking will end once DoCOMCallsEnabled is called
                        waitSyncRoot = new object();
                    }
                }
                finally
                {
                    slim.ExitWriteLock();
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// The ITEventCOMCallsDisabled event is fired when calls to the iTunes COM interface
 /// will be deferred.  Typically, iTunes will defer COM calls when any modal dialog
 /// is being displayed. When the user dismisses the last modal dialog, COM calls will
 /// be enabled again, and any deferred COM calls will be executed. You can use this event
 /// to avoid making a COM call which will be deferred.
 /// </summary>
 /// <param name="reason"></param>
 private void DoCOMCallsDisabled(InteractionDisabledReason reason)
 {
     if (reason == InteractionDisabledReason.Dialog)
     {
         slim.EnterWriteLock();
         try
         {
             if (waitSyncRoot != null)
             {
                 // force main thread to block/wait for COM calls to be re-enabled;
                 // blocking will end once DoCOMCallsEnabled is called
                 waitSyncRoot = new object();
             }
         }
         finally
         {
             slim.ExitWriteLock();
         }
     }
 }