Exemple #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Tries the DoEvents a few times to give the DropDownWindow a chance to become active.
        /// Tests were occassionally failing due to a null DropDownWindow reference.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private static void WaitForDropDownWindow(DummyScrPassageControl spc, int expectedCount)
        {
            int i = 0;

            do
            {
                Application.DoEvents();
                if (spc.DropDownWindow != null && spc.DropDownWindow.Menu != null &&
                    spc.DropDownWindow.Menu.MenuItems.Count == expectedCount)
                {
                    break;
                }
                i++;
            }while (i < 20);
        }
Exemple #2
0
        public void TestSetup()
        {
            m_ctrlOwner = new Form();

            m_scp         = new DummyScrPassageControl(new ScrReference(01001001, ScrVers.English));
            m_filteredScp = new DummyScrPassageControl(new ScrReference(01001001, ScrVers.English));
            m_filteredScp.Initialize(m_filteredScp.ScReference, new [] { 57, 59, 65 });

            m_ctrlOwner.Controls.Add(m_scp);
            m_ctrlOwner.Controls.Add(m_filteredScp);
            m_ctrlOwner.CreateControl();

            if (m_scp.DropDownWindow != null)
            {
                m_scp.DropDownWindow.Close();
            }

            if (m_filteredScp.DropDownWindow != null)
            {
                m_filteredScp.DropDownWindow.Close();
            }
        }
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Tries the DoEvents a few times to give the DropDownWindow a chance to become active.
		/// Tests were occassionally failing due to a null DropDownWindow reference.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private static void WaitForDropDownWindow(DummyScrPassageControl spc, int expectedCount)
		{
			int i = 0;
			do
			{
				Application.DoEvents();
				if (spc.DropDownWindow != null && spc.DropDownWindow.Menu != null &&
					spc.DropDownWindow.Menu.MenuItems.Count == expectedCount)
					break;
				i++;
			}
			while (i < 20);
		}
		public void TestSetup()
		{
			m_ctrlOwner = new Form();

			m_scp = new DummyScrPassageControl(new ScrReference(01001001, ScrVers.English));
			m_filteredScp = new DummyScrPassageControl(new ScrReference(01001001, ScrVers.English));
			m_filteredScp.Initialize(m_filteredScp.ScReference, new [] {57, 59, 65});

			m_ctrlOwner.Controls.Add(m_scp);
			m_ctrlOwner.Controls.Add(m_filteredScp);
			m_ctrlOwner.CreateControl();

			if (m_scp.DropDownWindow != null)
				m_scp.DropDownWindow.Close();

			if (m_filteredScp.DropDownWindow != null)
				m_filteredScp.DropDownWindow.Close();
		}