Пример #1
0
        public void TestProtectedProperties()
        {
            // Not a surprise, but none of these cause handle creation.
            // Included just to absolutely certain.
            ProtectedPropertyForm c = new ProtectedPropertyForm();

            object o;

#if !__MonoCS__
            o = c.PublicCanRaiseEvents;
            Assert.IsFalse(c.IsHandleCreated, "A1");
#endif
            o = c.PublicCreateParams;
            Assert.IsFalse(c.IsHandleCreated, "A2");
            o = c.PublicDefaultCursor;
            Assert.IsFalse(c.IsHandleCreated, "A3");
            o = c.PublicDefaultImeMode;
            Assert.IsFalse(c.IsHandleCreated, "A4");
            o = c.PublicDefaultMargin;
            Assert.IsFalse(c.IsHandleCreated, "A5");
            o = c.PublicDefaultMaximumSize;
            Assert.IsFalse(c.IsHandleCreated, "A6");
            o = c.PublicDefaultMinimumSize;
            Assert.IsFalse(c.IsHandleCreated, "A7");
            o = c.PublicDefaultPadding;
            Assert.IsFalse(c.IsHandleCreated, "A8");
            o = c.PublicDefaultSize;
            Assert.IsFalse(c.IsHandleCreated, "A9");
            o = c.PublicDoubleBuffered;
            c.PublicDoubleBuffered = !c.PublicDoubleBuffered;
            Assert.IsFalse(c.IsHandleCreated, "A10");
            o = c.PublicFontHeight;
            c.PublicFontHeight = c.PublicFontHeight + 1;
            Assert.IsFalse(c.IsHandleCreated, "A11");
            o = c.PublicRenderRightToLeft;
            Assert.IsFalse(c.IsHandleCreated, "A12");
            o = c.PublicResizeRedraw;
            c.PublicResizeRedraw = !c.PublicResizeRedraw;
            Assert.IsFalse(c.IsHandleCreated, "A13");
#if !__MonoCS__
            o = c.PublicScaleChildren;
            Assert.IsFalse(c.IsHandleCreated, "A14");
#endif
            o = c.PublicShowFocusCues;
            Assert.IsFalse(c.IsHandleCreated, "A15");
            o = c.PublicShowKeyboardCues;
            Assert.IsFalse(c.IsHandleCreated, "A16");

            o = c.PublicAutoScaleFactor;
            Assert.IsFalse(c.IsHandleCreated, "F1");

            o = c.PublicDesignMode;
            Assert.IsFalse(c.IsHandleCreated, "F2");

            o = c.PublicEvents;
            Assert.IsFalse(c.IsHandleCreated, "F3");

            o = c.PublicHScroll;
            c.PublicHScroll = !c.PublicHScroll;
            Assert.IsFalse(c.IsHandleCreated, "F4");

            o = c.PublicMaximizedBounds;
            c.PublicMaximizedBounds = new Rectangle(1, 1, 1, 1);
            Assert.IsFalse(c.IsHandleCreated, "F5");

            o = c.PublicShowWithoutActivation;
            Assert.IsFalse(c.IsHandleCreated, "F6");

            o = c.PublicVScroll;
            c.PublicVScroll = !c.PublicVScroll;
            Assert.IsFalse(c.IsHandleCreated, "F7");


            TestHelper.RemoveWarning(o);
        }
Пример #2
0
		public void TestProtectedProperties ()
		{
			// Not a surprise, but none of these cause handle creation.
			// Included just to absolutely certain.
			ProtectedPropertyForm c = new ProtectedPropertyForm ();

			object o;
#if !MONO
			o = c.PublicCanRaiseEvents;
			Assert.IsFalse (c.IsHandleCreated, "A1");
#endif
			o = c.PublicCreateParams;
			Assert.IsFalse (c.IsHandleCreated, "A2");
			o = c.PublicDefaultCursor;
			Assert.IsFalse (c.IsHandleCreated, "A3");
			o = c.PublicDefaultImeMode;
			Assert.IsFalse (c.IsHandleCreated, "A4");
			o = c.PublicDefaultMargin;
			Assert.IsFalse (c.IsHandleCreated, "A5");
			o = c.PublicDefaultMaximumSize;
			Assert.IsFalse (c.IsHandleCreated, "A6");
			o = c.PublicDefaultMinimumSize;
			Assert.IsFalse (c.IsHandleCreated, "A7");
			o = c.PublicDefaultPadding;
			Assert.IsFalse (c.IsHandleCreated, "A8");
			o = c.PublicDefaultSize;
			Assert.IsFalse (c.IsHandleCreated, "A9");
			o = c.PublicDoubleBuffered;
			c.PublicDoubleBuffered = !c.PublicDoubleBuffered;
			Assert.IsFalse (c.IsHandleCreated, "A10");
			o = c.PublicFontHeight;
			c.PublicFontHeight = c.PublicFontHeight + 1;
			Assert.IsFalse (c.IsHandleCreated, "A11");
			o = c.PublicRenderRightToLeft;
			Assert.IsFalse (c.IsHandleCreated, "A12");
			o = c.PublicResizeRedraw;
			c.PublicResizeRedraw = !c.PublicResizeRedraw;
			Assert.IsFalse (c.IsHandleCreated, "A13");
#if !MONO
			o = c.PublicScaleChildren;
			Assert.IsFalse (c.IsHandleCreated, "A14");
#endif
			o = c.PublicShowFocusCues;
			Assert.IsFalse (c.IsHandleCreated, "A15");
			o = c.PublicShowKeyboardCues;
			Assert.IsFalse (c.IsHandleCreated, "A16");

			o = c.PublicAutoScaleFactor;
			Assert.IsFalse (c.IsHandleCreated, "F1"); 
			
			o = c.PublicDesignMode;
			Assert.IsFalse (c.IsHandleCreated, "F2");
			
			o = c.PublicEvents;
			Assert.IsFalse (c.IsHandleCreated, "F3");
			
			o = c.PublicHScroll;
			c.PublicHScroll = !c.PublicHScroll;
			Assert.IsFalse (c.IsHandleCreated, "F4");
			
			o = c.PublicMaximizedBounds;
			c.PublicMaximizedBounds = new Rectangle (1, 1, 1, 1);
			Assert.IsFalse (c.IsHandleCreated, "F5");

			o = c.PublicShowWithoutActivation;
			Assert.IsFalse (c.IsHandleCreated, "F6"); 
						
			o = c.PublicVScroll;
			c.PublicVScroll = !c.PublicVScroll;
			Assert.IsFalse (c.IsHandleCreated, "F7");
			

			TestHelper.RemoveWarning (o);
		}