示例#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);
        }
示例#2
0
        public void TestSetup()
        {
            m_versification = new TestScrVers();
            m_ctrlOwner     = new Form();

            m_scp = new DummyScrPassageControl();
            m_scp.Initialize(new BCVRef(01001001), m_versification);
            m_filteredScp = new DummyScrPassageControl();
            m_filteredScp.Initialize(new BCVRef(01001001), m_versification, 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_versification = new TestScrVers();
            m_ctrlOwner = new Form();

			m_scp = new DummyScrPassageControl();
		    m_scp.Initialize(new BCVRef(01001001), m_versification);
			m_filteredScp = new DummyScrPassageControl();
            m_filteredScp.Initialize(new BCVRef(01001001), m_versification, 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();
		}