Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs')
-rw-r--r--mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs102
1 files changed, 21 insertions, 81 deletions
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
index 25f04bca89c..32d3232c4bf 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
@@ -89,16 +89,14 @@ namespace MonoTests.System.Windows.Forms
o = c.Anchor;
c.Anchor = AnchorStyles.Right;
Assert.IsFalse (c.IsHandleCreated, "A6");
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
o = c.AutoScrollOffset;
c.AutoScrollOffset = new Point (40, 40);
Assert.IsFalse (c.IsHandleCreated, "A7");
#endif
-#if NET_2_0
o = c.AutoSize;
c.AutoSize = true;
Assert.IsFalse (c.IsHandleCreated, "A8");
-#endif
// A - Form
o = c.AcceptButton;
@@ -116,7 +114,6 @@ namespace MonoTests.System.Windows.Forms
c.AllowTransparency = !c.AllowTransparency;
Assert.IsFalse (c.IsHandleCreated, "FA4");
-#if NET_2_0
o = c.AutoScaleDimensions;
c.AutoScaleDimensions = SizeF.Empty;
Assert.IsFalse (c.IsHandleCreated, "FA5");
@@ -124,7 +121,6 @@ namespace MonoTests.System.Windows.Forms
o = c.AutoScaleMode;
c.AutoScaleMode = AutoScaleMode.Dpi;
Assert.IsFalse (c.IsHandleCreated, "FA6");
-#endif
o = c.AutoScroll;
c.AutoScroll = !c.AutoScroll;
Assert.IsFalse (c.IsHandleCreated, "FA7");
@@ -137,7 +133,7 @@ namespace MonoTests.System.Windows.Forms
c.AutoScrollMinSize = new Size (c.AutoScrollMinSize.Width + 1, c.AutoScrollMinSize.Height + 1);
Assert.IsFalse (c.IsHandleCreated, "FA9");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
o = c.AutoScrollOffset;
c.AutoScrollOffset = new Point (c.AutoScrollOffset.X + 1, c.AutoScrollOffset.Y + 1);
Assert.IsFalse (c.IsHandleCreated, "FA10");
@@ -146,7 +142,6 @@ namespace MonoTests.System.Windows.Forms
o = c.AutoScrollPosition;
c.AutoScrollPosition = new Point (c.AutoScrollPosition.X + 1, c.AutoScrollPosition.Y + 1);
Assert.IsFalse (c.IsHandleCreated, "FA11");
-#if NET_2_0
o = c.AutoSize;
c.AutoSize = !c.AutoSize;
@@ -160,7 +155,6 @@ namespace MonoTests.System.Windows.Forms
c.AutoValidate = AutoValidate.EnableAllowFocusChange;
Assert.IsFalse (c.IsHandleCreated, "FA14");
-#endif
// B
o = c.BackColor;
c.BackColor = Color.Green;
@@ -168,11 +162,9 @@ namespace MonoTests.System.Windows.Forms
o = c.BackgroundImage;
c.BackgroundImage = new Bitmap (1, 1);
Assert.IsFalse (c.IsHandleCreated, "A10");
-#if NET_2_0
o = c.BackgroundImageLayout;
c.BackgroundImageLayout = ImageLayout.Stretch;
Assert.IsFalse (c.IsHandleCreated, "A11");
-#endif
o = c.BindingContext;
c.BindingContext = new BindingContext ();
Assert.IsFalse (c.IsHandleCreated, "A12");
@@ -217,11 +209,9 @@ namespace MonoTests.System.Windows.Forms
o = c.ContextMenu;
c.ContextMenu = new ContextMenu ();
Assert.IsFalse (c.IsHandleCreated, "A24");
-#if NET_2_0
o = c.ContextMenuStrip;
c.ContextMenuStrip = new ContextMenuStrip ();
Assert.IsFalse (c.IsHandleCreated, "A25");
-#endif
o = c.Controls;
Assert.IsFalse (c.IsHandleCreated, "A26");
o = c.Created;
@@ -245,11 +235,9 @@ namespace MonoTests.System.Windows.Forms
o = c.ControlBox;
c.ControlBox = !c.ControlBox;
Assert.IsFalse (c.IsHandleCreated, "FC4");
-#if NET_2_0
o = c.CurrentAutoScaleDimensions;
Assert.IsFalse (c.IsHandleCreated, "FC5");
-#endif
// D
o = c.DataBindings;
@@ -323,7 +311,7 @@ namespace MonoTests.System.Windows.Forms
c.HelpButton = !c.HelpButton;
Assert.IsFalse (c.IsHandleCreated, "FH1");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
o = c.HorizontalScroll;
Assert.IsFalse (c.IsHandleCreated, "FH2");
#endif
@@ -336,14 +324,12 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "A42");
o = c.IsDisposed;
Assert.IsFalse (c.IsHandleCreated, "A43");
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
o = c.IsMirrored;
Assert.IsFalse (c.IsHandleCreated, "A44");
#endif
-#if NET_2_0
o = c.LayoutEngine;
Assert.IsFalse (c.IsHandleCreated, "A45");
-#endif
o = c.Left;
c.Left = 15;
Assert.IsFalse (c.IsHandleCreated, "A46");
@@ -377,7 +363,6 @@ namespace MonoTests.System.Windows.Forms
// M - N
-#if NET_2_0
o = c.Margin;
c.Margin = new Padding (6);
Assert.IsFalse (c.IsHandleCreated, "A48");
@@ -387,17 +372,14 @@ namespace MonoTests.System.Windows.Forms
o = c.MinimumSize;
c.MinimumSize = new Size (100, 100);
Assert.IsFalse (c.IsHandleCreated, "A50");
-#endif
o = c.Name;
c.Name = "web";
Assert.IsFalse (c.IsHandleCreated, "A51");
-#if NET_2_0
// M - O - Form
o = c.MainMenuStrip;
c.MainMenuStrip = null;
Assert.IsFalse (c.IsHandleCreated, "FM1");
-#endif
o = c.MaximizeBox;
c.MaximizeBox = !c.MaximizeBox;
@@ -444,11 +426,9 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "FO3");
// P - R
-#if NET_2_0
o = c.Padding;
c.Padding = new Padding (4);
Assert.IsFalse (c.IsHandleCreated, "A52");
-#endif
o = c.Parent;
c.TopLevel = false;
c.Parent = new Form ();
@@ -456,10 +436,8 @@ namespace MonoTests.System.Windows.Forms
c.Close ();
c = new Form ();
-#if NET_2_0
o = c.PreferredSize;
Assert.IsFalse (c.IsHandleCreated, "A54");
-#endif
o = c.ProductName;
Assert.IsFalse (c.IsHandleCreated, "A55");
o = c.ProductVersion;
@@ -479,7 +457,7 @@ namespace MonoTests.System.Windows.Forms
o = c.ParentForm;
Assert.IsFalse (c.IsHandleCreated, "FP1");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
o = c.RestoreBounds;
Assert.IsFalse (c.IsHandleCreated, "FR1");
#endif
@@ -505,7 +483,7 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "A66");
o = c.TopLevelControl;
Assert.IsFalse (c.IsHandleCreated, "A67");
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
o = c.UseWaitCursor;
c.UseWaitCursor = true;
Assert.IsFalse (c.IsHandleCreated, "A68");
@@ -526,11 +504,9 @@ namespace MonoTests.System.Windows.Forms
// S - W - Form
-#if NET_2_0
o = c.ShowIcon;
c.ShowIcon = !c.ShowIcon;
Assert.IsFalse (c.IsHandleCreated, "FS1");
-#endif
o = c.ShowInTaskbar;
c.ShowInTaskbar = !c.ShowInTaskbar;
@@ -568,7 +544,7 @@ namespace MonoTests.System.Windows.Forms
c.TransparencyKey = Color.BurlyWood;
Assert.IsFalse (c.IsHandleCreated, "FT4");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
o = c.VerticalScroll;
Assert.IsFalse (c.IsHandleCreated, "FV1");
#endif
@@ -589,19 +565,16 @@ namespace MonoTests.System.Windows.Forms
ProtectedPropertyForm c = new ProtectedPropertyForm ();
object o;
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
o = c.PublicCanRaiseEvents;
Assert.IsFalse (c.IsHandleCreated, "A1");
#endif
o = c.PublicCreateParams;
Assert.IsFalse (c.IsHandleCreated, "A2");
-#if NET_2_0
o = c.PublicDefaultCursor;
Assert.IsFalse (c.IsHandleCreated, "A3");
-#endif
o = c.PublicDefaultImeMode;
Assert.IsFalse (c.IsHandleCreated, "A4");
-#if NET_2_0
o = c.PublicDefaultMargin;
Assert.IsFalse (c.IsHandleCreated, "A5");
o = c.PublicDefaultMaximumSize;
@@ -615,7 +588,6 @@ namespace MonoTests.System.Windows.Forms
o = c.PublicDoubleBuffered;
c.PublicDoubleBuffered = !c.PublicDoubleBuffered;
Assert.IsFalse (c.IsHandleCreated, "A10");
-#endif
o = c.PublicFontHeight;
c.PublicFontHeight = c.PublicFontHeight + 1;
Assert.IsFalse (c.IsHandleCreated, "A11");
@@ -624,7 +596,7 @@ namespace MonoTests.System.Windows.Forms
o = c.PublicResizeRedraw;
c.PublicResizeRedraw = !c.PublicResizeRedraw;
Assert.IsFalse (c.IsHandleCreated, "A13");
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
o = c.PublicScaleChildren;
Assert.IsFalse (c.IsHandleCreated, "A14");
#endif
@@ -633,10 +605,8 @@ namespace MonoTests.System.Windows.Forms
o = c.PublicShowKeyboardCues;
Assert.IsFalse (c.IsHandleCreated, "A16");
-#if NET_2_0
o = c.PublicAutoScaleFactor;
Assert.IsFalse (c.IsHandleCreated, "F1");
-#endif
o = c.PublicDesignMode;
Assert.IsFalse (c.IsHandleCreated, "F2");
@@ -652,10 +622,8 @@ namespace MonoTests.System.Windows.Forms
c.PublicMaximizedBounds = new Rectangle (1, 1, 1, 1);
Assert.IsFalse (c.IsHandleCreated, "F5");
-#if NET_2_0
o = c.PublicShowWithoutActivation;
Assert.IsFalse (c.IsHandleCreated, "F6");
-#endif
o = c.PublicVScroll;
c.PublicVScroll = !c.PublicVScroll;
@@ -733,10 +701,8 @@ namespace MonoTests.System.Windows.Forms
c = new Form ();
c.GetNextControl (new Control (), true);
Assert.IsFalse (c.IsHandleCreated, "A12");
-#if NET_2_0
c.GetPreferredSize (Size.Empty);
Assert.IsFalse (c.IsHandleCreated, "A13");
-#endif
c.Hide ();
Assert.IsFalse (c.IsHandleCreated, "A14");
@@ -791,10 +757,8 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "A31");
c.ResumeLayout ();
Assert.IsFalse (c.IsHandleCreated, "A32");
-#if NET_2_0
c.Scale (new SizeF (1.5f, 1.5f));
Assert.IsFalse (c.IsHandleCreated, "A33");
-#endif
c.Select ();
Assert.IsTrue (c.IsHandleCreated, "A34");
c.Dispose ();
@@ -825,7 +789,7 @@ namespace MonoTests.System.Windows.Forms
c.LayoutMdi (MdiLayout.Cascade);
Assert.IsFalse (c.IsHandleCreated, "F5");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
c.PerformAutoScale ();
Assert.IsFalse (c.IsHandleCreated, "F6");
#endif
@@ -849,13 +813,11 @@ namespace MonoTests.System.Windows.Forms
c.SetDesktopLocation (7, 13);
Assert.IsFalse (c.IsHandleCreated, "F12");
-#if NET_2_0
c = new Form ();
c.Show (null);
Assert.IsTrue (c.IsHandleCreated, "F13");
c.Close ();
c = new Form ();
-#endif
//c.ShowDialog ()
@@ -865,7 +827,7 @@ namespace MonoTests.System.Windows.Forms
c.Validate ();
Assert.IsFalse (c.IsHandleCreated, "F15");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
c.ValidateChildren ();
Assert.IsFalse (c.IsHandleCreated, "F16");
#endif
@@ -902,42 +864,32 @@ namespace MonoTests.System.Windows.Forms
public class ProtectedPropertyForm : Form
{
-#if NET_2_0
public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } }
-#endif
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
#endif
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
-#if NET_2_0
public Cursor PublicDefaultCursor { get { return base.DefaultCursor; } }
-#endif
public ImeMode PublicDefaultImeMode { get { return base.DefaultImeMode; } }
-#if NET_2_0
public Padding PublicDefaultMargin { get { return base.DefaultMargin; } }
public Size PublicDefaultMaximumSize { get { return base.DefaultMaximumSize; } }
public Size PublicDefaultMinimumSize { get { return base.DefaultMinimumSize; } }
public Padding PublicDefaultPadding { get { return base.DefaultPadding; } }
public Size PublicDefaultSize { get { return base.DefaultSize; } }
-#endif
public bool PublicDesignMode { get {return base.DesignMode; } }
-#if NET_2_0
public bool PublicDoubleBuffered { get { return base.DoubleBuffered; } set { base.DoubleBuffered = value; } }
-#endif
public EventHandlerList PublicEvents { get {return base.Events; } }
public int PublicFontHeight { get { return base.FontHeight; } set { base.FontHeight = value; } }
public bool PublicHScroll { get {return base.HScroll; } set { base.HScroll = value;} }
public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
#endif
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
public bool PublicShowKeyboardCues { get { return base.ShowKeyboardCues; } }
-#if NET_2_0
public bool PublicShowWithoutActivation { get { return base.ShowWithoutActivation; } }
-#endif
public bool PublicVScroll { get { return base.VScroll; } set { base.VScroll = value; } }
}
@@ -955,11 +907,7 @@ namespace MonoTests.System.Windows.Forms
ProtectedMethodsForm c = new ProtectedMethodsForm ();
c.PublicAccessibilityNotifyClients (AccessibleEvents.Focus, 0);
-#if NET_2_0
Assert.IsFalse (c.IsHandleCreated, "A1");
-#else
- Assert.IsTrue (c.IsHandleCreated, "A1");
-#endif
c.PublicCreateAccessibilityInstance ();
Assert.IsTrue (c.IsHandleCreated, "A2");
c.Dispose ();
@@ -975,11 +923,9 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "A5");
c.Dispose ();
c = new ProtectedMethodsForm ();
-#if NET_2_0
c.PublicGetAccessibilityObjectById (0);
Assert.IsFalse (c.IsHandleCreated, "A6");
-#endif
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
c.PublicGetAutoSizeMode ();
Assert.IsFalse (c.IsHandleCreated, "A7");
c.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
@@ -1037,7 +983,7 @@ namespace MonoTests.System.Windows.Forms
Assert.IsFalse (c.IsHandleCreated, "A29");
c.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
Assert.IsFalse (c.IsHandleCreated, "A30");
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
c.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
Assert.IsFalse (c.IsHandleCreated, "A31");
#endif
@@ -1048,7 +994,7 @@ namespace MonoTests.System.Windows.Forms
c.Dispose ();
c = new ProtectedMethodsForm ();
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
c.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
Assert.IsFalse (c.IsHandleCreated, "A34");
#endif
@@ -1070,10 +1016,8 @@ namespace MonoTests.System.Windows.Forms
c.Dispose ();
c = new ProtectedMethodsForm ();
-#if NET_2_0
c.PublicSizeFromClientSize (new Size (160, 160));
Assert.IsFalse (c.IsHandleCreated, "A40");
-#endif
c.PublicUpdateBounds ();
Assert.IsFalse (c.IsHandleCreated, "A41");
c.PublicUpdateStyles ();
@@ -1137,7 +1081,7 @@ namespace MonoTests.System.Windows.Forms
c.PublicProcessTabKey (true);
Assert.IsFalse (c.IsHandleCreated, "F14");
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
c.Controls.Add (new Control ());
c.PublicScrollToControl (c.Controls [0]);
Assert.IsFalse (c.IsHandleCreated, "F15");
@@ -1174,10 +1118,8 @@ namespace MonoTests.System.Windows.Forms
public void PublicCreateControlsInstance () { base.CreateControlsInstance (); }
public void PublicCreateHandle () { base.CreateHandle (); }
public void PublicDestroyHandle () { base.DestroyHandle (); }
-#if NET_2_0
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
-#endif
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
#endif
@@ -1213,17 +1155,17 @@ namespace MonoTests.System.Windows.Forms
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
#endif
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
-#if NET_2_0 && !__MonoCS__
+#if !__MonoCS__
public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); }
#endif
public void PublicSelect () { base.Select (); }
public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }
-#if !__MonoCS__ && NET_2_0
+#if !__MonoCS__
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
#endif
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
@@ -1233,9 +1175,7 @@ namespace MonoTests.System.Windows.Forms
public void PublicSetStyle (ControlStyles flag, bool value) { base.SetStyle (flag, value); }
public void PublicSetTopLevel (bool value) { base.SetTopLevel (value); }
public void PublicSetVisibleCore (bool value) { base.SetVisibleCore (value); }
-#if NET_2_0
public Size PublicSizeFromClientSize (Size clientSize) { return base.SizeFromClientSize (clientSize); }
-#endif
public void PublicUpdateBounds () { base.UpdateBounds (); }
public void PublicUpdateDefaultButton (int bit, bool value) { base.UpdateDefaultButton (); }
public void PublicUpdateStyles () { base.UpdateStyles (); }