Пример #1
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates a new instance of DummyFwMainWnd.
        /// </summary>
        ///
        /// <param name="cache">Instance of the FW Data Objects cache that the new main window
        /// will use for accessing the database.</param>
        /// <param name="fNewCache">Flag indicating whether one-time, application-specific
        /// initialization should be done for this cache.</param>
        /// <param name="wndCopyFrom"> Must be null for creating the original app window.
        /// Otherwise, a reference to the main window whose settings we are copying.</param>
        ///
        /// <returns>New instance of DummyFwMainWnd</returns>
        /// -----------------------------------------------------------------------------------
        protected override Form NewMainAppWnd(FdoCache cache, bool fNewCache, Form wndCopyFrom,
			bool newProject)
        {
            Form dummyFwMainWnd = new DummyFwMainWnd(cache, wndCopyFrom);
            return dummyFwMainWnd;
        }
Пример #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Issues a new window command and verifies the new window's DesktopBounds is the same
        /// as the expected rectangle.
        /// </summary>
        /// <param name="wndOrig">Window being copied (and from which the new window
        /// command is issued).</param>
        /// <param name="rcExpected">The rectangle the copied (i.e. new) widnow's DesktopBounds
        /// should be equal to.</param>
        /// ------------------------------------------------------------------------------------
        private FormWindowState VerifyWindowCopy(DummyFwMainWnd wndOrig, Rectangle rcExpected)
        {
            // Open a new window based on the original, get it's DeskTopBounds & close it.
            wndOrig.SimulateWindowNewWindow();
            FormWindowState copyState = ((Form)m_DummyFwApp.MainWindows[1]).WindowState;
            ((Form)m_DummyFwApp.MainWindows[1]).WindowState = FormWindowState.Normal;
            Rectangle rcCopy = ((Form)m_DummyFwApp.MainWindows[1]).DesktopBounds;
            ((Form)m_DummyFwApp.MainWindows[1]).Close();

            // Verify the original and the copy are the same size and that the copy is in
            // the proper place.
            Assert.AreEqual(rcExpected, rcCopy);

            // Restore the minimum size for future tests.
            wndOrig.Size = wndOrig.MinimumSize;

            return copyState;
        }