Ejemplo n.º 1
0
        public void ManualStartPositionMaximized()
        {
            Rectangle rectOrig;

            using (var form = new DummyPersistedFormManual())
            {
                form.Show();
                form.SetDesktopBounds(40, 50, 110, 98);
                rectOrig         = form.DesktopBounds;
                form.WindowState = FormWindowState.Maximized;
                form.Close();
            }
            using (var form = new DummyPersistedFormManual())
            {
                form.Show();
#if !__MonoCS__
                FormWindowState state = form.WindowState;
#endif

                // Restore to normal state, original size
                form.WindowState = FormWindowState.Normal;
                Rectangle rcForm = form.DesktopBounds;
                form.Close();

#if !__MonoCS__
                Assert.AreEqual(FormWindowState.Maximized, state);
#else
                // TODO-Linux: probably fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 renable this when this has been fixed
#endif
                Assert.AreEqual(rectOrig, rcForm);
            }
        }
Ejemplo n.º 2
0
		public void ManualStartPositionNoInterference()
		{
			DummyPersistedFormManual form = new DummyPersistedFormManual();
			form.SetDesktopBounds(100, 200, form.Width, form.Height);
			Rectangle rectOrig = form.DesktopBounds;
			form.Show();
			FormWindowState state = form.WindowState;
			Rectangle rcForm = form.DesktopBounds;
			form.Close();
			Assert.AreEqual(FormWindowState.Normal, state);
			Assert.AreEqual(rectOrig, rcForm);
		}
Ejemplo n.º 3
0
        public void ManualStartPositionNoInterference()
        {
            DummyPersistedFormManual form = new DummyPersistedFormManual();

            form.SetDesktopBounds(100, 200, form.Width, form.Height);
            Rectangle rectOrig = form.DesktopBounds;

            form.Show();
            FormWindowState state  = form.WindowState;
            Rectangle       rcForm = form.DesktopBounds;

            form.Close();
            Assert.AreEqual(FormWindowState.Normal, state);
            Assert.AreEqual(rectOrig, rcForm);
        }
Ejemplo n.º 4
0
        public void ManualStartPositionNormal()
        {
            DummyPersistedFormManual form = new DummyPersistedFormManual();

            form.SetDesktopBounds(40, 50, 110, 98);
            Rectangle rectOrig = form.DesktopBounds;

            form.Show();
            form.Close();
            form = new DummyPersistedFormManual();
            form.Show();

            FormWindowState state  = form.WindowState;
            Rectangle       rcForm = form.DesktopBounds;

            form.Close();

            Assert.AreEqual(FormWindowState.Normal, state);
            Assert.AreEqual(rectOrig, rcForm);
        }
Ejemplo n.º 5
0
		public void ManualStartPositionNoInterference()
		{
			using (DummyPersistedFormManual form = new DummyPersistedFormManual())
			{
				form.SetDesktopBounds(100, 200, form.Width, form.Height);
				Rectangle rectOrig = form.DesktopBounds;
				form.Show();
				FormWindowState state = form.WindowState;
				Rectangle rcForm = form.DesktopBounds;
				float dpi;
				using (var graphics = form.CreateGraphics())
				{
					dpi = graphics.DpiX;
				}
				form.Close();
				Assert.AreEqual(FormWindowState.Normal, state);
				Assert.AreEqual(rectOrig.Location, rcForm.Location);
				// At any other DPI, DotNet resizes the window for us!
				if (dpi == 96)
					Assert.AreEqual(rectOrig, rcForm);
			}
		}
Ejemplo n.º 6
0
        public void ManualStartPositionMaximized()
        {
            DummyPersistedFormManual form = new DummyPersistedFormManual();

            form.SetDesktopBounds(40, 50, 110, 98);
            Rectangle rectOrig = form.DesktopBounds;

            form.Show();
            form.WindowState = FormWindowState.Maximized;
            form.Close();
            form = new DummyPersistedFormManual();
            form.Show();
            FormWindowState state = form.WindowState;

            // Restore to normal state, original size
            form.WindowState = FormWindowState.Normal;
            Rectangle rcForm = form.DesktopBounds;

            form.Close();

            Assert.AreEqual(FormWindowState.Maximized, state);
            Assert.AreEqual(rectOrig, rcForm);
        }
Ejemplo n.º 7
0
 public void ManualStartPositionNoInterference()
 {
     using (DummyPersistedFormManual form = new DummyPersistedFormManual())
     {
         form.SetDesktopBounds(100, 200, form.Width, form.Height);
         Rectangle rectOrig = form.DesktopBounds;
         form.Show();
         FormWindowState state  = form.WindowState;
         Rectangle       rcForm = form.DesktopBounds;
         float           dpi;
         using (var graphics = form.CreateGraphics())
         {
             dpi = graphics.DpiX;
         }
         form.Close();
         Assert.AreEqual(FormWindowState.Normal, state);
         Assert.AreEqual(rectOrig.Location, rcForm.Location);
         // At any other DPI, DotNet resizes the window for us!
         if (dpi == 96)
         {
             Assert.AreEqual(rectOrig, rcForm);
         }
     }
 }
Ejemplo n.º 8
0
		public void ManualStartPositionNormal()
		{
			Rectangle rectOrig;
			using (var form = new DummyPersistedFormManual())
			{
				form.Show();
				form.SetDesktopBounds(40, 50, 110, 98);
				rectOrig = form.DesktopBounds;
				form.Close();
			}
			using (var form = new DummyPersistedFormManual())
			{
				form.Show();

				FormWindowState state = form.WindowState;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();

				Assert.AreEqual(FormWindowState.Normal, state);
				Assert.AreEqual(rectOrig, rcForm);
			}
		}
Ejemplo n.º 9
0
		public void ManualStartPositionMaximized()
		{
			Rectangle rectOrig;
			using (var form = new DummyPersistedFormManual())
			{
				form.Show();
				form.SetDesktopBounds(40, 50, 110, 98);
				rectOrig = form.DesktopBounds;
				form.WindowState = FormWindowState.Maximized;
				form.Close();
			}
			using (var form = new DummyPersistedFormManual())
			{
				form.Show();
#if !__MonoCS__
				FormWindowState state = form.WindowState;
#endif

				// Restore to normal state, original size
				form.WindowState = FormWindowState.Normal;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();

#if !__MonoCS__
				Assert.AreEqual(FormWindowState.Maximized, state);
#else
				// TODO-Linux: probably fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 renable this when this has been fixed
#endif
				Assert.AreEqual(rectOrig, rcForm);
			}
		}
Ejemplo n.º 10
0
		public void ManualStartPositionMaximized()
		{
			DummyPersistedFormManual form = new DummyPersistedFormManual();
			form.SetDesktopBounds(40, 50, 110, 98);
			Rectangle rectOrig = form.DesktopBounds;
			form.Show();
			form.WindowState = FormWindowState.Maximized;
			form.Close();
			form = new DummyPersistedFormManual();
			form.Show();
			FormWindowState state = form.WindowState;

			// Restore to normal state, original size
			form.WindowState = FormWindowState.Normal;
			Rectangle rcForm = form.DesktopBounds;
			form.Close();

			Assert.AreEqual(FormWindowState.Maximized, state);
			Assert.AreEqual(rectOrig, rcForm);
		}