MWF: Remove #if NET_2_0 and #if ONLY_1_1 conditions (part 9).
authorThomas Goldstein <stifu@free.fr>
Tue, 18 Jan 2011 22:44:43 +0000 (23:44 +0100)
committerThomas Goldstein <stifu@free.fr>
Tue, 18 Jan 2011 23:09:06 +0000 (00:09 +0100)
30 files changed:
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextImageRelation.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeClearlooks.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThreadExceptionDialog.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Timer.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarAppearance.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButtonClickEventHandler.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButtonStyle.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarTextAlign.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripArrowRenderEventArgs.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripArrowRenderEventHandler.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripButton.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripComboBox.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripContainer.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripContentPanel.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripContentPanelRenderEventArgs.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripContentPanelRenderEventHandler.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripControlHost.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDown.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownButton.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownCloseReason.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownClosedEventArgs.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownClosedEventHandler.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownClosingEventArgs.cs

index 29a71515445ac2ebada9d28091b8507a7d941097..70c6028c1a9e841c1db3a11230d97b98c7c50649 100644 (file)
 
 namespace System.Windows.Forms
 {
-#if NET_2_0
-       public 
-#endif
-       enum TextImageRelation
+       public enum TextImageRelation
        {
                Overlay = 0,
                ImageAboveText = 1,
index f6134d5d0989925578d32879d4a812bdf3cfa4cc..3b21e391a293de272100e402a3615df12f5bda2b 100644 (file)
@@ -45,17 +45,13 @@ using System.Drawing.Text;
 
 namespace System.Windows.Forms
 {
-#if NET_2_0
-       public sealed 
-#endif
-       class TextRenderer
+       public sealed class TextRenderer
        {
                private TextRenderer ()
                {
                }
 
                #region Public Methods
-#if NET_2_0
                public static void DrawText (IDeviceContext dc, string text, Font font, Point pt, Color foreColor)
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, Color.Transparent, TextFormatFlags.Default, false);
@@ -70,31 +66,22 @@ namespace System.Windows.Forms
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, backColor, TextFormatFlags.Default, false);
                }
-#endif
 
-#if NET_2_0
-               public
-#else
-               internal
-#endif
-               static void DrawText (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, TextFormatFlags flags)
+               public static void DrawText (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, TextFormatFlags flags)
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, Color.Transparent, flags, false);
                }
 
-#if NET_2_0
                public static void DrawText (IDeviceContext dc, string text, Font font, Rectangle bounds, Color foreColor, Color backColor)
                {
                        DrawTextInternal (dc, text, font, bounds, foreColor, backColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, false);
                }
-#endif
 
                public static void DrawText (IDeviceContext dc, string text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)
                {
                        DrawTextInternal (dc, text, font, bounds, foreColor, Color.Transparent, flags, false);
                }
 
-#if NET_2_0
                public static void DrawText (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags)
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, backColor, flags, false);
@@ -104,19 +91,12 @@ namespace System.Windows.Forms
                {
                        DrawTextInternal (dc, text, font, bounds, foreColor, backColor, flags, false);
                }
-#endif
 
-#if NET_2_0
-               public
-#else
-               internal
-#endif
-               static Size MeasureText (string text, Font font)
+               public static Size MeasureText (string text, Font font)
                {
                        return MeasureTextInternal (Hwnd.GraphicsContext, text, font, Size.Empty, TextFormatFlags.Default, false);
                }
 
-#if NET_2_0
                public static Size MeasureText (IDeviceContext dc, string text, Font font)
                {
                        return MeasureTextInternal (dc, text, font, Size.Empty, TextFormatFlags.Default, false);
@@ -141,15 +121,10 @@ namespace System.Windows.Forms
                {
                        return MeasureTextInternal (dc, text, font, proposedSize, flags, false);
                }
-#endif
                #endregion
 
                #region Internal Methods That Do Stuff
-#if NET_2_0
                internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Rectangle bounds, Color foreColor, Color backColor, TextFormatFlags flags, bool useDrawString)
-#else
-               internal static void DrawTextInternal (Graphics dc, string text, Font font, Rectangle bounds, Color foreColor, Color backColor, TextFormatFlags flags, bool useDrawString)
-#endif
                {
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
@@ -217,11 +192,7 @@ namespace System.Windows.Forms
                                if (clear_clip_region)
                                        SelectClipRgn (hdc, IntPtr.Zero);
 
-#if NET_2_0
                                dc.ReleaseHdc ();
-#else
-                               dc.ReleaseHdc (hdc);
-#endif
                        }
                        // Use Graphics.DrawString as a fallback method
                        else {
@@ -243,20 +214,12 @@ namespace System.Windows.Forms
 
                                if (!(dc is Graphics)) {
                                        g.Dispose ();
-#if NET_2_0
                                        dc.ReleaseHdc ();
-#else
-                                       if (hdc != IntPtr.Zero) dc.ReleaseHdc (hdc);
-#endif
                                }
                        }
                }
 
-#if NET_2_0
                internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, Size proposedSize, TextFormatFlags flags, bool useMeasureString)
-#else
-               internal static Size MeasureTextInternal (Graphics dc, string text, Font font, Size proposedSize, TextFormatFlags flags, bool useMeasureString)
-#endif
                {
                        if (!useMeasureString && !XplatUI.RunningOnUnix) {
                                // Tell DrawText to calculate size instead of draw
@@ -278,11 +241,7 @@ namespace System.Windows.Forms
                                        Win32DrawText (hdc, text, text.Length, ref r, (int)flags);
                                }
 
-#if NET_2_0
                                dc.ReleaseHdc ();
-#else
-                               dc.ReleaseHdc (hdc);
-#endif
 
                                // Really, I am just making something up here, which as far as I can tell, MS
                                // just makes something up as well.  This will require lots of tweaking to match MS.  :(
@@ -314,7 +273,6 @@ namespace System.Windows.Forms
                #endregion
 
 #region Internal Methods That Are Just Overloads
-#if NET_2_0
                internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, bool useDrawString)
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, Color.Transparent, TextFormatFlags.Default, useDrawString);
@@ -341,9 +299,6 @@ namespace System.Windows.Forms
                }
 
                internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags, bool useDrawString)
-#else
-               internal static void DrawTextInternal (Graphics dc, string text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags, bool useDrawString)
-#endif
                {
                        DrawTextInternal (dc, text, font, bounds, foreColor, Color.Transparent, flags, useDrawString);
                }
@@ -364,7 +319,6 @@ namespace System.Windows.Forms
                        return MeasureTextInternal (dc, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString);
                }
 
-#if NET_2_0
                internal static Size MeasureTextInternal (string text, Font font, Size proposedSize, bool useMeasureString)
                {
                        return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, TextFormatFlags.Default, useMeasureString);
@@ -375,7 +329,6 @@ namespace System.Windows.Forms
                        return MeasureTextInternal (dc, text, font, proposedSize, TextFormatFlags.Default, useMeasureString);
                }
 
-#endif
                internal static Size MeasureTextInternal (string text, Font font, Size proposedSize, TextFormatFlags flags, bool useMeasureString)
                {
                        return MeasureTextInternal (Hwnd.GraphicsContext, text, font, proposedSize, flags, useMeasureString);
index 1a68cc083128ba4d0264f43c5bbb90a9a20077af..380d11e8e0d810dc638c1ccb7890023d8abe4a4a 100644 (file)
@@ -196,11 +196,7 @@ namespace System.Windows.Forms
 
                protected Theme ()
                {
-#if NET_2_0
                        default_font = SystemFonts.DefaultFont;
-#else
-                       default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
-#endif
                        syscolors = null;
                }
 
@@ -706,9 +702,7 @@ namespace System.Windows.Forms
                #endregion      // OwnerDraw Support
 
                #region Button
-#if NET_2_0
                public abstract Size CalculateButtonAutoSize (Button button);
-#endif
                public abstract void CalculateButtonTextAndImageLayout (ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
                public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
                public abstract void DrawFlatButton (Graphics g, ButtonBase b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
@@ -724,11 +718,9 @@ namespace System.Windows.Forms
                #endregion      // ButtonBase
 
                #region CheckBox
-#if NET_2_0
                public abstract Size CalculateCheckBoxAutoSize (CheckBox checkBox);
                public abstract void CalculateCheckBoxTextAndImageLayout (ButtonBase b, Point offset, out Rectangle glyphArea, out Rectangle textRectangle, out Rectangle imageRectangle);
                public abstract void DrawCheckBox (Graphics g, CheckBox cb, Rectangle glyphArea, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
-#endif
                public abstract void DrawCheckBox (Graphics dc, Rectangle clip_area, CheckBox checkbox);
 
                #endregion      // CheckBox
@@ -790,7 +782,6 @@ namespace System.Windows.Forms
                
                #endregion // Datagrid
 
-#if NET_2_0
                #region DataGridView
                #region DataGridViewHeaderCell
                #region DataGridViewRowHeaderCell
@@ -806,7 +797,6 @@ namespace System.Windows.Forms
                public abstract bool DataGridViewHeaderCellHasHotStyle (DataGridView dataGridView);
                #endregion
                #endregion
-#endif
 
                #region DateTimePicker
                public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
@@ -897,11 +887,9 @@ namespace System.Windows.Forms
 
                #region RadioButton
                // Drawing
-#if NET_2_0
                public abstract Size CalculateRadioButtonAutoSize (RadioButton rb);
                public abstract void CalculateRadioButtonTextAndImageLayout (ButtonBase b, Point offset, out Rectangle glyphArea, out Rectangle textRectangle, out Rectangle imageRectangle);
                public abstract void DrawRadioButton (Graphics g, RadioButton rb, Rectangle glyphArea, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
-#endif
                public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
 
                // Sizing
@@ -981,12 +969,10 @@ namespace System.Windows.Forms
                #endregion      // ToolTip
                
                #region BalloonWindow
-#if NET_2_0
                public abstract void ShowBalloonWindow (IntPtr handle, int timeout, string title, string text, ToolTipIcon icon);
                public abstract void HideBalloonWindow (IntPtr handle);
                public abstract void DrawBalloonWindow (Graphics dc, Rectangle clip, NotifyIcon.BalloonWindow control);
                public abstract Rectangle BalloonWindowRect (NotifyIcon.BalloonWindow control);
-#endif
                #endregion      // BalloonWindow
 
                #region TrackBar
@@ -1064,10 +1050,8 @@ namespace System.Windows.Forms
                public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
                public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
                        StringFormat format);
-#if NET_2_0
                public abstract void CPDrawStringDisabled (IDeviceContext dc, string s, Font font, Color color, Rectangle layoutRectangle, TextFormatFlags format);
                public abstract void CPDrawVisualStyleBorder (Graphics graphics, Rectangle bounds);
-#endif
                public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
                #endregion      // ControlPaint Methods
        }
index 643faf96ea71a78e3544ff4c26c1050075e9446a..c6004bd37506c1e06ca1db8ad95fbc2b41e2d0b9 100644 (file)
@@ -162,9 +162,8 @@ namespace System.Windows.Forms {
                }
                
                static readonly Color info_border_color = Color.FromArgb (218, 178, 85);
-#if NET_2_0
                static readonly Color info_second_color = Color.FromArgb (220, 220, 160);
-#endif 
+
                public override Image Images(UIIcon index, int size) {
                        switch (index) {
                        case UIIcon.PlacesRecentDocuments:
@@ -3171,7 +3170,6 @@ namespace System.Windows.Forms {
                #endregion      // ToolTip
 
                #region BalloonWindow
-#if NET_2_0
                NotifyIcon.BalloonWindow balloon_window;
                
                public override void ShowBalloonWindow (IntPtr handle, int timeout, string title, string text, ToolTipIcon icon)
@@ -3274,7 +3272,6 @@ namespace System.Windows.Forms {
                        
                        return rect;
                }
-#endif
                #endregion      // BalloonWindow
                
        } //class
index 4e43c1cdcb52b45baec033f9906a2e7dbff927ba..3e087ef5ac6bb9ecad20206ee909ee8c405743e3 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Windows.Forms
                        return PushButtonState.Normal;
                }
                #endregion
-#if NET_2_0
+
                #region Button 2.0
                public override void DrawButtonBackground (Graphics g, Button button, Rectangle clipArea)
                {
@@ -115,7 +115,7 @@ namespace System.Windows.Forms
                        ButtonRenderer.GetPushButtonRenderer (GetPushButtonState (button)).DrawBackground (g, new Rectangle (Point.Empty, button.Size));
                }
                #endregion
-#endif
+
                #region CheckBox
                protected override void CheckBox_DrawCheckBox (Graphics dc, CheckBox checkbox, ButtonState state, Rectangle checkbox_rectangle)
                {
@@ -196,26 +196,22 @@ namespace System.Windows.Forms
                {
                        if (!RenderClientAreas)
                                return base.ComboBoxDropDownButtonHasHotElementStyle (comboBox);
-#if NET_2_0
                        switch (comboBox.FlatStyle) {
                        case FlatStyle.Flat:
                        case FlatStyle.Popup:
                                return base.ComboBoxDropDownButtonHasHotElementStyle (comboBox);
                        }
-#endif
                        return true;
                }
                static bool ComboBoxShouldPaintBackground (ComboBox comboBox)
                {
                        if (comboBox.DropDownStyle == ComboBoxStyle.Simple)
                                return false;
-#if NET_2_0
                        switch (comboBox.FlatStyle) {
                        case FlatStyle.Flat:
                        case FlatStyle.Popup:
                                return false;
                        }
-#endif 
                        return true;
                }
                public override void ComboBoxDrawBackground (ComboBox comboBox, Graphics g, Rectangle clippingArea, FlatStyle style)
@@ -502,7 +498,7 @@ namespace System.Windows.Forms
                }
                #endregion
                #endregion
-#if NET_2_0
+
                #region DataGridView
                #region DataGridViewHeaderCell
                #region DataGridViewRowHeaderCell
@@ -608,7 +604,7 @@ namespace System.Windows.Forms
                }
                #endregion
                #endregion
-#endif
+
                #region DateTimePicker
                #region Border
                protected override void DateTimePickerDrawBorder (DateTimePicker dateTimePicker, Graphics g, Rectangle clippingArea)
@@ -1142,11 +1138,8 @@ namespace System.Windows.Forms
                        int draw_mode = 0;
                        int max_blocks = int.MaxValue;
                        int start_pixel = client_area.X;
-#if NET_2_0
                        draw_mode = (int)ctrl.Style;
-#endif
                        switch (draw_mode) {
-#if NET_2_0
                        case 1: // Continuous
                                client_area.Width = (int)(client_area.Width * ((double)(ctrl.Value - ctrl.Minimum) / (double)(Math.Max (ctrl.Maximum - ctrl.Minimum, 1))));
                                renderer.DrawBackground (dc, client_area, clip_rect);
@@ -1158,7 +1151,6 @@ namespace System.Windows.Forms
                                max_blocks = 5;
                                start_pixel = client_area.X + (int)(client_area.Width * percent_done);
                                goto default;
-#endif
                        default: // Blocks
                                int block_width = renderer.GetInteger (IntegerProperty.ProgressChunkSize);
                                block_width = Math.Max (block_width, 0); // block_width is used to break out the loop below, it must be >= 0!
@@ -2143,7 +2135,6 @@ namespace System.Windows.Forms
                #endregion
                #endregion
 
-#if NET_2_0
                static bool AreEqual (VisualStyleElement value1, VisualStyleElement value2)
                {
                        return
@@ -2151,7 +2142,7 @@ namespace System.Windows.Forms
                                value1.Part == value2.Part &&
                                value1.State == value2.State;
                }
-#endif
+
                #region Measurement device context
                static Control control;
                static IDeviceContext GetMeasurementDeviceContext ()
index 7ea2d03b0c6ee1df5ec08b23711e24c9e7f0fec5..1ce07bf75e2ac1579b1c3938acaad03792c926fa 100644 (file)
@@ -320,7 +320,6 @@ namespace System.Windows.Forms
                #endregion
 
                #region Button Layout Calculations
-#if NET_2_0
                public override Size CalculateButtonAutoSize (Button button)
                {
                        Size ret_size = Size.Empty;
@@ -356,7 +355,6 @@ namespace System.Windows.Forms
                        
                        return ret_size;
                }
-#endif
 
                public override void CalculateButtonTextAndImageLayout (ButtonBase button, out Rectangle textRectangle, out Rectangle imageRectangle)
                {
@@ -888,7 +886,6 @@ namespace System.Windows.Forms
                #endregion      // ButtonBase
 
                #region CheckBox
-#if NET_2_0
                public override void DrawCheckBox (Graphics g, CheckBox cb, Rectangle glyphArea, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle)
                {
                        // Draw Button Background
@@ -1146,7 +1143,6 @@ namespace System.Windows.Forms
                                
                        return ret_size;
                }
-#endif
 
                public override void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox) {
                        StringFormat            text_format;
@@ -2304,7 +2300,6 @@ namespace System.Windows.Forms
                
                #endregion // Datagrid
 
-#if NET_2_0
                #region DataGridView
                #region DataGridViewHeaderCell
                #region DataGridViewRowHeaderCell
@@ -2347,7 +2342,6 @@ namespace System.Windows.Forms
                }
                #endregion
                #endregion
-#endif
 
                #region DateTimePicker
                protected virtual void DateTimePickerDrawBorder (DateTimePicker dateTimePicker, Graphics g, Rectangle clippingArea)
@@ -2647,20 +2641,16 @@ namespace System.Windows.Forms
                        int first = control.FirstVisibleIndex;  
                        int lastvisibleindex = control.LastVisibleIndex;
 
-#if NET_2_0
                        if (control.VirtualMode)
                                control.OnCacheVirtualItems (new CacheVirtualItemsEventArgs (first, lastvisibleindex));
-#endif
 
                        for (int i = first; i <= lastvisibleindex; i++) {                                       
                                ListViewItem item = control.GetItemAtDisplayIndex (i);
                                if (clip.IntersectsWith (item.Bounds)) {
-#if NET_2_0
                                        bool owner_draw = false;
                                        if (control.OwnerDraw)
                                                owner_draw = DrawListViewItemOwnerDraw (dc, item, i);
                                        if (!owner_draw)
-#endif
                                        {
                                                DrawListViewItem (dc, control, item);
                                                if (control.View == View.Details)
@@ -2669,7 +2659,6 @@ namespace System.Windows.Forms
                                }
                        }       
 
-#if NET_2_0
                        if (control.UsingGroups) {
                                // Use InternalCount instead of Count to take into account Default Group as needed
                                for (int i = 0; i < control.Groups.InternalCount; i++) {
@@ -2690,14 +2679,9 @@ namespace System.Windows.Forms
                                dc.FillPolygon (brush, insertion_mark.TopTriangle);
                                dc.FillPolygon (brush, insertion_mark.BottomTriangle);
                        }
-#endif
                        
                        // draw the gridlines
-#if NET_2_0
                        if (details && control.GridLines && !control.UsingGroups) {
-#else
-                       if (details && control.GridLines) {
-#endif
                                Size control_size = control.ClientSize;
                                int top = (control.HeaderStyle == ColumnHeaderStyle.None) ?
                                        0 : control.header_control.Height;
@@ -2751,13 +2735,11 @@ namespace System.Windows.Forms
                                                Rectangle rect = col.Rect;
                                                rect.X -= control.h_marker;
 
-#if NET_2_0
                                                bool owner_draw = false;
                                                if (control.OwnerDraw)
                                                        owner_draw = DrawListViewColumnHeaderOwnerDraw (dc, control, col, rect);
                                                if (owner_draw)
                                                        continue;
-#endif
 
                                                ListViewDrawColumnHeaderBackground (control, col, dc, rect, clip);
                                                rect.X += 5;
@@ -2765,7 +2747,6 @@ namespace System.Windows.Forms
                                                if (rect.Width <= 0)
                                                        continue;
 
-#if NET_2_0
                                                int image_index;
                                                if (control.SmallImageList == null)
                                                        image_index = -1;
@@ -2796,7 +2777,6 @@ namespace System.Windows.Forms
                                                        rect.X += image_width;
                                                        rect.Width -= image_width;
                                                }
-#endif
 
                                                dc.DrawString (col.Text, control.Font, SystemBrushes.ControlText, rect, col.Format);
                                        }
@@ -2846,7 +2826,6 @@ namespace System.Windows.Forms
                        dc.DrawLine (ResPool.GetSizedPen (ColorHighlight, 2), target_x, 0, target_x, col.Rect.Height);
                }
 
-#if NET_2_0
                protected virtual bool DrawListViewColumnHeaderOwnerDraw (Graphics dc, ListView control, ColumnHeader column, Rectangle bounds)
                {
                        ListViewItemStates state = ListViewItemStates.ShowKeyboardCues;
@@ -2891,7 +2870,6 @@ namespace System.Windows.Forms
                        
                        return true;
                }
-#endif
 
                protected virtual void DrawListViewItem (Graphics dc, ListView control, ListViewItem item)
                {                               
@@ -2900,12 +2878,8 @@ namespace System.Windows.Forms
                        Rectangle full_rect = item.GetBounds (ItemBoundsPortion.Entire);
                        Rectangle text_rect = item.GetBounds (ItemBoundsPortion.Label);                 
 
-#if NET_2_0
                        // Tile view doesn't support CheckBoxes
                        if (control.CheckBoxes && control.View != View.Tile) {
-#else
-                       if (control.CheckBoxes) {
-#endif
                                if (control.StateImageList == null) {
                                        // Make sure we've got at least a line width of 1
                                        int check_wd = Math.Max (3, rect_checkrect.Width / 6);
@@ -2946,11 +2920,7 @@ namespace System.Windows.Forms
                                else {
                                        int simage_idx;
                                        if (item.Checked)
-#if NET_2_0
                                                simage_idx = control.StateImageList.Images.Count > 1 ? 1 : -1;
-#else
-                                               simage_idx = control.StateImageList.Images.Count > 1 ? 1 : 0;
-#endif
                                        else
                                                simage_idx = control.StateImageList.Images.Count > 0 ? 0 : -1;
 
@@ -2959,19 +2929,13 @@ namespace System.Windows.Forms
                                }
                        }
 
-                       ImageList image_list = control.View == View.LargeIcon 
-#if NET_2_0
-                               || control.View == View.Tile
-#endif
-                               ? control.LargeImageList : control.SmallImageList;
+                       ImageList image_list = control.View == View.LargeIcon || control.View == View.Tile ? control.LargeImageList : control.SmallImageList;
                        if (image_list != null) {
                                int idx;
 
-#if NET_2_0
                                if (item.ImageKey != String.Empty)
                                        idx = image_list.Images.IndexOfKey (item.ImageKey);
                                else
-#endif
                                        idx = item.ImageIndex;
 
                                if (idx > -1 && idx < image_list.Images.Count)
@@ -2990,21 +2954,12 @@ namespace System.Windows.Forms
                        else
                                format.Alignment = StringAlignment.Near;
                        
-#if NET_2_0
                        if (control.LabelWrap && control.View != View.Details && control.View != View.Tile)
-#else
-                       if (control.LabelWrap && control.View != View.Details)
-#endif
                                format.FormatFlags = StringFormatFlags.LineLimit;
                        else
                                format.FormatFlags = StringFormatFlags.NoWrap;
 
-                       if ((control.View == View.LargeIcon && !item.Focused)
-                                       || control.View == View.Details 
-#if NET_2_0
-                                       || control.View == View.Tile
-#endif
-                          )
+                       if ((control.View == View.LargeIcon && !item.Focused) || control.View == View.Details || control.View == View.Tile)
                                format.Trimming = StringTrimming.EllipsisCharacter;
 
                        Rectangle highlight_rect = text_rect;
@@ -3027,7 +2982,6 @@ namespace System.Windows.Forms
                                (item.Selected && control.Focused) ? SystemBrushes.HighlightText :
                                this.ResPool.GetSolidBrush (item.ForeColor);
 
-#if NET_2_0
                        // Tile view renders its Text in a different fashion
                        if (control.View == View.Tile && Application.VisualStylesEnabled) {
                                // Item.Text is drawn using its first subitem's bounds
@@ -3044,14 +2998,12 @@ namespace System.Windows.Forms
                                        dc.DrawString (sub_item.Text, sub_item.Font, itemBrush, sub_item.Bounds, format);
                                }
                        } else
-#endif
                        
                        if (item.Text != null && item.Text.Length > 0) {
                                Font font = item.Font;
-#if NET_2_0
+
                                if (control.HotTracking && item.Hot)
                                        font = item.HotFont;
-#endif
 
                                if (item.Selected && control.Focused)
                                        dc.DrawString (item.Text, font, textBrush, highlight_rect, format);
@@ -3121,12 +3073,11 @@ namespace System.Windows.Forms
                        if (item.UseItemStyleForSubItems) {
                                sub_item_back_br = ResPool.GetSolidBrush (item.BackColor);
                                sub_item_fore_br = ResPool.GetSolidBrush (item.ForeColor);
-#if NET_2_0
+
                                // Hot tracking for subitems only applies when UseStyle is true
                                if (control.HotTracking && item.Hot)
                                        sub_item_font = item.HotFont;
                                else
-#endif
                                        sub_item_font = item.Font;
                        } else {
                                sub_item_back_br = ResPool.GetSolidBrush (subItem.BackColor);
@@ -3160,7 +3111,6 @@ namespace System.Windows.Forms
                        format.Dispose ();
                }
 
-#if NET_2_0
                protected virtual bool DrawListViewSubItemOwnerDraw (Graphics dc, ListViewItem item, ListViewItemStates state, int index)
                {
                        ListView control = item.ListView;
@@ -3209,7 +3159,6 @@ namespace System.Windows.Forms
                        pen.Dispose ();
                        brush.Dispose ();
                }
-#endif
 
                public override bool ListViewHasHotHeaderStyle {
                        get {
@@ -4133,9 +4082,7 @@ namespace System.Windows.Forms
                public override void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb) {
                        Rectangle client = pb.ClientRectangle;
 
-#if NET_2_0
                        client = new Rectangle (client.Left + pb.Padding.Left, client.Top + pb.Padding.Top, client.Width - pb.Padding.Horizontal, client.Height - pb.Padding.Vertical);
-#endif
 
                        // FIXME - instead of drawing the whole picturebox every time
                        // intersect the clip rectangle with the drawn picture and only draw what's needed,
@@ -4149,7 +4096,7 @@ namespace System.Windows.Forms
                                case PictureBoxSizeMode.CenterImage:
                                        dc.DrawImage (pb.Image, (client.Width / 2) - (pb.Image.Width / 2), (client.Height / 2) - (pb.Image.Height / 2));
                                        break;
-#if NET_2_0
+
                                case PictureBoxSizeMode.Zoom:
                                        Size image_size;
                                        
@@ -4160,7 +4107,7 @@ namespace System.Windows.Forms
 
                                        dc.DrawImage (pb.Image, (client.Width / 2) - (image_size.Width / 2), (client.Height / 2) - (image_size.Height / 2), image_size.Width, image_size.Height);
                                        break;
-#endif
+
                                default:
                                        // Normal, AutoSize
                                        dc.DrawImage (pb.Image, client.Left, client.Top, pb.Image.Width, pb.Image.Height);
@@ -4273,11 +4220,9 @@ namespace System.Windows.Forms
                        int draw_mode = 0;
                        int max_blocks = int.MaxValue;
                        int start_pixel = client_area.X;
-#if NET_2_0
                        draw_mode = (int) ctrl.Style;
-#endif
+
                        switch (draw_mode) {
-#if NET_2_0
                        case 1: { // Continuous
                                int pixels_to_draw;
                                pixels_to_draw = (int)(client_area.Width * ((double)(ctrl.Value - ctrl.Minimum) / (double)(Math.Max(ctrl.Maximum - ctrl.Minimum, 1))));
@@ -4294,7 +4239,6 @@ namespace System.Windows.Forms
                                }
                                
                                goto case 0;
-#endif
                        case 0:
                        default:  // Blocks
                                Rectangle block_rect;
@@ -4649,7 +4593,6 @@ namespace System.Windows.Forms
                        }
                }
 
-#if NET_2_0
                public override void DrawRadioButton (Graphics g, RadioButton rb, Rectangle glyphArea, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle)
                {
                        // Draw Button Background
@@ -4751,7 +4694,6 @@ namespace System.Windows.Forms
                {
                        CalculateCheckBoxTextAndImageLayout (b, offset, out glyphArea, out textRectangle, out imageRectangle);
                }
-#endif
                #endregion      // RadioButton
 
                #region ScrollBar
@@ -5157,40 +5099,17 @@ namespace System.Windows.Forms
                                format.Alignment = StringAlignment.Center;
                        else
                                format.Alignment = StringAlignment.Near;
-#if !NET_2_0
-                       if (control is PropertyGrid.PropertyToolBar) {
-                               dc.FillRectangle (ResPool.GetSolidBrush(control.BackColor), clip_rectangle);
-                               
-                               if (clip_rectangle.X == 0) {
-                                       dc.DrawLine (SystemPens.ControlLightLight, clip_rectangle.X, 1, clip_rectangle.X, control.Bottom);
-                               }
-
-                               if (clip_rectangle.Y < 2) {
-                                       dc.DrawLine (SystemPens.ControlLightLight, clip_rectangle.X, 1, clip_rectangle.Right, 1);
-                               }
 
-                               if (clip_rectangle.Bottom == control.Bottom) {
-                                       dc.DrawLine (SystemPens.ControlDark, clip_rectangle.X, clip_rectangle.Bottom - 1, clip_rectangle.Right, clip_rectangle.Bottom - 1);
-                               }
-
-                               if (clip_rectangle.Right == control.Right) {
-                                       dc.DrawLine (SystemPens.ControlDark, clip_rectangle.Right - 1, 1, clip_rectangle.Right - 1, control.Bottom - 1);
-                               }
-                       } else {
-#endif
-                               if (control.Appearance != ToolBarAppearance.Flat || control.Parent == null) {
-                                       dc.FillRectangle (SystemBrushes.Control, clip_rectangle);
-                               }
+                       if (control.Appearance != ToolBarAppearance.Flat || control.Parent == null) {
+                               dc.FillRectangle (SystemBrushes.Control, clip_rectangle);
+                       }
 
-                               if (control.Divider && clip_rectangle.Y < 2) {
-                                       if (clip_rectangle.Y < 1) {
-                                               dc.DrawLine (SystemPens.ControlDark, clip_rectangle.X, 0, clip_rectangle.Right, 0);
-                                       }
-                                       dc.DrawLine (SystemPens.ControlLightLight, clip_rectangle.X, 1, clip_rectangle.Right, 1);
+                       if (control.Divider && clip_rectangle.Y < 2) {
+                               if (clip_rectangle.Y < 1) {
+                                       dc.DrawLine (SystemPens.ControlDark, clip_rectangle.X, 0, clip_rectangle.Right, 0);
                                }
-#if !NET_2_0
+                               dc.DrawLine (SystemPens.ControlLightLight, clip_rectangle.X, 1, clip_rectangle.Right, 1);
                        }
-#endif
 
                        foreach (ToolBarItem item in control.items)
                                if (item.Button.Visible && clip_rectangle.IntersectsWith (item.Rectangle))
@@ -5413,7 +5332,7 @@ namespace System.Windows.Forms
                        ToolTipDrawBackground (dc, clip_rectangle, control);
 
                        TextFormatFlags flags = TextFormatFlags.HidePrefix;
-#if NET_2_0
+
                        Color foreground = control.ForeColor;
                        if (control.title.Length > 0) {
                                Font bold_font = new Font (control.Font, control.Font.Style | FontStyle.Bold);
@@ -5424,20 +5343,13 @@ namespace System.Windows.Forms
 
                        if (control.icon != null)
                                dc.DrawIcon (control.icon, control.icon_rect);
-#else
-                       Color foreground = this.ColorInfoText;
-#endif
 
                        TextRenderer.DrawTextInternal (dc, control.Text, control.Font, control.text_rect, foreground, flags, false);
                }
 
                protected virtual void ToolTipDrawBackground (Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control)
                {
-#if NET_2_0
-                       Brush back_brush = ResPool.GetSolidBrush (control.BackColor);;
-#else
-                       Brush back_brush = SystemBrushes.Info;
-#endif
+                       Brush back_brush = ResPool.GetSolidBrush (control.BackColor);
                        dc.FillRectangle (back_brush, control.ClientRectangle);
                        dc.DrawRectangle (SystemPens.WindowFrame, 0, 0, control.Width - 1, control.Height - 1);
                }
@@ -5450,7 +5362,6 @@ namespace System.Windows.Forms
                        Rectangle text_rect = new Rectangle (Point.Empty, size);
                        text_rect.Inflate (-2, -1);
                        tt.text_rect = text_rect;
-#if NET_2_0
                        tt.icon_rect = tt.title_rect = Rectangle.Empty;
 
                        Size title_size = Size.Empty;
@@ -5496,7 +5407,6 @@ namespace System.Windows.Forms
                                size.Width += padding * 2;
                                size.Height += padding * 2;
                        }
-#endif
 
                        return size;
                }
@@ -5509,7 +5419,6 @@ namespace System.Windows.Forms
                #endregion      // ToolTip
 
                #region BalloonWindow
-#if NET_2_0
                NotifyIcon.BalloonWindow balloon_window;
                
                public override void ShowBalloonWindow (IntPtr handle, int timeout, string title, string text, ToolTipIcon icon)
@@ -5621,7 +5530,6 @@ namespace System.Windows.Forms
                        
                        return rect;
                }
-#endif
                #endregion      // BalloonWindow
 
                #region TrackBar
@@ -7508,7 +7416,6 @@ namespace System.Windows.Forms
                        dc.DrawString (s, font, ResPool.GetSolidBrush (cpcolor.Dark), layoutRectangle, format);
                }
 
-#if NET_2_0
                public override void CPDrawStringDisabled (IDeviceContext dc, string s, Font font, Color color, Rectangle layoutRectangle, TextFormatFlags format)
                {
                        CPColor cpcolor = ResPool.GetCPColor (color);
@@ -7524,7 +7431,6 @@ namespace System.Windows.Forms
                {
                        graphics.DrawRectangle (SystemPens.ControlDarkDark, bounds);
                }
-#endif
 
                private static void DrawBorderInternal (Graphics graphics, int startX, int startY, int endX, int endY,
                        int width, Color color, ButtonBorderStyle style, Border3DSide side) 
index 92f7a28a7c27fcfde83c60a87bbdf482abf3c0c5..0938d139a7f194c773e6c824c07d123822fc1b51 100644 (file)
@@ -36,10 +36,8 @@ using System.Runtime.InteropServices;
 
 namespace System.Windows.Forms
 {
-#if NET_2_0
        [ComVisible (true)]
        [ClassInterface (ClassInterfaceType.AutoDispatch)]
-#endif
        public class ThreadExceptionDialog: Form
        {
                Exception e;
@@ -217,7 +215,6 @@ namespace System.Windows.Forms
                        g.DrawIcon (SystemIcons.Error, 15, 10);
                }
 
-#if NET_2_0
                [Browsable (false)]
                [EditorBrowsable (EditorBrowsableState.Never)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -232,6 +229,5 @@ namespace System.Windows.Forms
                        add { base.AutoSizeChanged += value; }
                        remove { base.AutoSizeChanged -= value; }
                }
-#endif
        }
 }
index f5839a5c9997daae00405ea4fcb28d2482b35efb..fba7983fbb07f9b4d9c9ad77018b8bed94712ae9 100644 (file)
@@ -39,10 +39,8 @@ namespace System.Windows.Forms {
                internal Thread thread;
                internal bool Busy;
                internal IntPtr window;
-
-#if NET_2_0
                object control_tag;
-#endif
+
                internal static readonly int Minimum = 15;
 
                public Timer ()
@@ -84,11 +82,7 @@ namespace System.Windows.Forms {
                        }
                        set {
                                if (value <= 0)
-#if NET_2_0
                                        throw new ArgumentOutOfRangeException ("Interval", string.Format ("'{0}' is not a valid value for Interval. Interval must be greater than 0.", value));
-#else                          
-                                       throw new ArgumentException (string.Format("'{0}' is not a valid value for Interval. Interval must be greater than 0.", value));
-#endif                                 
 
                                if (interval == value) {
                                        return;
@@ -106,7 +100,6 @@ namespace System.Windows.Forms {
                        }
                }
                
-#if NET_2_0
                [Localizable(false)]
                [Bindable(true)]
                [TypeConverter(typeof(StringConverter))]
@@ -121,7 +114,6 @@ namespace System.Windows.Forms {
                                control_tag = value;
                        }
                }
-#endif
 
                public void Start ()
                {
index f63f5dab1c7e215cf6de5580903d76265a7c2738..37e8f29eb2a949a1e9188dec9478ed0c69143087 100644 (file)
@@ -37,10 +37,8 @@ using System.Runtime.InteropServices;
 
 namespace System.Windows.Forms
 {
-#if NET_2_0
        [ComVisible (true)]
        [ClassInterface (ClassInterfaceType.AutoDispatch)]
-#endif
        [DefaultEvent ("ButtonClick")]
        [DefaultProperty ("Buttons")]
        [Designer ("System.Windows.Forms.Design.ToolBarDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
@@ -57,14 +55,12 @@ namespace System.Windows.Forms
                static object ButtonClickEvent = new object ();
                static object ButtonDropDownEvent = new object ();
 
-#if NET_2_0
                [Browsable (true)]
                [EditorBrowsable (EditorBrowsableState.Always)]
                public new event EventHandler AutoSizeChanged {
                        add { base.AutoSizeChanged += value; }
                        remove { base.AutoSizeChanged -= value; }
                }
-#endif
 
                [Browsable (false)]
                [EditorBrowsable (EditorBrowsableState.Never)]
@@ -80,14 +76,12 @@ namespace System.Windows.Forms
                        remove { base.BackgroundImageChanged -= value; }
                }
 
-#if NET_2_0
                [Browsable (false)]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public new event EventHandler BackgroundImageLayoutChanged {
                        add { base.BackgroundImageLayoutChanged += value; }
                        remove { base.BackgroundImageLayoutChanged -= value; }
                }
-#endif
 
                public event ToolBarButtonClickEventHandler ButtonClick {
                        add { Events.AddHandler (ButtonClickEvent, value); }
@@ -181,13 +175,11 @@ namespace System.Windows.Forms
                        get { return ThemeEngine.Current.ToolBarDefaultSize; }
                }
 
-#if NET_2_0
                [EditorBrowsable (EditorBrowsableState.Never)]
                protected override bool DoubleBuffered {
                        get { return base.DoubleBuffered; }
                        set { base.DoubleBuffered = value; }
                }
-#endif
                #endregion
 
                ToolBarAppearance appearance = ToolBarAppearance.Normal;
@@ -208,18 +200,12 @@ namespace System.Windows.Forms
 
                bool autosize = true;
 
-#if NET_2_0
                [Browsable (true)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Visible)]
                [EditorBrowsable (EditorBrowsableState.Always)]
-#endif
                [DefaultValue (true)]
                [Localizable (true)]
-               public 
-#if NET_2_0
-               override
-#endif
-               bool AutoSize {
+               public override bool AutoSize {
                        get { return autosize; }
                        set {
                                if (value == autosize)
@@ -253,14 +239,12 @@ namespace System.Windows.Forms
                        set { base.BackgroundImage = value; }
                }
 
-#if NET_2_0
                [Browsable (false)]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public override ImageLayout BackgroundImageLayout {
                        get { return base.BackgroundImageLayout; }
                        set { base.BackgroundImageLayout = value; }
                }
-#endif
 
                [DefaultValue (BorderStyle.None)]
                [DispIdAttribute (-504)]
@@ -524,7 +508,6 @@ namespace System.Windows.Forms
                        base.Dispose (disposing);
                }
 
-#if NET_2_0
                private ToolBarButton button_for_focus = null;
                
                internal void UIAPerformClick (ToolBarButton button)
@@ -546,7 +529,6 @@ namespace System.Windows.Forms
                                current_item = previous_item;
                        }
                }
-#endif
                
                void PerformButtonClick (ToolBarButtonClickEventArgs e)
                {
@@ -561,10 +543,9 @@ namespace System.Windows.Forms
                        current_item.Pressed = false;
                        current_item.Invalidate ();
                        
-#if NET_2_0
                        button_for_focus = current_item.Button;
                        button_for_focus.UIAHasFocus = true;
-#endif
+
                        OnButtonClick (e);
                }
 
@@ -614,7 +595,6 @@ namespace System.Windows.Forms
                        LayoutToolBar ();
                }
 
-#if NET_2_0
                protected override void ScaleControl (SizeF factor, BoundsSpecified specified)
                {
                        specified &= ~BoundsSpecified.Height;
@@ -629,7 +609,6 @@ namespace System.Windows.Forms
                        
                        base.ScaleCore (dx, dy);
                }
-#endif
 
                private int requested_size = -1;
 
@@ -682,11 +661,9 @@ namespace System.Windows.Forms
 
                private void FocusChanged (object sender, EventArgs args)
                {
-#if NET_2_0
                        if (!Focused && button_for_focus != null)
                                button_for_focus.UIAHasFocus = false;
                        button_for_focus = null;
-#endif
                        
                        if (Appearance != ToolBarAppearance.Flat || Buttons.Count == 0)
                                return;
@@ -1206,7 +1183,6 @@ namespace System.Windows.Forms
                        #endregion
 
                        #region UIA Framework Events
-#if NET_2_0
                        static object UIACollectionChangedEvent = new object ();
                        
                        internal event CollectionChangeEventHandler UIACollectionChanged {
@@ -1221,7 +1197,6 @@ namespace System.Windows.Forms
                                if (eh != null)
                                        eh (owner, e);
                        }
-#endif
                        #endregion
 
                        #region constructors
@@ -1246,24 +1221,18 @@ namespace System.Windows.Forms
                        public virtual ToolBarButton this [int index] {
                                get { return (ToolBarButton) list [index]; }
                                set {
-#if NET_2_0
                                        // UIA Framework Event: Button Removed
                                        OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
-#endif
 
                                        value.SetParent (owner);
                                        list [index] = value;
                                        owner.Redraw (true);
 
-#if NET_2_0
-
                                // UIA Framework Event: Button Added
                                OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
-#endif
                                }
                        }
 
-#if NET_2_0
                        public virtual ToolBarButton this[string key] {
                                get {
                                        if (string.IsNullOrEmpty (key))
@@ -1276,7 +1245,6 @@ namespace System.Windows.Forms
                                        return null;
                                }
                        }
-#endif
 
                        bool ICollection.IsSynchronized {
                                get { return list.IsSynchronized; }
@@ -1315,10 +1283,8 @@ namespace System.Windows.Forms
                                if (redraw)
                                        owner.Redraw (true);
 
-#if NET_2_0
                                // UIA Framework Event: Button Added
                                OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, result));
-#endif
 
                                return result;
                        }
@@ -1341,10 +1307,8 @@ namespace System.Windows.Forms
                                list.Clear ();
                                owner.Redraw (false);
 
-#if NET_2_0
                                // UIA Framework Event: Button Cleared
                                OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
-#endif
                        }
 
                        public bool Contains (ToolBarButton button)
@@ -1352,12 +1316,10 @@ namespace System.Windows.Forms
                                return list.Contains (button);
                        }
 
-#if NET_2_0
                        public virtual bool ContainsKey (string key)
                        {
                                return !(this[key] == null);
                        }
-#endif
 
                        public IEnumerator GetEnumerator ()
                        {
@@ -1419,22 +1381,18 @@ namespace System.Windows.Forms
                                return list.IndexOf (button);
                        }
 
-#if NET_2_0
                        public virtual int IndexOfKey (string key)
                        {
                                return IndexOf (this[key]);
                        }
-#endif
 
                        public void Insert (int index, ToolBarButton button)
                        {
                                list.Insert (index, button);
                                owner.Redraw (true);
 
-#if NET_2_0
                                // UIA Framework Event: Button Added
                                OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
-#endif
                        }
 
                        public void Remove (ToolBarButton button)
@@ -1448,18 +1406,14 @@ namespace System.Windows.Forms
                                list.RemoveAt (index);
                                owner.Redraw (true);
 
-#if NET_2_0
                                // UIA Framework Event: Button Removed
                                OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
-#endif
                        }
 
-#if NET_2_0
                        public virtual void RemoveByKey (string key)
                        {
                                Remove (this[key]);
                        }
-#endif
                        #endregion methods
                }
                
index cd1c8bf9d5d38c2dc539d1db6d45015b63bf165a..4ad81ff8664fd4f57f2fbe9bb232474c1e4f0c09 100644 (file)
@@ -32,9 +32,6 @@
 
 namespace System.Windows.Forms
 {
-#if !NET_2_0
-       [Serializable]
-#endif
        public enum ToolBarAppearance
        {
                Normal = 0,
index f3ba5807eb9af1bff9c807c5c7bd9e5718e0d0a0..16e253147fb534f597830e4e3d6222e8398e3b5f 100644 (file)
@@ -52,10 +52,8 @@ namespace System.Windows.Forms
                private string text = "";
                private string tooltip = "";
                private bool visible = true;
-#if NET_2_0
                private string image_key = string.Empty;
                private string name;
-#endif
                #endregion
 
                #region constructors
@@ -80,10 +78,8 @@ namespace System.Windows.Forms
                                if (ImageIndex > -1 && ImageIndex < list.Images.Count)
                                        return list.Images [ImageIndex];
 
-#if NET_2_0
                                if (!string.IsNullOrEmpty (image_key))
                                        return list.Images [image_key];
-#endif
 
                                return null;
                        }
@@ -103,9 +99,8 @@ namespace System.Windows.Forms
                                        menu = (ContextMenu) value;
                                else
                                        throw new ArgumentException ("DropDownMenu must be of type ContextMenu.");
-#if NET_2_0
+
                                OnUIADropDownMenuChanged (EventArgs.Empty);
-#endif
                        }
                }
 
@@ -120,15 +115,11 @@ namespace System.Windows.Forms
                                enabled = value;
                                Invalidate ();
                                
-#if NET_2_0
                                OnUIAEnabledChanged (EventArgs.Empty);
-#endif
                        }
                }
 
-#if NET_2_0
                [RefreshProperties (RefreshProperties.Repaint)]
-#endif
                [DefaultValue (-1)]
                [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
                [Localizable (true)]
@@ -145,9 +136,7 @@ namespace System.Windows.Forms
                                bool layout = (Parent != null) && ((value == -1) || (image_index == -1));
                                
                                image_index = value;
-#if NET_2_0
                                image_key = string.Empty;
-#endif
 
                                if (layout)
                                        Parent.Redraw (true);
@@ -156,7 +145,6 @@ namespace System.Windows.Forms
                        }
                }
 
-#if NET_2_0
                [Localizable (true)]
                [DefaultValue ("")]
                [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
@@ -192,7 +180,6 @@ namespace System.Windows.Forms
                                name = value;
                        }
                }
-#endif
 
                [Browsable (false)]
                public ToolBar Parent {
@@ -247,9 +234,7 @@ namespace System.Windows.Forms
                                if (parent != null)
                                        parent.Redraw (true);
                                
-#if NET_2_0
                                OnUIAStyleChanged (EventArgs.Empty);
-#endif
                        }
                }
 
@@ -274,9 +259,7 @@ namespace System.Windows.Forms
 
                                text = value;
 
-#if NET_2_0
                                OnUIATextChanged (EventArgs.Empty);
-#endif
                                
                                if (Parent != null)
                                        Parent.Redraw (true);
@@ -328,7 +311,6 @@ namespace System.Windows.Forms
                                Parent.Invalidate (Rectangle);
                }
                
-#if NET_2_0
                bool uiaHasFocus = false;
                internal bool UIAHasFocus {
                        get { return uiaHasFocus; }
@@ -405,7 +387,6 @@ namespace System.Windows.Forms
                        if (eh != null)
                                eh (this, e);
                }
-#endif
                
                #endregion Internal Methods
 
index 3ddecc84857c76f6ec6f24de3b555616e108c6ec..98ffb8ce92529a66c003f23642c99d9cb6300d6c 100644 (file)
@@ -31,8 +31,5 @@
 // COMPLETE
 
 namespace System.Windows.Forms {
-#if !NET_2_0
-       [Serializable]
-#endif
        public delegate void ToolBarButtonClickEventHandler (object sender, ToolBarButtonClickEventArgs e);
 }
index ad4828adb17a456bd3c6867b5479b8c9a1204569..aa99ba03b2e599eee9347cd214e957525ce70d7b 100644 (file)
@@ -31,9 +31,6 @@
 
 namespace System.Windows.Forms
 {
-#if !NET_2_0
-       [Serializable]
-#endif
        public enum ToolBarButtonStyle
        {
                PushButton = 1,
index e8570eb475564ad9295677d9e29c710a1c3ce25b..eced811a0ceab8e984535e16b55e23199c69871c 100644 (file)
@@ -31,9 +31,6 @@
 
 namespace System.Windows.Forms
 {
-#if !NET_2_0
-       [Serializable]
-#endif
        public enum ToolBarTextAlign
        {
                Underneath = 0,
index ba013b03ead07043f6a874b931fe1745e88fa29f..e2730c210234821cb070f550e3305723f48c3215 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
@@ -1786,4 +1785,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index c355de28acfe2998032bdfb4324223183e725177..f04e927293a1ceb6d29f4bbdef4dd44baf4c596e 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 
 namespace System.Windows.Forms
@@ -77,4 +76,3 @@ namespace System.Windows.Forms
                #endregion      // Public Instance Properties
        }
 }
-#endif
\ No newline at end of file
index 40a2aa9bd9588ca7c955a67588225e7eb0987f98..d9ea4edce274d11b446c507ef21209090e1cfeac 100644 (file)
@@ -26,9 +26,7 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 namespace System.Windows.Forms
 {
        public delegate void ToolStripArrowRenderEventHandler (object sender, ToolStripArrowRenderEventArgs e);
 }
-#endif
\ No newline at end of file
index c55e29e22c35d404d363dddc7ed2cf8b0dfbbad7..59347b1d6190b927c530ef51a8c2003e6bc7f83f 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System;
 using System.Drawing;
 using System.ComponentModel;
@@ -249,4 +248,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 384a4b98f0f991100d515bf1667624f4ee2043f4..f07d4e668638f0b636d79136b43324cd748a7b2d 100644 (file)
@@ -25,7 +25,7 @@
 // Authors:
 //     Jonathan Pobst (monkey@jpobst.com)
 //
-#if NET_2_0
+
 using System.Drawing;
 using System.ComponentModel;
 using System.Windows.Forms.Design;
@@ -418,4 +418,3 @@ namespace System.Windows.Forms
                }
        }
 }
-#endif
index eb0740412b97436bdc98b513938ae82a40ca4e99..4548958395147134f9c9e1f73d20a1a27e394265 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System;
 using System.Drawing;
 using System.ComponentModel;
@@ -309,4 +308,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 3c02c6653a80d095b13c187417be0fb92ebfd246..7d2b95b2d26a2d47f01ec563232d2a51e4fc50f9 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 using System.Runtime.InteropServices;
 using System.Windows.Forms.Layout;
@@ -302,4 +301,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 9869e8a679fa5ec14c1090ed7659c0a763dc9bab..b7336fb1b107e10b8adcfe2b9996286883ebf287 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 
 namespace System.Windows.Forms
@@ -60,4 +59,3 @@ namespace System.Windows.Forms
                #endregion              
        }
 }
-#endif
\ No newline at end of file
index 2654d710693d875dda62b0740ef88d4f581709d6..703e51bc6e9768abcab2e7358186e1f1e3745ca3 100644 (file)
@@ -26,9 +26,7 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 namespace System.Windows.Forms
 {
        public delegate void ToolStripContentPanelRenderEventHandler (object sender, ToolStripContentPanelRenderEventArgs e);
 }
-#endif
\ No newline at end of file
index 92b6299c4c4de61c7fda510b0cd1f2512853220e..1e34d8d2007289758c3e5bba989e7e199db08d9d 100644 (file)
@@ -25,7 +25,7 @@
 // Authors:
 //     Jonathan Pobst (monkey@jpobst.com)
 //
-#if NET_2_0
+
 using System.Drawing;
 using System.ComponentModel;
 
@@ -574,4 +574,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 12fb4ae5499c279646c544f26ac0e29908b3a874..270cf75a93d54a25e4fd9ea6873ad473dbb61c37 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
@@ -1049,4 +1048,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 24bf675b89d85c9a8e92fe5158930e33870dfe7a..a87798ce2068fb31a423b9c1043ea288394082c1 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.Drawing;
 using System.Runtime.InteropServices;
 using System.Windows.Forms.Design;
@@ -183,4 +182,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
index 2a8498d99e7a6d265720f44cca1ec4d00919d40c..9684e94762552ea090815d6229effbbf141981b9 100644 (file)
@@ -27,7 +27,6 @@
 //
 
 
-#if NET_2_0
 namespace System.Windows.Forms
 {
        public enum ToolStripDropDownCloseReason
@@ -39,4 +38,3 @@ namespace System.Windows.Forms
                CloseCalled = 4
        }
 }
-#endif
\ No newline at end of file
index 7cad299899060a7faf6925f046b62cf3b63d574b..6ac4533b6d8aa2c72ea4657afa82485bd56bcf49 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 namespace System.Windows.Forms
 {
        public class ToolStripDropDownClosedEventArgs : EventArgs
@@ -47,4 +46,3 @@ namespace System.Windows.Forms
                #endregion      // Public Instance Properties
        }
 }
-#endif
\ No newline at end of file
index e5871658774d92b457ca289b4787dbf250d5e412..f5255c5773e9c3afdb53f585f35917cdaed67198 100644 (file)
@@ -26,9 +26,7 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 namespace System.Windows.Forms
 {
        public delegate void ToolStripDropDownClosedEventHandler (object sender, ToolStripDropDownClosedEventArgs e);
 }
-#endif
\ No newline at end of file
index f4446e93097cf3dfaee69e6a5bc15716366cec2b..6d8fb7f915549384ba7667f15d4a975c4234f18b 100644 (file)
@@ -26,7 +26,6 @@
 //     Jonathan Pobst (monkey@jpobst.com)
 //
 
-#if NET_2_0
 using System.ComponentModel;
 
 namespace System.Windows.Forms
@@ -49,4 +48,3 @@ namespace System.Windows.Forms
                #endregion      // Public Instance Properties
        }
 }
-#endif
\ No newline at end of file