Пример #1
0
        // Execute any pending messages.
        private void DoPendingMessages()
        {
#if TESTMS
            Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages start: " + m_obj.ToString());
            Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages Asserting m_fReentering to be true; " + "original value: " + m_fReentering.ToString());
            if (!m_fReentering)
            {
                Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages Failed Assert: Debug.Assert(m_fReentering);");
                Debug.WriteLine(String.Format("Master: {0}", m_master));
            }
#endif
            // This can happen, if the client called PauseMessageQueueing in a non-modal environment,
            // which just kept going. PauseMessageQueueing is only to be used in a modal context, that
            // does not keep going right away.
            Debug.Assert(m_fReentering, "You probably are using PauseMessageQueueing in a non-modal context.");
#if TESTMS
            Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages Passed Assert: Debug.Assert(m_fReentering);");
#endif
            // A Refresh message can dispose of this object while this object is handling that message.
            while (m_messages != null && m_messages.Count > 0)
            {
                Message m1 = (Message)m_messages.Remove();
#if TESTMS
                Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages handle cached message (start): " + m1.ToString());
#endif
                m_receiver.OriginalWndProc(ref m1);
#if TESTMS
                Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages resend message (done): " + m1.ToString());
#endif
            }
#if TESTMS
            Debug.WriteLineIf(s_fMatchingHvo, "MessageSequencer.DoPendingMessages end: " + m_obj.ToString());
#endif
        }
Пример #2
0
 void Check(int start, int end, ref int count, SafeQueue queue)
 {
     for (int i = start; i < end; i++)
     {
         int result = (int)queue.Remove();
         count--;
         Assert.AreEqual(i, result);
         Assert.AreEqual(count, queue.Count);
     }
 }
Пример #3
0
		void Check(int start, int end, ref int count, SafeQueue queue)
		{
			for (int i = start; i < end; i++)
			{
				int result = (int) queue.Remove();
				count--;
				Assert.AreEqual(i, result);
				Assert.AreEqual(count, queue.Count);
			}
		}