From 1142ab554290757c641a832bb5385b3f8152be7e Mon Sep 17 00:00:00 2001 From: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com> Date: Thu, 23 Jan 2025 07:26:45 +0800 Subject: [PATCH] Add hollow types for deprecated UI controls (#10913) Fixes #3783 Add controls removed in NET3.1 Back to .NET10 for binary compatibility. None of the re-added types can be constructed, all constructors throw new PlatformNotSupportedException(), default constructors are suppressed by introducing throwing public constructors if needed. All attributes that have been present on the .NET Framework types, are preserved, as they are accessible by reflection. All re-introduced types are decorated with [EditorBrowsable(EditorBrowsableState.Never)] attribute that hides them from the intellisense. Type names can be typed in by the developer manually and intellisense would show the same members as it did for .NET Framework projects. All re-introduced types are decorated with the ObsoleteAttribute that results in a compile time warning. All types share a single deprecation warning Id, to simplify suppression, but have different explanation messages. All re-introduced types are decorated with [Browsable(false)] attribute to not show custom control properties of these types in the property browser. All public members are re-introduced with their metadata, except for the private attributes. Members inherited from the base classes (Control, for example) are not re-introduced even if they had been overridden in the past because they are not required for binary compatibility, unless they are decorated with different attributes. Members that are re-added to the existing types (Form and Control) are returning defaults or doing nothing. Non-void public or protected instance members on the restored types throw null, not the PlatformNotSupportedException to save space. Void public or protected instance members do nothing. Public or protected fields return default values. Nullability is disabled for all re-added classes, structs and delegates for compatibility with the .NET Framework. --- Winforms.sln | 22 + docs/list-of-diagnostics.md | 7 +- src/Common/src/Obsoletions.cs | 14 +- ...zationService.CodeDomSerializationStore.cs | 2 +- .../Tools/StronglyTypedResourceBuilder.cs | 2 +- .../src/GlobalSuppressions.cs | 3 + .../src/PublicAPI.Unshipped.txt | 840 +++++++++++++++++- .../src/System/Windows/Forms/Control.cs | 48 + .../Unsupported/ContextMenu/ContextMenu.cs | 60 ++ .../ContextMenu/Menu.MenuItemCollection.cs | 92 ++ .../Controls/Unsupported/ContextMenu/Menu.cs | 80 ++ .../Unsupported/ContextMenu/MenuItem.cs | 270 ++++++ .../Unsupported/ContextMenu/MenuMerge.cs | 24 + .../DataGrid/DataGrid.HitTestInfo.cs | 34 + .../DataGrid/DataGrid.HitTestType.cs | 32 + .../Controls/Unsupported/DataGrid/DataGrid.cs | 599 +++++++++++++ .../DataGrid/DataGridBoolColumn.cs | 105 +++ .../Unsupported/DataGrid/DataGridCell.cs | 37 + .../DataGridColumnStyle.CompModSwitches.cs | 28 + ...le.DataGridColumnHeaderAccessibleObject.cs | 32 + .../DataGrid/DataGridColumnStyle.cs | 227 +++++ .../Unsupported/DataGrid/DataGridLineStyle.cs | 22 + .../DataGrid/DataGridParentRowsLabel.cs | 24 + ...taGridPreferredColumnWidthTypeConverter.cs | 24 + .../DataGrid/DataGridTableStyle.cs | 394 ++++++++ .../Unsupported/DataGrid/DataGridTextBox.cs | 37 + .../DataGrid/DataGridTextBoxColumn.cs | 108 +++ .../DataGrid/GridColumnStylesCollection.cs | 95 ++ .../DataGrid/GridTableStylesCollection.cs | 85 ++ .../Unsupported/DataGrid/GridTablesFactory.cs | 29 + .../DataGrid/IDataGridEditingService.cs | 25 + .../Controls/Unsupported/MainMenu/MainMenu.cs | 48 + .../StatusBar.StatusBarPanelCollection.cs | 92 ++ .../Unsupported/StatusBar/StatusBar.cs | 181 ++++ .../StatusBar/StatusBarDrawItemEventArgs.cs | 54 ++ .../StatusBarDrawItemEventHandler.cs | 20 + .../Unsupported/StatusBar/StatusBarPanel.cs | 124 +++ .../StatusBar/StatusBarPanelAutoSize.cs | 23 + .../StatusBar/StatusBarPanelBorderStyle.cs | 23 + .../StatusBar/StatusBarPanelClickEventArgs.cs | 30 + .../StatusBarPanelClickEventHandler.cs | 20 + .../StatusBar/StatusBarPanelStyle.cs | 22 + .../ToolBar.ToolBarButtonCollection.cs | 90 ++ .../Controls/Unsupported/ToolBar/ToolBar.cs | 283 ++++++ .../Unsupported/ToolBar/ToolBarAppearance.cs | 22 + .../Unsupported/ToolBar/ToolBarButton.cs | 137 +++ .../ToolBar/ToolBarButtonClickEventArgs.cs | 29 + .../ToolBar/ToolBarButtonClickEventHandler.cs | 20 + .../Unsupported/ToolBar/ToolBarButtonStyle.cs | 24 + .../Unsupported/ToolBar/ToolBarTextAlign.cs | 22 + .../Forms/Controls/Unsupported/readme.md | 47 + .../src/System/Windows/Forms/Form.cs | 34 + .../tests/AxHosts/AxHosts.cs | 2 + .../tests/CreateFrameworkTypes.cs | 423 +++++++++ .../WinformsControlsTest/MainForm.cs | 6 +- .../ScrollableControls.cs | 15 +- .../tests/TestUtilities/DialogHostForm.cs | 2 + .../System.Windows.Forms.Tests.csproj | 6 + .../AccessibleObjectTests.cs | 14 +- .../Control.ControlAccessibleObjectTests.cs | 20 +- .../Forms/Design/DesignerAttributeTests.cs | 67 +- .../Windows/Forms/UnsupportedTypesTests.cs | 227 +++++ .../tests/UnsupportedTypes.csproj | 20 + .../tests/UnsupportedTypes/App.config | 6 + .../UnsupportedTypes/CreateFrameworkTypes.cs | 423 +++++++++ .../UnsupportedTypes/UnsupportedTypes.csproj | 20 + src/System.Windows.Forms/tests/app.config | 6 + 67 files changed, 5955 insertions(+), 48 deletions(-) create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/ContextMenu.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.MenuItemCollection.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuItem.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuMerge.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestInfo.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestType.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridBoolColumn.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridCell.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.CompModSwitches.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridLineStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridParentRowsLabel.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridPreferredColumnWidthTypeConverter.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTableStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBox.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBoxColumn.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridColumnStylesCollection.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTableStylesCollection.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTablesFactory.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/IDataGridEditingService.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/MainMenu/MainMenu.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.StatusBarPanelCollection.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventArgs.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventHandler.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanel.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelAutoSize.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelBorderStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventArgs.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventHandler.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.ToolBarButtonCollection.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarAppearance.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButton.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventArgs.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventHandler.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonStyle.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarTextAlign.cs create mode 100644 src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/readme.md create mode 100644 src/System.Windows.Forms/tests/CreateFrameworkTypes.cs create mode 100644 src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/UnsupportedTypesTests.cs create mode 100644 src/System.Windows.Forms/tests/UnsupportedTypes.csproj create mode 100644 src/System.Windows.Forms/tests/UnsupportedTypes/App.config create mode 100644 src/System.Windows.Forms/tests/UnsupportedTypes/CreateFrameworkTypes.cs create mode 100644 src/System.Windows.Forms/tests/UnsupportedTypes/UnsupportedTypes.csproj create mode 100644 src/System.Windows.Forms/tests/app.config diff --git a/Winforms.sln b/Winforms.sln index c012dd45fe1..dc9c4aafe66 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -7,6 +7,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms", "src\System.Windows.Forms\src\System.Windows.Forms.csproj", "{0D23A41B-2626-4703-9E4A-87C07F69B0B2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Tests", "src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj", "{AB38E262-F206-4820-8F29-23C5F72A4A16}" + ProjectSection(ProjectDependencies) = postProject + {607E02DD-4256-4E73-B9A4-4CE2673B3703} = {607E02DD-4256-4E73-B9A4-4CE2673B3703} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design.Tests", "src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj", "{F977CA8C-FBF9-4D82-80BA-FE5B2F33486E}" EndProject @@ -179,6 +182,8 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "System.Windows.Forms.Analyz EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.Windows.Core.Tests", "src\System.Private.Windows.Core\tests\System.Private.Windows.Core.Tests\System.Private.Windows.Core.Tests.csproj", "{B653C860-9B52-4597-9921-24DA79A4E6B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnsupportedTypes", "src\System.Windows.Forms\tests\UnsupportedTypes\UnsupportedTypes.csproj", "{607E02DD-4256-4E73-B9A4-4CE2673B3703}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pipelines", "Pipelines", "{656C66A4-59CD-4E14-8AE4-1F5BCEECB553}" ProjectSection(SolutionItems) = preProject eng\pipelines\azure-pipelines-codeql.yml = eng\pipelines\azure-pipelines-codeql.yml @@ -1086,6 +1091,22 @@ Global {B653C860-9B52-4597-9921-24DA79A4E6B1}.Release|x64.Build.0 = Release|Any CPU {B653C860-9B52-4597-9921-24DA79A4E6B1}.Release|x86.ActiveCfg = Release|Any CPU {B653C860-9B52-4597-9921-24DA79A4E6B1}.Release|x86.Build.0 = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|Any CPU.Build.0 = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|arm64.ActiveCfg = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|arm64.Build.0 = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|x64.ActiveCfg = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|x64.Build.0 = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|x86.ActiveCfg = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Debug|x86.Build.0 = Debug|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|Any CPU.ActiveCfg = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|Any CPU.Build.0 = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|arm64.ActiveCfg = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|arm64.Build.0 = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|x64.ActiveCfg = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|x64.Build.0 = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|x86.ActiveCfg = Release|Any CPU + {607E02DD-4256-4E73-B9A4-4CE2673B3703}.Release|x86.Build.0 = Release|Any CPU {442C867C-51C0-8CE5-F067-DF065008E3DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {442C867C-51C0-8CE5-F067-DF065008E3DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {442C867C-51C0-8CE5-F067-DF065008E3DA}.Debug|arm64.ActiveCfg = Debug|Any CPU @@ -1172,6 +1193,7 @@ Global {656C66A4-59CD-4E14-8AE4-1F5BCEECB553} = {8B4B1E09-B3C7-4044-B223-94EDEC1CAA20} {D4D97D78-D213-45DF-B003-9C4C9F2E5E1C} = {8B4B1E09-B3C7-4044-B223-94EDEC1CAA20} {442C867C-51C0-8CE5-F067-DF065008E3DA} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7} + {607E02DD-4256-4E73-B9A4-4CE2673B3703} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} diff --git a/docs/list-of-diagnostics.md b/docs/list-of-diagnostics.md index 492d4cb4832..318176c3532 100644 --- a/docs/list-of-diagnostics.md +++ b/docs/list-of-diagnostics.md @@ -43,7 +43,12 @@ The acceptance criteria for adding an obsoletion includes: | __`WFDEV005`__ | `Clipboard.GetData(string)` method is obsolete. Use `Clipboard.TryGetData` methods instead. | | __`WFDEV005`__ | `DataObject.GetData` methods are obsolete. Use the corresponding `DataObject.TryGetData` instead. | | __`WFDEV005`__ | `ClipboardProxy.GetData(As String)` method is obsolete. Use `ClipboardProxy.TryGetData(Of T)(As String, As T)` instead. | - +| __`WFDEV006`__ | `ContextMenu` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `ContextMenuStrip` instead. | +| __`WFDEV006`__ | `DataGrid` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `DataGridView` instead. | +| __`WFDEV006`__ | `MainMenu` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `MenuStrip` instead. | +| __`WFDEV006`__ | `Menu` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `ToolStripDropDown` and `ToolStripDropDownMenu` instead. | +| __`WFDEV006`__ | `StatusBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `StatusStrip` instead. | +| __`WFDEV006`__ | `ToolBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `ToolStrip` instead. | ## Analyzer Warnings diff --git a/src/Common/src/Obsoletions.cs b/src/Common/src/Obsoletions.cs index 7c6ee8b10ec..f8a4b5977da 100644 --- a/src/Common/src/Obsoletions.cs +++ b/src/Common/src/Obsoletions.cs @@ -25,10 +25,18 @@ internal static class Obsoletions internal const string FormOnClosingClosedMessage = "Form.OnClosing, Form.OnClosed and the corresponding events are obsolete. Use Form.OnFormClosing, Form.OnFormClosed, Form.FormClosing and Form.FormClosed instead."; internal const string FormOnClosingClosedDiagnosticId = "WFDEV004"; + internal const string DataObjectGetDataMessage = "`DataObject.GetData` methods are obsolete. Use the corresponding `DataObject.TryGetData` instead."; + internal const string ClipboardProxyGetDataMessage = "`ClipboardProxy.GetData(As String)` method is obsolete. Use `ClipboardProxy.TryGetData(Of T)(As String, As T)` instead."; internal const string ClipboardGetDataMessage = "`Clipboard.GetData(string)` method is obsolete. Use `Clipboard.TryGetData` methods instead."; internal const string ClipboardGetDataDiagnosticId = "WFDEV005"; - internal const string DataObjectGetDataMessage = "`DataObject.GetData` methods are obsolete. Use the corresponding `DataObject.TryGetData` instead."; - - internal const string ClipboardProxyGetDataMessage = "`ClipboardProxy.GetData(As String)` method is obsolete. Use `ClipboardProxy.TryGetData(Of T)(As String, As T)` instead."; +#pragma warning disable WFDEV006 // Type or member is obsolete + internal const string ContextMenuMessage = $"`{nameof(ContextMenu)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(ContextMenuStrip)}` instead."; + internal const string DataGridMessage = $"`{nameof(DataGrid)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(DataGridView)}` instead."; + internal const string MainMenuMessage = $"`{nameof(MainMenu)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(MenuStrip)}` instead."; + internal const string MenuMessage = $"`{nameof(Menu)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(ToolStripDropDown)}` and `{nameof(ToolStripDropDownMenu)}` instead."; + internal const string StatusBarMessage = $"`{nameof(StatusBar)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(StatusStrip)}` instead."; + internal const string ToolBarMessage = $"`{nameof(ToolBar)}` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `{nameof(ToolStrip)}` instead."; +#pragma warning restore WFDEV006 + internal const string UnsupportedControlsDiagnosticId = "WFDEV006"; } diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs index c476f242919..91263b18464 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.cs @@ -319,7 +319,7 @@ private static string GetObjectName(object value) /// /// On .NET Framework, this method implements the save part of interface. On .NET, - /// this interface is implemented only for binary compatibility with the .NET Framework. Formatter deserialization + /// this interface is implemented only for binary compatibility with .NET Framework. Formatter deserialization /// is disabled .NET by removing the from this class. /// This method is used in unit tests only. /// diff --git a/src/System.Windows.Forms.Design/src/System/Resources/Tools/StronglyTypedResourceBuilder.cs b/src/System.Windows.Forms.Design/src/System/Resources/Tools/StronglyTypedResourceBuilder.cs index 37062de35ac..0100b7d5c5e 100644 --- a/src/System.Windows.Forms.Design/src/System/Resources/Tools/StronglyTypedResourceBuilder.cs +++ b/src/System.Windows.Forms.Design/src/System/Resources/Tools/StronglyTypedResourceBuilder.cs @@ -18,7 +18,7 @@ namespace System.Resources.Tools; /// /// /// Typically, resources separate code from content within an application. Creating and consuming these resources -/// makes it easier to develop localizable applications. In the .NET Framework, resources are usually consumed by +/// makes it easier to develop localizable applications. In .NET Framework, resources are usually consumed by /// using the class, which contains methods that provide access to culture-specific /// resources at run time. For more information about creating and consuming resources, see /// Resources in Desktop Apps. diff --git a/src/System.Windows.Forms/src/GlobalSuppressions.cs b/src/System.Windows.Forms/src/GlobalSuppressions.cs index a351e1b41fb..a61c8f241ad 100644 --- a/src/System.Windows.Forms/src/GlobalSuppressions.cs +++ b/src/System.Windows.Forms/src/GlobalSuppressions.cs @@ -103,6 +103,7 @@ [assembly: SuppressMessage("Naming", "CA1725:Parameter names should match base declaration", Justification = "Public API", Scope = "member", Target = "~M:System.Windows.Forms.ToolTip.CanExtend(System.Object)~System.Boolean")] [assembly: SuppressMessage("Naming", "CA1725:Parameter names should match base declaration", Justification = "Public API", Scope = "member", Target = "~M:System.Windows.Forms.TreeNodeCollection.CopyTo(System.Array,System.Int32)")] [assembly: SuppressMessage("Naming", "CA1725:Parameter names should match base declaration", Justification = "Public API", Scope = "member", Target = "~M:System.Windows.Forms.UpDownBase.OnMouseUp(System.Windows.Forms.MouseEventArgs)")] +[assembly: SuppressMessage("Naming", "CA1725:Parameter names should match base declaration", Justification = "Public API", Scope = "member", Target = "~M:System.Windows.Forms.Menu.MenuItemCollection.CopyTo(System.Array,System.Int32)")] [assembly: SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.GridItemCollection.Empty")] [assembly: SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.ToolStripRenderer.Offset2X")] [assembly: SuppressMessage("Usage", "CA2211:Non-constant fields should not be visible", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.ToolStripRenderer.Offset2Y")] @@ -152,6 +153,8 @@ [assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Public API", Scope = "member", Target = "~F:System.Resources.ResXResourceWriter.Version")] [assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Public API", Scope = "member", Target = "~F:System.Resources.ResXResourceWriter.ResourceSchema")] [assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.GridItemCollection.Empty")] +[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.DataGrid.HitTestInfo.Nowhere")] +[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Public API", Scope = "member", Target = "~F:System.Windows.Forms.DataGridTableStyle.DefaultTableStyle")] [assembly: SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Public API", Scope = "type", Target = "~T:System.Windows.Forms.ImeModeConversion")] [assembly: SuppressMessage("Performance", "CA1821:Remove empty Finalizers", Justification = "Public API", Scope = "member", Target = "~M:System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize")] diff --git a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt index 6f68c96826e..8f182bf758d 100644 --- a/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt +++ b/src/System.Windows.Forms/src/PublicAPI.Unshipped.txt @@ -1,24 +1,538 @@ +abstract System.Windows.Forms.DataGridColumnStyle.Abort(int rowNum) -> void +abstract System.Windows.Forms.DataGridColumnStyle.GetMinimumHeight() -> int +const System.Windows.Forms.Menu.FindHandle = 0 -> int +const System.Windows.Forms.Menu.FindShortcut = 1 -> int +override System.Windows.Forms.DataGrid.BackgroundImageLayout.get -> System.Windows.Forms.ImageLayout +override System.Windows.Forms.DataGrid.BackgroundImageLayout.set -> void +override System.Windows.Forms.DataGridBoolColumn.Abort(int rowNum) -> void +override System.Windows.Forms.DataGridBoolColumn.GetMinimumHeight() -> int +override System.Windows.Forms.DataGridTextBoxColumn.Abort(int rowNum) -> void +override System.Windows.Forms.DataGridTextBoxColumn.GetMinimumHeight() -> int +override System.Windows.Forms.MenuItem.IsParent.get -> bool +override System.Windows.Forms.StatusBar.BackColor.get -> System.Drawing.Color +override System.Windows.Forms.StatusBar.BackColor.set -> void +override System.Windows.Forms.StatusBar.BackgroundImageLayout.get -> System.Windows.Forms.ImageLayout +override System.Windows.Forms.StatusBar.BackgroundImageLayout.set -> void +override System.Windows.Forms.StatusBar.Dock.get -> System.Windows.Forms.DockStyle +override System.Windows.Forms.StatusBar.Dock.set -> void +override System.Windows.Forms.StatusBar.DoubleBuffered.get -> bool +override System.Windows.Forms.StatusBar.DoubleBuffered.set -> void +override System.Windows.Forms.StatusBar.ForeColor.get -> System.Drawing.Color +override System.Windows.Forms.StatusBar.ForeColor.set -> void +override System.Windows.Forms.ToolBar.AutoSize.get -> bool +override System.Windows.Forms.ToolBar.AutoSize.set -> void +override System.Windows.Forms.ToolBar.BackColor.get -> System.Drawing.Color +override System.Windows.Forms.ToolBar.BackColor.set -> void +override System.Windows.Forms.ToolBar.BackgroundImageLayout.get -> System.Windows.Forms.ImageLayout +override System.Windows.Forms.ToolBar.BackgroundImageLayout.set -> void +override System.Windows.Forms.ToolBar.Dock.get -> System.Windows.Forms.DockStyle +override System.Windows.Forms.ToolBar.Dock.set -> void +override System.Windows.Forms.ToolBar.DoubleBuffered.get -> bool +override System.Windows.Forms.ToolBar.DoubleBuffered.set -> void +override System.Windows.Forms.ToolBar.ForeColor.get -> System.Drawing.Color +override System.Windows.Forms.ToolBar.ForeColor.set -> void +override System.Windows.Forms.ToolBar.RightToLeft.get -> System.Windows.Forms.RightToLeft +override System.Windows.Forms.ToolBar.RightToLeft.set -> void +override System.Windows.Forms.ToolBar.ScaleCore(float dx, float dy) -> void +static System.Windows.Forms.Clipboard.SetDataAsJson(string! format, T data) -> void static System.Windows.Forms.Clipboard.TryGetData(string! format, out T data) -> bool static System.Windows.Forms.Clipboard.TryGetData(string! format, System.Func! resolver, out T data) -> bool static System.Windows.Forms.DataObjectExtensions.TryGetData(this System.Windows.Forms.IDataObject! dataObject, out T data) -> bool static System.Windows.Forms.DataObjectExtensions.TryGetData(this System.Windows.Forms.IDataObject! dataObject, string! format, bool autoConvert, out T data) -> bool static System.Windows.Forms.DataObjectExtensions.TryGetData(this System.Windows.Forms.IDataObject! dataObject, string! format, out T data) -> bool static System.Windows.Forms.DataObjectExtensions.TryGetData(this System.Windows.Forms.IDataObject! dataObject, string! format, System.Func! resolver, bool autoConvert, out T data) -> bool -static System.Windows.Forms.Clipboard.SetDataAsJson(string! format, T data) -> void +System.Windows.Forms.ContextMenu +System.Windows.Forms.ContextMenu.Collapse -> System.EventHandler +System.Windows.Forms.ContextMenu.ContextMenu() -> void +System.Windows.Forms.ContextMenu.Popup -> System.EventHandler +System.Windows.Forms.Control.ContextMenuChanged -> System.EventHandler System.Windows.Forms.Control.DoDragDropAsJson(T data, System.Windows.Forms.DragDropEffects allowedEffects) -> System.Windows.Forms.DragDropEffects System.Windows.Forms.Control.DoDragDropAsJson(T data, System.Windows.Forms.DragDropEffects allowedEffects, System.Drawing.Bitmap? dragImage, System.Drawing.Point cursorOffset, bool useDefaultDragImage) -> System.Windows.Forms.DragDropEffects +System.Windows.Forms.DataGrid +System.Windows.Forms.DataGrid.AllowNavigation.get -> bool +System.Windows.Forms.DataGrid.AllowNavigation.set -> void +System.Windows.Forms.DataGrid.AllowNavigationChanged -> System.EventHandler +System.Windows.Forms.DataGrid.AllowSorting.get -> bool +System.Windows.Forms.DataGrid.AllowSorting.set -> void +System.Windows.Forms.DataGrid.AlternatingBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.AlternatingBackColor.set -> void +System.Windows.Forms.DataGrid.BackButtonClick -> System.EventHandler +System.Windows.Forms.DataGrid.BackgroundColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.BackgroundColor.set -> void +System.Windows.Forms.DataGrid.BackgroundColorChanged -> System.EventHandler +System.Windows.Forms.DataGrid.BackgroundImageChanged -> System.EventHandler +System.Windows.Forms.DataGrid.BackgroundImageLayoutChanged -> System.EventHandler +System.Windows.Forms.DataGrid.BeginInit() -> void +System.Windows.Forms.DataGrid.BorderStyle.get -> System.Windows.Forms.BorderStyle +System.Windows.Forms.DataGrid.BorderStyle.set -> void +System.Windows.Forms.DataGrid.BorderStyleChanged -> System.EventHandler +System.Windows.Forms.DataGrid.CaptionBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.CaptionBackColor.set -> void +System.Windows.Forms.DataGrid.CaptionForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.CaptionForeColor.set -> void +System.Windows.Forms.DataGrid.CaptionVisible.get -> bool +System.Windows.Forms.DataGrid.CaptionVisible.set -> void +System.Windows.Forms.DataGrid.CaptionVisibleChanged -> System.EventHandler +System.Windows.Forms.DataGrid.Collapse(int row) -> void +System.Windows.Forms.DataGrid.ColumnHeadersVisible.get -> bool +System.Windows.Forms.DataGrid.ColumnHeadersVisible.set -> void +System.Windows.Forms.DataGrid.CurrentCell.get -> System.Windows.Forms.DataGridCell +System.Windows.Forms.DataGrid.CurrentCell.set -> void +System.Windows.Forms.DataGrid.CurrentCellChanged -> System.EventHandler +System.Windows.Forms.DataGrid.CurrentRowIndex.get -> int +System.Windows.Forms.DataGrid.CurrentRowIndex.set -> void +System.Windows.Forms.DataGrid.CursorChanged -> System.EventHandler +System.Windows.Forms.DataGrid.DataGrid() -> void +System.Windows.Forms.DataGrid.DataSourceChanged -> System.EventHandler +System.Windows.Forms.DataGrid.EndInit() -> void +System.Windows.Forms.DataGrid.Expand(int row) -> void +System.Windows.Forms.DataGrid.FirstVisibleColumn.get -> int +System.Windows.Forms.DataGrid.FlatMode.get -> bool +System.Windows.Forms.DataGrid.FlatMode.set -> void +System.Windows.Forms.DataGrid.FlatModeChanged -> System.EventHandler +System.Windows.Forms.DataGrid.GetCellBounds(int row, int col) -> System.Drawing.Rectangle +System.Windows.Forms.DataGrid.GetCellBounds(System.Windows.Forms.DataGridCell dgc) -> System.Drawing.Rectangle +System.Windows.Forms.DataGrid.GetCurrentCellBounds() -> System.Drawing.Rectangle +System.Windows.Forms.DataGrid.GridLineColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.GridLineColor.set -> void +System.Windows.Forms.DataGrid.GridLineStyle.get -> System.Windows.Forms.DataGridLineStyle +System.Windows.Forms.DataGrid.GridLineStyle.set -> void +System.Windows.Forms.DataGrid.HeaderBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.HeaderBackColor.set -> void +System.Windows.Forms.DataGrid.HeaderForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.HeaderForeColor.set -> void +System.Windows.Forms.DataGrid.HitTestInfo +System.Windows.Forms.DataGrid.HitTestInfo.Column.get -> int +System.Windows.Forms.DataGrid.HitTestInfo.Row.get -> int +System.Windows.Forms.DataGrid.HitTestInfo.Type.get -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.Caption = 32 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.Cell = 1 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.ColumnHeader = 2 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.ColumnResize = 8 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.None = 0 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.ParentRows = 64 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.RowHeader = 4 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.HitTestType.RowResize = 16 -> System.Windows.Forms.DataGrid.HitTestType +System.Windows.Forms.DataGrid.IsExpanded(int rowNumber) -> bool +System.Windows.Forms.DataGrid.IsSelected(int row) -> bool +System.Windows.Forms.DataGrid.LinkColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.LinkColor.set -> void +System.Windows.Forms.DataGrid.LinkHoverColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.LinkHoverColor.set -> void +System.Windows.Forms.DataGrid.Navigate -> System.Windows.Forms.NavigateEventHandler +System.Windows.Forms.DataGrid.NavigateBack() -> void +System.Windows.Forms.DataGrid.ParentRowsBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.ParentRowsBackColor.set -> void +System.Windows.Forms.DataGrid.ParentRowsForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.ParentRowsForeColor.set -> void +System.Windows.Forms.DataGrid.ParentRowsLabelStyle.get -> System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGrid.ParentRowsLabelStyle.set -> void +System.Windows.Forms.DataGrid.ParentRowsLabelStyleChanged -> System.EventHandler +System.Windows.Forms.DataGrid.ParentRowsVisible.get -> bool +System.Windows.Forms.DataGrid.ParentRowsVisible.set -> void +System.Windows.Forms.DataGrid.ParentRowsVisibleChanged -> System.EventHandler +System.Windows.Forms.DataGrid.PreferredColumnWidth.get -> int +System.Windows.Forms.DataGrid.PreferredColumnWidth.set -> void +System.Windows.Forms.DataGrid.PreferredRowHeight.get -> int +System.Windows.Forms.DataGrid.PreferredRowHeight.set -> void +System.Windows.Forms.DataGrid.ProcessTabKey(System.Windows.Forms.Keys keyData) -> bool +System.Windows.Forms.DataGrid.ReadOnly.get -> bool +System.Windows.Forms.DataGrid.ReadOnly.set -> void +System.Windows.Forms.DataGrid.ReadOnlyChanged -> System.EventHandler +System.Windows.Forms.DataGrid.ResetAlternatingBackColor() -> void +System.Windows.Forms.DataGrid.ResetGridLineColor() -> void +System.Windows.Forms.DataGrid.ResetHeaderBackColor() -> void +System.Windows.Forms.DataGrid.ResetHeaderFont() -> void +System.Windows.Forms.DataGrid.ResetHeaderForeColor() -> void +System.Windows.Forms.DataGrid.ResetLinkColor() -> void +System.Windows.Forms.DataGrid.ResetLinkHoverColor() -> void +System.Windows.Forms.DataGrid.ResetSelection() -> void +System.Windows.Forms.DataGrid.ResetSelectionBackColor() -> void +System.Windows.Forms.DataGrid.ResetSelectionForeColor() -> void +System.Windows.Forms.DataGrid.RowHeaderClick -> System.EventHandler +System.Windows.Forms.DataGrid.RowHeadersVisible.get -> bool +System.Windows.Forms.DataGrid.RowHeadersVisible.set -> void +System.Windows.Forms.DataGrid.RowHeaderWidth.get -> int +System.Windows.Forms.DataGrid.RowHeaderWidth.set -> void +System.Windows.Forms.DataGrid.Scroll -> System.EventHandler +System.Windows.Forms.DataGrid.Select(int row) -> void +System.Windows.Forms.DataGrid.SelectionBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.SelectionBackColor.set -> void +System.Windows.Forms.DataGrid.SelectionForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGrid.SelectionForeColor.set -> void +System.Windows.Forms.DataGrid.ShouldSerializeHeaderFont() -> bool +System.Windows.Forms.DataGrid.ShouldSerializePreferredRowHeight() -> bool +System.Windows.Forms.DataGrid.ShouldSerializeSelectionBackColor() -> bool +System.Windows.Forms.DataGrid.ShowParentDetailsButtonClick -> System.EventHandler +System.Windows.Forms.DataGrid.SubObjectsSiteChange(bool site) -> void +System.Windows.Forms.DataGrid.TextChanged -> System.EventHandler +System.Windows.Forms.DataGrid.UnSelect(int row) -> void +System.Windows.Forms.DataGrid.VisibleColumnCount.get -> int +System.Windows.Forms.DataGrid.VisibleRowCount.get -> int +System.Windows.Forms.DataGridBoolColumn +System.Windows.Forms.DataGridBoolColumn.AllowNull.get -> bool +System.Windows.Forms.DataGridBoolColumn.AllowNull.set -> void +System.Windows.Forms.DataGridBoolColumn.AllowNullChanged -> System.EventHandler +System.Windows.Forms.DataGridBoolColumn.DataGridBoolColumn() -> void +System.Windows.Forms.DataGridBoolColumn.FalseValueChanged -> System.EventHandler +System.Windows.Forms.DataGridBoolColumn.TrueValueChanged -> System.EventHandler +System.Windows.Forms.DataGridCell +System.Windows.Forms.DataGridCell.ColumnNumber.get -> int +System.Windows.Forms.DataGridCell.ColumnNumber.set -> void +System.Windows.Forms.DataGridCell.DataGridCell() -> void +System.Windows.Forms.DataGridCell.DataGridCell(int r, int c) -> void +System.Windows.Forms.DataGridCell.RowNumber.get -> int +System.Windows.Forms.DataGridCell.RowNumber.set -> void +System.Windows.Forms.DataGridColumnStyle +System.Windows.Forms.DataGridColumnStyle.AlignmentChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.BeginUpdate() -> void +System.Windows.Forms.DataGridColumnStyle.CompModSwitches +System.Windows.Forms.DataGridColumnStyle.CompModSwitches.CompModSwitches() -> void +System.Windows.Forms.DataGridColumnStyle.DataGridColumnHeaderAccessibleObject +System.Windows.Forms.DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.DataGridColumnHeaderAccessibleObject() -> void +System.Windows.Forms.DataGridColumnStyle.DataGridColumnStyle() -> void +System.Windows.Forms.DataGridColumnStyle.EndUpdate() -> void +System.Windows.Forms.DataGridColumnStyle.FontChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.FontHeight.get -> int +System.Windows.Forms.DataGridColumnStyle.HeaderTextChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.MappingNameChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.NullTextChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.PropertyDescriptorChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.ReadOnlyChanged -> System.EventHandler +System.Windows.Forms.DataGridColumnStyle.ResetHeaderText() -> void +System.Windows.Forms.DataGridColumnStyle.WidthChanged -> System.EventHandler +System.Windows.Forms.DataGridLineStyle +System.Windows.Forms.DataGridLineStyle.None = 0 -> System.Windows.Forms.DataGridLineStyle +System.Windows.Forms.DataGridLineStyle.Solid = 1 -> System.Windows.Forms.DataGridLineStyle +System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGridParentRowsLabelStyle.Both = 3 -> System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGridParentRowsLabelStyle.ColumnName = 2 -> System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGridParentRowsLabelStyle.None = 0 -> System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGridParentRowsLabelStyle.TableName = 1 -> System.Windows.Forms.DataGridParentRowsLabelStyle +System.Windows.Forms.DataGridPreferredColumnWidthTypeConverter +System.Windows.Forms.DataGridPreferredColumnWidthTypeConverter.DataGridPreferredColumnWidthTypeConverter() -> void +System.Windows.Forms.DataGridTableStyle +System.Windows.Forms.DataGridTableStyle.AllowSorting.get -> bool +System.Windows.Forms.DataGridTableStyle.AllowSorting.set -> void +System.Windows.Forms.DataGridTableStyle.AllowSortingChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.AlternatingBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.AlternatingBackColor.set -> void +System.Windows.Forms.DataGridTableStyle.AlternatingBackColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.BackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.BackColor.set -> void +System.Windows.Forms.DataGridTableStyle.BackColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisible.get -> bool +System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisible.set -> void +System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisibleChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.DataGridTableStyle() -> void +System.Windows.Forms.DataGridTableStyle.DataGridTableStyle(bool isDefaultTableStyle) -> void +System.Windows.Forms.DataGridTableStyle.ForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.ForeColor.set -> void +System.Windows.Forms.DataGridTableStyle.ForeColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.GridLineColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.GridLineColor.set -> void +System.Windows.Forms.DataGridTableStyle.GridLineColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.GridLineStyle.get -> System.Windows.Forms.DataGridLineStyle +System.Windows.Forms.DataGridTableStyle.GridLineStyle.set -> void +System.Windows.Forms.DataGridTableStyle.GridLineStyleChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.HeaderBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.HeaderBackColor.set -> void +System.Windows.Forms.DataGridTableStyle.HeaderBackColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.HeaderFontChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.HeaderForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.HeaderForeColor.set -> void +System.Windows.Forms.DataGridTableStyle.HeaderForeColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.LinkColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.LinkColor.set -> void +System.Windows.Forms.DataGridTableStyle.LinkColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.LinkHoverColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.LinkHoverColor.set -> void +System.Windows.Forms.DataGridTableStyle.LinkHoverColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.MappingNameChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.PreferredColumnWidth.get -> int +System.Windows.Forms.DataGridTableStyle.PreferredColumnWidth.set -> void +System.Windows.Forms.DataGridTableStyle.PreferredColumnWidthChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.PreferredRowHeight.get -> int +System.Windows.Forms.DataGridTableStyle.PreferredRowHeight.set -> void +System.Windows.Forms.DataGridTableStyle.PreferredRowHeightChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.ReadOnlyChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.ResetAlternatingBackColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetBackColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetForeColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetGridLineColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetHeaderBackColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetHeaderFont() -> void +System.Windows.Forms.DataGridTableStyle.ResetHeaderForeColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetLinkColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetLinkHoverColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetSelectionBackColor() -> void +System.Windows.Forms.DataGridTableStyle.ResetSelectionForeColor() -> void +System.Windows.Forms.DataGridTableStyle.RowHeadersVisible.get -> bool +System.Windows.Forms.DataGridTableStyle.RowHeadersVisible.set -> void +System.Windows.Forms.DataGridTableStyle.RowHeadersVisibleChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.RowHeaderWidth.get -> int +System.Windows.Forms.DataGridTableStyle.RowHeaderWidth.set -> void +System.Windows.Forms.DataGridTableStyle.RowHeaderWidthChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.SelectionBackColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.SelectionBackColor.set -> void +System.Windows.Forms.DataGridTableStyle.SelectionBackColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.SelectionForeColor.get -> System.Drawing.Color +System.Windows.Forms.DataGridTableStyle.SelectionForeColor.set -> void +System.Windows.Forms.DataGridTableStyle.SelectionForeColorChanged -> System.EventHandler +System.Windows.Forms.DataGridTableStyle.ShouldSerializeBackColor() -> bool +System.Windows.Forms.DataGridTableStyle.ShouldSerializeForeColor() -> bool +System.Windows.Forms.DataGridTableStyle.ShouldSerializePreferredRowHeight() -> bool +System.Windows.Forms.DataGridTableStyle.ShouldSerializeSelectionBackColor() -> bool +System.Windows.Forms.DataGridTextBox +System.Windows.Forms.DataGridTextBox.DataGridTextBox() -> void +System.Windows.Forms.DataGridTextBox.IsInEditOrNavigateMode.get -> bool +System.Windows.Forms.DataGridTextBox.IsInEditOrNavigateMode.set -> void +System.Windows.Forms.DataGridTextBoxColumn +System.Windows.Forms.DataGridTextBoxColumn.DataGridTextBoxColumn() -> void +System.Windows.Forms.DataGridTextBoxColumn.EndEdit() -> void +System.Windows.Forms.DataGridTextBoxColumn.HideEditBox() -> void System.Windows.Forms.DataGridViewCellStyle.Font.get -> System.Drawing.Font? +System.Windows.Forms.DataObject.SetDataAsJson(string! format, bool autoConvert, T data) -> void +System.Windows.Forms.DataObject.SetDataAsJson(string! format, T data) -> void +System.Windows.Forms.DataObject.SetDataAsJson(T data) -> void System.Windows.Forms.DataObject.TryGetData(out T data) -> bool System.Windows.Forms.DataObject.TryGetData(string! format, bool autoConvert, out T data) -> bool System.Windows.Forms.DataObject.TryGetData(string! format, out T data) -> bool System.Windows.Forms.DataObject.TryGetData(string! format, System.Func! resolver, bool autoConvert, out T data) -> bool System.Windows.Forms.DataObjectExtensions +System.Windows.Forms.GridColumnStylesCollection +System.Windows.Forms.GridColumnStylesCollection.Clear() -> void +System.Windows.Forms.GridColumnStylesCollection.CollectionChanged -> System.ComponentModel.CollectionChangeEventHandler +System.Windows.Forms.GridColumnStylesCollection.RemoveAt(int index) -> void +System.Windows.Forms.GridColumnStylesCollection.ResetPropertyDescriptors() -> void +System.Windows.Forms.GridTablesFactory +System.Windows.Forms.GridTableStylesCollection +System.Windows.Forms.GridTableStylesCollection.Clear() -> void +System.Windows.Forms.GridTableStylesCollection.CollectionChanged -> System.ComponentModel.CollectionChangeEventHandler +System.Windows.Forms.GridTableStylesCollection.RemoveAt(int index) -> void +System.Windows.Forms.IDataGridEditingService System.Windows.Forms.ITypedDataObject System.Windows.Forms.ITypedDataObject.TryGetData(out T data) -> bool System.Windows.Forms.ITypedDataObject.TryGetData(string! format, bool autoConvert, out T data) -> bool System.Windows.Forms.ITypedDataObject.TryGetData(string! format, out T data) -> bool System.Windows.Forms.ITypedDataObject.TryGetData(string! format, System.Func! resolver, bool autoConvert, out T data) -> bool +System.Windows.Forms.MainMenu +System.Windows.Forms.MainMenu.Collapse -> System.EventHandler +System.Windows.Forms.MainMenu.MainMenu() -> void +System.Windows.Forms.Menu +System.Windows.Forms.Menu.FindMergePosition(int mergeOrder) -> int +System.Windows.Forms.Menu.Handle.get -> nint +System.Windows.Forms.Menu.MenuItemCollection +System.Windows.Forms.Menu.MenuItemCollection.Count.get -> int +System.Windows.Forms.Menu.MenuItemCollection.IsReadOnly.get -> bool +System.Windows.Forms.MenuItem +System.Windows.Forms.MenuItem.BarBreak.get -> bool +System.Windows.Forms.MenuItem.BarBreak.set -> void +System.Windows.Forms.MenuItem.Break.get -> bool +System.Windows.Forms.MenuItem.Break.set -> void +System.Windows.Forms.MenuItem.Checked.get -> bool +System.Windows.Forms.MenuItem.Checked.set -> void +System.Windows.Forms.MenuItem.Click -> System.EventHandler +System.Windows.Forms.MenuItem.DefaultItem.get -> bool +System.Windows.Forms.MenuItem.DefaultItem.set -> void +System.Windows.Forms.MenuItem.DrawItem -> System.Windows.Forms.DrawItemEventHandler +System.Windows.Forms.MenuItem.Enabled.get -> bool +System.Windows.Forms.MenuItem.Enabled.set -> void +System.Windows.Forms.MenuItem.Index.get -> int +System.Windows.Forms.MenuItem.Index.set -> void +System.Windows.Forms.MenuItem.MdiList.get -> bool +System.Windows.Forms.MenuItem.MdiList.set -> void +System.Windows.Forms.MenuItem.MeasureItem -> System.Windows.Forms.MeasureItemEventHandler +System.Windows.Forms.MenuItem.MenuID.get -> int +System.Windows.Forms.MenuItem.MenuItem() -> void +System.Windows.Forms.MenuItem.MergeOrder.get -> int +System.Windows.Forms.MenuItem.MergeOrder.set -> void +System.Windows.Forms.MenuItem.MergeType.get -> System.Windows.Forms.MenuMerge +System.Windows.Forms.MenuItem.MergeType.set -> void +System.Windows.Forms.MenuItem.Mnemonic.get -> char +System.Windows.Forms.MenuItem.OwnerDraw.get -> bool +System.Windows.Forms.MenuItem.OwnerDraw.set -> void +System.Windows.Forms.MenuItem.PerformClick() -> void +System.Windows.Forms.MenuItem.Popup -> System.EventHandler +System.Windows.Forms.MenuItem.RadioCheck.get -> bool +System.Windows.Forms.MenuItem.RadioCheck.set -> void +System.Windows.Forms.MenuItem.Select -> System.EventHandler +System.Windows.Forms.MenuItem.Shortcut.get -> System.Windows.Forms.Shortcut +System.Windows.Forms.MenuItem.Shortcut.set -> void +System.Windows.Forms.MenuItem.ShowShortcut.get -> bool +System.Windows.Forms.MenuItem.ShowShortcut.set -> void +System.Windows.Forms.MenuItem.Visible.get -> bool +System.Windows.Forms.MenuItem.Visible.set -> void +System.Windows.Forms.MenuMerge +System.Windows.Forms.MenuMerge.Add = 0 -> System.Windows.Forms.MenuMerge +System.Windows.Forms.MenuMerge.MergeItems = 2 -> System.Windows.Forms.MenuMerge +System.Windows.Forms.MenuMerge.Remove = 3 -> System.Windows.Forms.MenuMerge +System.Windows.Forms.MenuMerge.Replace = 1 -> System.Windows.Forms.MenuMerge +System.Windows.Forms.StatusBar +System.Windows.Forms.StatusBar.BackColorChanged -> System.EventHandler +System.Windows.Forms.StatusBar.BackgroundImageChanged -> System.EventHandler +System.Windows.Forms.StatusBar.BackgroundImageLayoutChanged -> System.EventHandler +System.Windows.Forms.StatusBar.DrawItem -> System.Windows.Forms.StatusBarDrawItemEventHandler +System.Windows.Forms.StatusBar.ForeColorChanged -> System.EventHandler +System.Windows.Forms.StatusBar.ImeMode.get -> System.Windows.Forms.ImeMode +System.Windows.Forms.StatusBar.ImeMode.set -> void +System.Windows.Forms.StatusBar.ImeModeChanged -> System.EventHandler +System.Windows.Forms.StatusBar.Paint -> System.Windows.Forms.PaintEventHandler +System.Windows.Forms.StatusBar.PanelClick -> System.Windows.Forms.StatusBarPanelClickEventHandler +System.Windows.Forms.StatusBar.ShowPanels.get -> bool +System.Windows.Forms.StatusBar.ShowPanels.set -> void +System.Windows.Forms.StatusBar.SizingGrip.get -> bool +System.Windows.Forms.StatusBar.SizingGrip.set -> void +System.Windows.Forms.StatusBar.StatusBar() -> void +System.Windows.Forms.StatusBar.StatusBarPanelCollection +System.Windows.Forms.StatusBar.StatusBarPanelCollection.Count.get -> int +System.Windows.Forms.StatusBar.StatusBarPanelCollection.IsReadOnly.get -> bool +System.Windows.Forms.StatusBar.TabStop.get -> bool +System.Windows.Forms.StatusBar.TabStop.set -> void +System.Windows.Forms.StatusBarDrawItemEventArgs +System.Windows.Forms.StatusBarDrawItemEventHandler +System.Windows.Forms.StatusBarPanel +System.Windows.Forms.StatusBarPanel.Alignment.get -> System.Windows.Forms.HorizontalAlignment +System.Windows.Forms.StatusBarPanel.Alignment.set -> void +System.Windows.Forms.StatusBarPanel.AutoSize.get -> System.Windows.Forms.StatusBarPanelAutoSize +System.Windows.Forms.StatusBarPanel.AutoSize.set -> void +System.Windows.Forms.StatusBarPanel.BeginInit() -> void +System.Windows.Forms.StatusBarPanel.BorderStyle.get -> System.Windows.Forms.StatusBarPanelBorderStyle +System.Windows.Forms.StatusBarPanel.BorderStyle.set -> void +System.Windows.Forms.StatusBarPanel.EndInit() -> void +System.Windows.Forms.StatusBarPanel.MinWidth.get -> int +System.Windows.Forms.StatusBarPanel.MinWidth.set -> void +System.Windows.Forms.StatusBarPanel.StatusBarPanel() -> void +System.Windows.Forms.StatusBarPanel.Style.get -> System.Windows.Forms.StatusBarPanelStyle +System.Windows.Forms.StatusBarPanel.Style.set -> void +System.Windows.Forms.StatusBarPanel.Width.get -> int +System.Windows.Forms.StatusBarPanel.Width.set -> void +System.Windows.Forms.StatusBarPanelAutoSize +System.Windows.Forms.StatusBarPanelAutoSize.Contents = 3 -> System.Windows.Forms.StatusBarPanelAutoSize +System.Windows.Forms.StatusBarPanelAutoSize.None = 1 -> System.Windows.Forms.StatusBarPanelAutoSize +System.Windows.Forms.StatusBarPanelAutoSize.Spring = 2 -> System.Windows.Forms.StatusBarPanelAutoSize +System.Windows.Forms.StatusBarPanelBorderStyle +System.Windows.Forms.StatusBarPanelBorderStyle.None = 1 -> System.Windows.Forms.StatusBarPanelBorderStyle +System.Windows.Forms.StatusBarPanelBorderStyle.Raised = 2 -> System.Windows.Forms.StatusBarPanelBorderStyle +System.Windows.Forms.StatusBarPanelBorderStyle.Sunken = 3 -> System.Windows.Forms.StatusBarPanelBorderStyle +System.Windows.Forms.StatusBarPanelClickEventArgs +System.Windows.Forms.StatusBarPanelClickEventHandler +System.Windows.Forms.StatusBarPanelStyle +System.Windows.Forms.StatusBarPanelStyle.OwnerDraw = 2 -> System.Windows.Forms.StatusBarPanelStyle +System.Windows.Forms.StatusBarPanelStyle.Text = 1 -> System.Windows.Forms.StatusBarPanelStyle +System.Windows.Forms.ToolBar +System.Windows.Forms.ToolBar.Appearance.get -> System.Windows.Forms.ToolBarAppearance +System.Windows.Forms.ToolBar.Appearance.set -> void +System.Windows.Forms.ToolBar.AutoSizeChanged -> System.EventHandler +System.Windows.Forms.ToolBar.BackColorChanged -> System.EventHandler +System.Windows.Forms.ToolBar.BackgroundImageChanged -> System.EventHandler +System.Windows.Forms.ToolBar.BackgroundImageLayoutChanged -> System.EventHandler +System.Windows.Forms.ToolBar.BorderStyle.get -> System.Windows.Forms.BorderStyle +System.Windows.Forms.ToolBar.BorderStyle.set -> void +System.Windows.Forms.ToolBar.ButtonClick -> System.Windows.Forms.ToolBarButtonClickEventHandler +System.Windows.Forms.ToolBar.ButtonDropDown -> System.Windows.Forms.ToolBarButtonClickEventHandler +System.Windows.Forms.ToolBar.ButtonSize.get -> System.Drawing.Size +System.Windows.Forms.ToolBar.ButtonSize.set -> void +System.Windows.Forms.ToolBar.Divider.get -> bool +System.Windows.Forms.ToolBar.Divider.set -> void +System.Windows.Forms.ToolBar.DropDownArrows.get -> bool +System.Windows.Forms.ToolBar.DropDownArrows.set -> void +System.Windows.Forms.ToolBar.ForeColorChanged -> System.EventHandler +System.Windows.Forms.ToolBar.ImageSize.get -> System.Drawing.Size +System.Windows.Forms.ToolBar.ImeMode.get -> System.Windows.Forms.ImeMode +System.Windows.Forms.ToolBar.ImeMode.set -> void +System.Windows.Forms.ToolBar.ImeModeChanged -> System.EventHandler +System.Windows.Forms.ToolBar.Paint -> System.Windows.Forms.PaintEventHandler +System.Windows.Forms.ToolBar.RightToLeftChanged -> System.EventHandler +System.Windows.Forms.ToolBar.ShowToolTips.get -> bool +System.Windows.Forms.ToolBar.ShowToolTips.set -> void +System.Windows.Forms.ToolBar.TabStop.get -> bool +System.Windows.Forms.ToolBar.TabStop.set -> void +System.Windows.Forms.ToolBar.TextAlign.get -> System.Windows.Forms.ToolBarTextAlign +System.Windows.Forms.ToolBar.TextAlign.set -> void +System.Windows.Forms.ToolBar.TextChanged -> System.EventHandler +System.Windows.Forms.ToolBar.ToolBar() -> void +System.Windows.Forms.ToolBar.ToolBarButtonCollection +System.Windows.Forms.ToolBar.ToolBarButtonCollection.Clear() -> void +System.Windows.Forms.ToolBar.ToolBarButtonCollection.Count.get -> int +System.Windows.Forms.ToolBar.ToolBarButtonCollection.IsReadOnly.get -> bool +System.Windows.Forms.ToolBar.ToolBarButtonCollection.RemoveAt(int index) -> void +System.Windows.Forms.ToolBar.Wrappable.get -> bool +System.Windows.Forms.ToolBar.Wrappable.set -> void +System.Windows.Forms.ToolBarAppearance +System.Windows.Forms.ToolBarAppearance.Flat = 1 -> System.Windows.Forms.ToolBarAppearance +System.Windows.Forms.ToolBarAppearance.Normal = 0 -> System.Windows.Forms.ToolBarAppearance +System.Windows.Forms.ToolBarButton +System.Windows.Forms.ToolBarButton.Enabled.get -> bool +System.Windows.Forms.ToolBarButton.Enabled.set -> void +System.Windows.Forms.ToolBarButton.ImageIndex.get -> int +System.Windows.Forms.ToolBarButton.ImageIndex.set -> void +System.Windows.Forms.ToolBarButton.PartialPush.get -> bool +System.Windows.Forms.ToolBarButton.PartialPush.set -> void +System.Windows.Forms.ToolBarButton.Pushed.get -> bool +System.Windows.Forms.ToolBarButton.Pushed.set -> void +System.Windows.Forms.ToolBarButton.Rectangle.get -> System.Drawing.Rectangle +System.Windows.Forms.ToolBarButton.Style.get -> System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarButton.Style.set -> void +System.Windows.Forms.ToolBarButton.ToolBarButton() -> void +System.Windows.Forms.ToolBarButton.Visible.get -> bool +System.Windows.Forms.ToolBarButton.Visible.set -> void +System.Windows.Forms.ToolBarButtonClickEventArgs +System.Windows.Forms.ToolBarButtonClickEventHandler +System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarButtonStyle.DropDownButton = 4 -> System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarButtonStyle.PushButton = 1 -> System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarButtonStyle.Separator = 3 -> System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarButtonStyle.ToggleButton = 2 -> System.Windows.Forms.ToolBarButtonStyle +System.Windows.Forms.ToolBarTextAlign +System.Windows.Forms.ToolBarTextAlign.Right = 1 -> System.Windows.Forms.ToolBarTextAlign +System.Windows.Forms.ToolBarTextAlign.Underneath = 0 -> System.Windows.Forms.ToolBarTextAlign +virtual System.Windows.Forms.ContextMenu.RightToLeft.get -> System.Windows.Forms.RightToLeft +virtual System.Windows.Forms.ContextMenu.RightToLeft.set -> void +virtual System.Windows.Forms.DataGrid.CancelEditing() -> void +virtual System.Windows.Forms.DataGrid.ColumnStartedEditing(System.Drawing.Rectangle bounds) -> void +virtual System.Windows.Forms.DataGrid.ShouldSerializeAlternatingBackColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeBackgroundColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeCaptionBackColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeCaptionForeColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeGridLineColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeHeaderBackColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeHeaderForeColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeLinkHoverColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeParentRowsBackColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeParentRowsForeColor() -> bool +virtual System.Windows.Forms.DataGrid.ShouldSerializeSelectionForeColor() -> bool +virtual System.Windows.Forms.DataGridColumnStyle.Alignment.get -> System.Windows.Forms.HorizontalAlignment +virtual System.Windows.Forms.DataGridColumnStyle.Alignment.set -> void +virtual System.Windows.Forms.DataGridColumnStyle.ConcedeFocus() -> void +virtual System.Windows.Forms.DataGridColumnStyle.EnterNullValue() -> void +virtual System.Windows.Forms.DataGridColumnStyle.Invalidate() -> void +virtual System.Windows.Forms.DataGridColumnStyle.ReadOnly.get -> bool +virtual System.Windows.Forms.DataGridColumnStyle.ReadOnly.set -> void +virtual System.Windows.Forms.DataGridColumnStyle.ReleaseHostedControl() -> void +virtual System.Windows.Forms.DataGridColumnStyle.Width.get -> int +virtual System.Windows.Forms.DataGridColumnStyle.Width.set -> void +virtual System.Windows.Forms.DataGridTableStyle.ReadOnly.get -> bool +virtual System.Windows.Forms.DataGridTableStyle.ReadOnly.set -> void +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeAlternatingBackColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeGridLineColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeHeaderBackColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeHeaderForeColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeLinkColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeLinkHoverColor() -> bool +virtual System.Windows.Forms.DataGridTableStyle.ShouldSerializeSelectionForeColor() -> bool virtual System.Windows.Forms.DataObject.TryGetDataCore(string! format, System.Func? resolver, bool autoConvert, out T data) -> bool +virtual System.Windows.Forms.MainMenu.RightToLeft.get -> System.Windows.Forms.RightToLeft +virtual System.Windows.Forms.MainMenu.RightToLeft.set -> void +virtual System.Windows.Forms.Menu.CreateMenuHandle() -> nint +virtual System.Windows.Forms.Menu.IsParent.get -> bool +virtual System.Windows.Forms.Menu.MenuItemCollection.Clear() -> void +virtual System.Windows.Forms.Menu.MenuItemCollection.RemoveAt(int index) -> void +virtual System.Windows.Forms.Menu.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) -> bool +virtual System.Windows.Forms.MenuItem.PerformSelect() -> void +virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.Clear() -> void +virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.RemoveAt(int index) -> void [WFO5001]static System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode systemColorMode) -> void [WFO5001]System.Windows.Forms.Form.FormBorderColorChanged -> System.EventHandler? [WFO5001]System.Windows.Forms.Form.FormCaptionBackColorChanged -> System.EventHandler? @@ -40,6 +554,324 @@ virtual System.Windows.Forms.DataObject.TryGetDataCore(string! format, System [WFO5002]System.Windows.Forms.Form.ShowAsync(System.Windows.Forms.IWin32Window? owner = null) -> System.Threading.Tasks.Task! [WFO5002]System.Windows.Forms.Form.ShowDialogAsync() -> System.Threading.Tasks.Task! [WFO5002]System.Windows.Forms.Form.ShowDialogAsync(System.Windows.Forms.IWin32Window! owner) -> System.Threading.Tasks.Task! -System.Windows.Forms.DataObject.SetDataAsJson(string! format, bool autoConvert, T data) -> void -System.Windows.Forms.DataObject.SetDataAsJson(string! format, T data) -> void -System.Windows.Forms.DataObject.SetDataAsJson(T data) -> void +~abstract System.Windows.Forms.DataGridColumnStyle.Commit(System.Windows.Forms.CurrencyManager dataSource, int rowNum) -> bool +~abstract System.Windows.Forms.DataGridColumnStyle.Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string displayText, bool cellIsVisible) -> void +~abstract System.Windows.Forms.DataGridColumnStyle.GetPreferredHeight(System.Drawing.Graphics g, object value) -> int +~abstract System.Windows.Forms.DataGridColumnStyle.GetPreferredSize(System.Drawing.Graphics g, object value) -> System.Drawing.Size +~abstract System.Windows.Forms.DataGridColumnStyle.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum) -> void +~abstract System.Windows.Forms.DataGridColumnStyle.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, bool alignToRight) -> void +~override System.Windows.Forms.DataGrid.BackgroundImage.get -> System.Drawing.Image +~override System.Windows.Forms.DataGrid.BackgroundImage.set -> void +~override System.Windows.Forms.DataGrid.Cursor.get -> System.Windows.Forms.Cursor +~override System.Windows.Forms.DataGrid.Cursor.set -> void +~override System.Windows.Forms.DataGrid.Text.get -> string +~override System.Windows.Forms.DataGrid.Text.set -> void +~override System.Windows.Forms.DataGridBoolColumn.Commit(System.Windows.Forms.CurrencyManager dataSource, int rowNum) -> bool +~override System.Windows.Forms.DataGridBoolColumn.Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string displayText, bool cellIsVisible) -> void +~override System.Windows.Forms.DataGridBoolColumn.GetPreferredHeight(System.Drawing.Graphics g, object value) -> int +~override System.Windows.Forms.DataGridBoolColumn.GetPreferredSize(System.Drawing.Graphics g, object value) -> System.Drawing.Size +~override System.Windows.Forms.DataGridBoolColumn.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum) -> void +~override System.Windows.Forms.DataGridBoolColumn.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, bool alignToRight) -> void +~override System.Windows.Forms.DataGridTextBoxColumn.Commit(System.Windows.Forms.CurrencyManager dataSource, int rowNum) -> bool +~override System.Windows.Forms.DataGridTextBoxColumn.Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string displayText, bool cellIsVisible) -> void +~override System.Windows.Forms.DataGridTextBoxColumn.GetPreferredHeight(System.Drawing.Graphics g, object value) -> int +~override System.Windows.Forms.DataGridTextBoxColumn.GetPreferredSize(System.Drawing.Graphics g, object value) -> System.Drawing.Size +~override System.Windows.Forms.DataGridTextBoxColumn.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum) -> void +~override System.Windows.Forms.DataGridTextBoxColumn.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, bool alignToRight) -> void +~override System.Windows.Forms.DataGridTextBoxColumn.PropertyDescriptor.set -> void +~override System.Windows.Forms.StatusBar.BackgroundImage.get -> System.Drawing.Image +~override System.Windows.Forms.StatusBar.BackgroundImage.set -> void +~override System.Windows.Forms.StatusBar.Font.get -> System.Drawing.Font +~override System.Windows.Forms.StatusBar.Font.set -> void +~override System.Windows.Forms.StatusBar.Text.get -> string +~override System.Windows.Forms.StatusBar.Text.set -> void +~override System.Windows.Forms.ToolBar.BackgroundImage.get -> System.Drawing.Image +~override System.Windows.Forms.ToolBar.BackgroundImage.set -> void +~override System.Windows.Forms.ToolBar.Text.get -> string +~override System.Windows.Forms.ToolBar.Text.set -> void +~static readonly System.Windows.Forms.DataGrid.HitTestInfo.Nowhere -> System.Windows.Forms.DataGrid.HitTestInfo +~static readonly System.Windows.Forms.DataGridTableStyle.DefaultTableStyle -> System.Windows.Forms.DataGridTableStyle +~static System.Windows.Forms.DataGridColumnStyle.CompModSwitches.DGEditColumnEditing.get -> System.Diagnostics.TraceSwitch +~static System.Windows.Forms.GridTablesFactory.CreateGridTables(System.Windows.Forms.DataGridTableStyle gridTable, object dataSource, string dataMember, System.Windows.Forms.BindingContext bindingManager) -> System.Windows.Forms.DataGridTableStyle[] +~System.Windows.Forms.ContextMenu.ContextMenu(System.Windows.Forms.MenuItem[] menuItems) -> void +~System.Windows.Forms.ContextMenu.Show(System.Windows.Forms.Control control, System.Drawing.Point pos) -> void +~System.Windows.Forms.ContextMenu.Show(System.Windows.Forms.Control control, System.Drawing.Point pos, System.Windows.Forms.LeftRightAlignment alignment) -> void +~System.Windows.Forms.ContextMenu.SourceControl.get -> System.Windows.Forms.Control +~System.Windows.Forms.DataGrid.BeginEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber) -> bool +~System.Windows.Forms.DataGrid.CaptionFont.get -> System.Drawing.Font +~System.Windows.Forms.DataGrid.CaptionFont.set -> void +~System.Windows.Forms.DataGrid.CaptionText.get -> string +~System.Windows.Forms.DataGrid.CaptionText.set -> void +~System.Windows.Forms.DataGrid.DataMember.get -> string +~System.Windows.Forms.DataGrid.DataMember.set -> void +~System.Windows.Forms.DataGrid.DataSource.get -> object +~System.Windows.Forms.DataGrid.DataSource.set -> void +~System.Windows.Forms.DataGrid.EndEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort) -> bool +~System.Windows.Forms.DataGrid.HeaderFont.get -> System.Drawing.Font +~System.Windows.Forms.DataGrid.HeaderFont.set -> void +~System.Windows.Forms.DataGrid.HitTest(int x, int y) -> System.Windows.Forms.DataGrid.HitTestInfo +~System.Windows.Forms.DataGrid.HitTest(System.Drawing.Point position) -> System.Windows.Forms.DataGrid.HitTestInfo +~System.Windows.Forms.DataGrid.HorizScrollBar.get -> System.Windows.Forms.ScrollBar +~System.Windows.Forms.DataGrid.ListManager.get -> System.Windows.Forms.CurrencyManager +~System.Windows.Forms.DataGrid.ListManager.set -> void +~System.Windows.Forms.DataGrid.NavigateTo(int rowNumber, string relationName) -> void +~System.Windows.Forms.DataGrid.OnBackButtonClicked(object sender, System.EventArgs e) -> void +~System.Windows.Forms.DataGrid.OnNavigate(System.Windows.Forms.NavigateEventArgs e) -> void +~System.Windows.Forms.DataGrid.OnRowHeaderClick(System.EventArgs e) -> void +~System.Windows.Forms.DataGrid.OnScroll(System.EventArgs e) -> void +~System.Windows.Forms.DataGrid.OnShowParentDetailsButtonClicked(object sender, System.EventArgs e) -> void +~System.Windows.Forms.DataGrid.ProcessGridKey(System.Windows.Forms.KeyEventArgs ke) -> bool +~System.Windows.Forms.DataGrid.SetDataBinding(object dataSource, string dataMember) -> void +~System.Windows.Forms.DataGrid.TableStyles.get -> System.Windows.Forms.GridTableStylesCollection +~System.Windows.Forms.DataGrid.this[int rowIndex, int columnIndex].get -> object +~System.Windows.Forms.DataGrid.this[int rowIndex, int columnIndex].set -> void +~System.Windows.Forms.DataGrid.this[System.Windows.Forms.DataGridCell cell].get -> object +~System.Windows.Forms.DataGrid.this[System.Windows.Forms.DataGridCell cell].set -> void +~System.Windows.Forms.DataGrid.VertScrollBar.get -> System.Windows.Forms.ScrollBar +~System.Windows.Forms.DataGridBoolColumn.DataGridBoolColumn(System.ComponentModel.PropertyDescriptor prop) -> void +~System.Windows.Forms.DataGridBoolColumn.DataGridBoolColumn(System.ComponentModel.PropertyDescriptor prop, bool isDefault) -> void +~System.Windows.Forms.DataGridBoolColumn.FalseValue.get -> object +~System.Windows.Forms.DataGridBoolColumn.FalseValue.set -> void +~System.Windows.Forms.DataGridBoolColumn.NullValue.get -> object +~System.Windows.Forms.DataGridBoolColumn.NullValue.set -> void +~System.Windows.Forms.DataGridBoolColumn.TrueValue.get -> object +~System.Windows.Forms.DataGridBoolColumn.TrueValue.set -> void +~System.Windows.Forms.DataGridColumnStyle.CheckValidDataSource(System.Windows.Forms.CurrencyManager value) -> void +~System.Windows.Forms.DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.DataGridColumnHeaderAccessibleObject(System.Windows.Forms.DataGridColumnStyle owner) -> void +~System.Windows.Forms.DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.Owner.get -> System.Windows.Forms.DataGridColumnStyle +~System.Windows.Forms.DataGridColumnStyle.DataGridColumnStyle(System.ComponentModel.PropertyDescriptor prop) -> void +~System.Windows.Forms.DataGridColumnStyle.HeaderAccessibleObject.get -> System.Windows.Forms.AccessibleObject +~System.Windows.Forms.DataGridColumnStyle.MappingName.get -> string +~System.Windows.Forms.DataGridColumnStyle.MappingName.set -> void +~System.Windows.Forms.DataGridTableStyle.BeginEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber) -> bool +~System.Windows.Forms.DataGridTableStyle.DataGridTableStyle(System.Windows.Forms.CurrencyManager listManager) -> void +~System.Windows.Forms.DataGridTableStyle.EndEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort) -> bool +~System.Windows.Forms.DataGridTableStyle.HeaderFont.get -> System.Drawing.Font +~System.Windows.Forms.DataGridTableStyle.HeaderFont.set -> void +~System.Windows.Forms.DataGridTableStyle.MappingName.get -> string +~System.Windows.Forms.DataGridTableStyle.MappingName.set -> void +~System.Windows.Forms.DataGridTextBox.SetDataGrid(System.Windows.Forms.DataGrid parentGrid) -> void +~System.Windows.Forms.DataGridTextBoxColumn.DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop) -> void +~System.Windows.Forms.DataGridTextBoxColumn.DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, bool isDefault) -> void +~System.Windows.Forms.DataGridTextBoxColumn.DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, string format) -> void +~System.Windows.Forms.DataGridTextBoxColumn.DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, string format, bool isDefault) -> void +~System.Windows.Forms.DataGridTextBoxColumn.Format.get -> string +~System.Windows.Forms.DataGridTextBoxColumn.Format.set -> void +~System.Windows.Forms.DataGridTextBoxColumn.FormatInfo.get -> System.IFormatProvider +~System.Windows.Forms.DataGridTextBoxColumn.FormatInfo.set -> void +~System.Windows.Forms.DataGridTextBoxColumn.PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string text, bool alignToRight) -> void +~System.Windows.Forms.DataGridTextBoxColumn.PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle textBounds, string text, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight) -> void +~System.Windows.Forms.Form.Menu.get -> System.Windows.Forms.MainMenu +~System.Windows.Forms.Form.Menu.set -> void +~System.Windows.Forms.Form.MergedMenu.get -> System.Windows.Forms.MainMenu +~System.Windows.Forms.GridColumnStylesCollection.AddRange(System.Windows.Forms.DataGridColumnStyle[] columns) -> void +~System.Windows.Forms.GridColumnStylesCollection.Contains(string name) -> bool +~System.Windows.Forms.GridColumnStylesCollection.Contains(System.ComponentModel.PropertyDescriptor propertyDescriptor) -> bool +~System.Windows.Forms.GridColumnStylesCollection.Contains(System.Windows.Forms.DataGridColumnStyle column) -> bool +~System.Windows.Forms.GridColumnStylesCollection.IndexOf(System.Windows.Forms.DataGridColumnStyle element) -> int +~System.Windows.Forms.GridColumnStylesCollection.Remove(System.Windows.Forms.DataGridColumnStyle column) -> void +~System.Windows.Forms.GridColumnStylesCollection.this[int index].get -> System.Windows.Forms.DataGridColumnStyle +~System.Windows.Forms.GridColumnStylesCollection.this[string columnName].get -> System.Windows.Forms.DataGridColumnStyle +~System.Windows.Forms.GridColumnStylesCollection.this[System.ComponentModel.PropertyDescriptor propertyDesciptor].get -> System.Windows.Forms.DataGridColumnStyle +~System.Windows.Forms.GridTableStylesCollection.Contains(string name) -> bool +~System.Windows.Forms.GridTableStylesCollection.Contains(System.Windows.Forms.DataGridTableStyle table) -> bool +~System.Windows.Forms.GridTableStylesCollection.Remove(System.Windows.Forms.DataGridTableStyle table) -> void +~System.Windows.Forms.GridTableStylesCollection.this[int index].get -> System.Windows.Forms.DataGridTableStyle +~System.Windows.Forms.GridTableStylesCollection.this[string tableName].get -> System.Windows.Forms.DataGridTableStyle +~System.Windows.Forms.IDataGridEditingService.BeginEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber) -> bool +~System.Windows.Forms.IDataGridEditingService.EndEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort) -> bool +~System.Windows.Forms.MainMenu.GetForm() -> System.Windows.Forms.Form +~System.Windows.Forms.MainMenu.MainMenu(System.ComponentModel.IContainer container) -> void +~System.Windows.Forms.MainMenu.MainMenu(System.Windows.Forms.MenuItem[] items) -> void +~System.Windows.Forms.Menu.CloneMenu(System.Windows.Forms.Menu menuSrc) -> void +~System.Windows.Forms.Menu.FindMenuItem(int type, nint value) -> System.Windows.Forms.MenuItem +~System.Windows.Forms.Menu.GetContextMenu() -> System.Windows.Forms.ContextMenu +~System.Windows.Forms.Menu.GetMainMenu() -> System.Windows.Forms.MainMenu +~System.Windows.Forms.Menu.MdiListItem.get -> System.Windows.Forms.MenuItem +~System.Windows.Forms.Menu.Menu(System.Windows.Forms.MenuItem[] items) -> void +~System.Windows.Forms.Menu.MenuItemCollection.Contains(System.Windows.Forms.MenuItem value) -> bool +~System.Windows.Forms.Menu.MenuItemCollection.CopyTo(System.Array dest, int index) -> void +~System.Windows.Forms.Menu.MenuItemCollection.Find(string key, bool searchAllChildren) -> System.Windows.Forms.MenuItem[] +~System.Windows.Forms.Menu.MenuItemCollection.GetEnumerator() -> System.Collections.IEnumerator +~System.Windows.Forms.Menu.MenuItemCollection.IndexOf(System.Windows.Forms.MenuItem value) -> int +~System.Windows.Forms.Menu.MenuItemCollection.MenuItemCollection(System.Windows.Forms.Menu owner) -> void +~System.Windows.Forms.Menu.MenuItems.get -> System.Windows.Forms.Menu.MenuItemCollection +~System.Windows.Forms.Menu.Name.get -> string +~System.Windows.Forms.Menu.Name.set -> void +~System.Windows.Forms.Menu.Tag.get -> object +~System.Windows.Forms.Menu.Tag.set -> void +~System.Windows.Forms.MenuItem.CloneMenu(System.Windows.Forms.MenuItem itemSrc) -> void +~System.Windows.Forms.MenuItem.MenuItem(string text) -> void +~System.Windows.Forms.MenuItem.MenuItem(string text, System.EventHandler onClick) -> void +~System.Windows.Forms.MenuItem.MenuItem(string text, System.EventHandler onClick, System.Windows.Forms.Shortcut shortcut) -> void +~System.Windows.Forms.MenuItem.MenuItem(string text, System.Windows.Forms.MenuItem[] items) -> void +~System.Windows.Forms.MenuItem.MenuItem(System.Windows.Forms.MenuMerge mergeType, int mergeOrder, System.Windows.Forms.Shortcut shortcut, string text, System.EventHandler onClick, System.EventHandler onPopup, System.EventHandler onSelect, System.Windows.Forms.MenuItem[] items) -> void +~System.Windows.Forms.MenuItem.MergeMenu(System.Windows.Forms.MenuItem itemSrc) -> void +~System.Windows.Forms.MenuItem.Parent.get -> System.Windows.Forms.Menu +~System.Windows.Forms.MenuItem.Text.get -> string +~System.Windows.Forms.MenuItem.Text.set -> void +~System.Windows.Forms.StatusBar.Panels.get -> System.Windows.Forms.StatusBar.StatusBarPanelCollection +~System.Windows.Forms.StatusBar.StatusBarPanelCollection.Contains(System.Windows.Forms.StatusBarPanel panel) -> bool +~System.Windows.Forms.StatusBar.StatusBarPanelCollection.GetEnumerator() -> System.Collections.IEnumerator +~System.Windows.Forms.StatusBar.StatusBarPanelCollection.IndexOf(System.Windows.Forms.StatusBarPanel panel) -> int +~System.Windows.Forms.StatusBar.StatusBarPanelCollection.StatusBarPanelCollection(System.Windows.Forms.StatusBar owner) -> void +~System.Windows.Forms.StatusBarDrawItemEventArgs.Panel.get -> System.Windows.Forms.StatusBarPanel +~System.Windows.Forms.StatusBarDrawItemEventArgs.StatusBarDrawItemEventArgs(System.Drawing.Graphics g, System.Drawing.Font font, System.Drawing.Rectangle r, int itemId, System.Windows.Forms.DrawItemState itemState, System.Windows.Forms.StatusBarPanel panel) -> void +~System.Windows.Forms.StatusBarDrawItemEventArgs.StatusBarDrawItemEventArgs(System.Drawing.Graphics g, System.Drawing.Font font, System.Drawing.Rectangle r, int itemId, System.Windows.Forms.DrawItemState itemState, System.Windows.Forms.StatusBarPanel panel, System.Drawing.Color foreColor, System.Drawing.Color backColor) -> void +~System.Windows.Forms.StatusBarPanel.Icon.get -> System.Drawing.Icon +~System.Windows.Forms.StatusBarPanel.Icon.set -> void +~System.Windows.Forms.StatusBarPanel.Name.get -> string +~System.Windows.Forms.StatusBarPanel.Name.set -> void +~System.Windows.Forms.StatusBarPanel.Parent.get -> System.Windows.Forms.StatusBar +~System.Windows.Forms.StatusBarPanel.Tag.get -> object +~System.Windows.Forms.StatusBarPanel.Tag.set -> void +~System.Windows.Forms.StatusBarPanel.Text.get -> string +~System.Windows.Forms.StatusBarPanel.Text.set -> void +~System.Windows.Forms.StatusBarPanel.ToolTipText.get -> string +~System.Windows.Forms.StatusBarPanel.ToolTipText.set -> void +~System.Windows.Forms.StatusBarPanelClickEventArgs.StatusBarPanel.get -> System.Windows.Forms.StatusBarPanel +~System.Windows.Forms.StatusBarPanelClickEventArgs.StatusBarPanelClickEventArgs(System.Windows.Forms.StatusBarPanel statusBarPanel, System.Windows.Forms.MouseButtons button, int clicks, int x, int y) -> void +~System.Windows.Forms.ToolBar.Buttons.get -> System.Windows.Forms.ToolBar.ToolBarButtonCollection +~System.Windows.Forms.ToolBar.ImageList.get -> System.Windows.Forms.ImageList +~System.Windows.Forms.ToolBar.ImageList.set -> void +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.Add(string text) -> int +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.Add(System.Windows.Forms.ToolBarButton button) -> int +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.AddRange(System.Windows.Forms.ToolBarButton[] buttons) -> void +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.Contains(System.Windows.Forms.ToolBarButton button) -> bool +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.GetEnumerator() -> System.Collections.IEnumerator +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.IndexOf(System.Windows.Forms.ToolBarButton button) -> int +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.Insert(int index, System.Windows.Forms.ToolBarButton button) -> void +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.Remove(System.Windows.Forms.ToolBarButton button) -> void +~System.Windows.Forms.ToolBar.ToolBarButtonCollection.ToolBarButtonCollection(System.Windows.Forms.ToolBar owner) -> void +~System.Windows.Forms.ToolBarButton.DropDownMenu.get -> System.Windows.Forms.Menu +~System.Windows.Forms.ToolBarButton.DropDownMenu.set -> void +~System.Windows.Forms.ToolBarButton.ImageKey.get -> string +~System.Windows.Forms.ToolBarButton.ImageKey.set -> void +~System.Windows.Forms.ToolBarButton.Name.get -> string +~System.Windows.Forms.ToolBarButton.Name.set -> void +~System.Windows.Forms.ToolBarButton.Parent.get -> System.Windows.Forms.ToolBar +~System.Windows.Forms.ToolBarButton.Tag.get -> object +~System.Windows.Forms.ToolBarButton.Tag.set -> void +~System.Windows.Forms.ToolBarButton.Text.get -> string +~System.Windows.Forms.ToolBarButton.Text.set -> void +~System.Windows.Forms.ToolBarButton.ToolBarButton(string text) -> void +~System.Windows.Forms.ToolBarButton.ToolTipText.get -> string +~System.Windows.Forms.ToolBarButton.ToolTipText.set -> void +~System.Windows.Forms.ToolBarButtonClickEventArgs.Button.get -> System.Windows.Forms.ToolBarButton +~System.Windows.Forms.ToolBarButtonClickEventArgs.Button.set -> void +~System.Windows.Forms.ToolBarButtonClickEventArgs.ToolBarButtonClickEventArgs(System.Windows.Forms.ToolBarButton button) -> void +~virtual System.Windows.Forms.ContextMenu.OnCollapse(System.EventArgs e) -> void +~virtual System.Windows.Forms.ContextMenu.OnPopup(System.EventArgs e) -> void +~virtual System.Windows.Forms.ContextMenu.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData, System.Windows.Forms.Control control) -> bool +~virtual System.Windows.Forms.Control.ContextMenu.get -> System.Windows.Forms.ContextMenu +~virtual System.Windows.Forms.Control.ContextMenu.set -> void +~virtual System.Windows.Forms.Control.OnContextMenuChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.ColumnStartedEditing(System.Windows.Forms.Control editingControl) -> void +~virtual System.Windows.Forms.DataGrid.CreateGridColumn(System.ComponentModel.PropertyDescriptor prop) -> System.Windows.Forms.DataGridColumnStyle +~virtual System.Windows.Forms.DataGrid.CreateGridColumn(System.ComponentModel.PropertyDescriptor prop, bool isDefault) -> System.Windows.Forms.DataGridColumnStyle +~virtual System.Windows.Forms.DataGrid.GetOutputTextDelimiter() -> string +~virtual System.Windows.Forms.DataGrid.GridHScrolled(object sender, System.Windows.Forms.ScrollEventArgs se) -> void +~virtual System.Windows.Forms.DataGrid.GridVScrolled(object sender, System.Windows.Forms.ScrollEventArgs se) -> void +~virtual System.Windows.Forms.DataGrid.OnAllowNavigationChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnBackgroundColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnBorderStyleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnCaptionVisibleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnCurrentCellChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnDataSourceChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnFlatModeChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnParentRowsLabelStyleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnParentRowsVisibleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGrid.OnReadOnlyChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.ColumnStartedEditing(System.Windows.Forms.Control editingControl) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.CreateHeaderAccessibleObject() -> System.Windows.Forms.AccessibleObject +~virtual System.Windows.Forms.DataGridColumnStyle.DataGridTableStyle.get -> System.Windows.Forms.DataGridTableStyle +~virtual System.Windows.Forms.DataGridColumnStyle.Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string displayText) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum) -> object +~virtual System.Windows.Forms.DataGridColumnStyle.HeaderText.get -> string +~virtual System.Windows.Forms.DataGridColumnStyle.HeaderText.set -> void +~virtual System.Windows.Forms.DataGridColumnStyle.NullText.get -> string +~virtual System.Windows.Forms.DataGridColumnStyle.NullText.set -> void +~virtual System.Windows.Forms.DataGridColumnStyle.Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.PropertyDescriptor.get -> System.ComponentModel.PropertyDescriptor +~virtual System.Windows.Forms.DataGridColumnStyle.PropertyDescriptor.set -> void +~virtual System.Windows.Forms.DataGridColumnStyle.SetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum, object value) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.SetDataGrid(System.Windows.Forms.DataGrid value) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.SetDataGridInColumn(System.Windows.Forms.DataGrid value) -> void +~virtual System.Windows.Forms.DataGridColumnStyle.UpdateUI(System.Windows.Forms.CurrencyManager source, int rowNum, string displayText) -> void +~virtual System.Windows.Forms.DataGridTableStyle.CreateGridColumn(System.ComponentModel.PropertyDescriptor prop) -> System.Windows.Forms.DataGridColumnStyle +~virtual System.Windows.Forms.DataGridTableStyle.CreateGridColumn(System.ComponentModel.PropertyDescriptor prop, bool isDefault) -> System.Windows.Forms.DataGridColumnStyle +~virtual System.Windows.Forms.DataGridTableStyle.DataGrid.get -> System.Windows.Forms.DataGrid +~virtual System.Windows.Forms.DataGridTableStyle.DataGrid.set -> void +~virtual System.Windows.Forms.DataGridTableStyle.GridColumnStyles.get -> System.Windows.Forms.GridColumnStylesCollection +~virtual System.Windows.Forms.DataGridTableStyle.OnAllowSortingChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnAlternatingBackColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnBackColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnColumnHeadersVisibleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnForeColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnGridLineColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnGridLineStyleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnHeaderBackColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnHeaderFontChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnHeaderForeColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnLinkColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnLinkHoverColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnMappingNameChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnPreferredColumnWidthChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnPreferredRowHeightChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnReadOnlyChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnRowHeadersVisibleChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnRowHeaderWidthChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnSelectionBackColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTableStyle.OnSelectionForeColorChanged(System.EventArgs e) -> void +~virtual System.Windows.Forms.DataGridTextBoxColumn.TextBox.get -> System.Windows.Forms.TextBox +~virtual System.Windows.Forms.GridColumnStylesCollection.Add(System.Windows.Forms.DataGridColumnStyle column) -> int +~virtual System.Windows.Forms.GridTableStylesCollection.Add(System.Windows.Forms.DataGridTableStyle table) -> int +~virtual System.Windows.Forms.GridTableStylesCollection.AddRange(System.Windows.Forms.DataGridTableStyle[] tables) -> void +~virtual System.Windows.Forms.MainMenu.CloneMenu() -> System.Windows.Forms.MainMenu +~virtual System.Windows.Forms.MainMenu.OnCollapse(System.EventArgs e) -> void +~virtual System.Windows.Forms.Menu.MenuItemCollection.Add(int index, System.Windows.Forms.MenuItem item) -> int +~virtual System.Windows.Forms.Menu.MenuItemCollection.Add(string caption) -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.Menu.MenuItemCollection.Add(string caption, System.EventHandler onClick) -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.Menu.MenuItemCollection.Add(string caption, System.Windows.Forms.MenuItem[] items) -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.Menu.MenuItemCollection.Add(System.Windows.Forms.MenuItem item) -> int +~virtual System.Windows.Forms.Menu.MenuItemCollection.AddRange(System.Windows.Forms.MenuItem[] items) -> void +~virtual System.Windows.Forms.Menu.MenuItemCollection.ContainsKey(string key) -> bool +~virtual System.Windows.Forms.Menu.MenuItemCollection.IndexOfKey(string key) -> int +~virtual System.Windows.Forms.Menu.MenuItemCollection.Remove(System.Windows.Forms.MenuItem item) -> void +~virtual System.Windows.Forms.Menu.MenuItemCollection.RemoveByKey(string key) -> void +~virtual System.Windows.Forms.Menu.MenuItemCollection.this[int index].get -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.Menu.MenuItemCollection.this[string key].get -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.Menu.MergeMenu(System.Windows.Forms.Menu menuSrc) -> void +~virtual System.Windows.Forms.MenuItem.CloneMenu() -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.MenuItem.MergeMenu() -> System.Windows.Forms.MenuItem +~virtual System.Windows.Forms.MenuItem.OnClick(System.EventArgs e) -> void +~virtual System.Windows.Forms.MenuItem.OnDrawItem(System.Windows.Forms.DrawItemEventArgs e) -> void +~virtual System.Windows.Forms.MenuItem.OnInitMenuPopup(System.EventArgs e) -> void +~virtual System.Windows.Forms.MenuItem.OnMeasureItem(System.Windows.Forms.MeasureItemEventArgs e) -> void +~virtual System.Windows.Forms.MenuItem.OnPopup(System.EventArgs e) -> void +~virtual System.Windows.Forms.MenuItem.OnSelect(System.EventArgs e) -> void +~virtual System.Windows.Forms.StatusBar.OnDrawItem(System.Windows.Forms.StatusBarDrawItemEventArgs sbdievent) -> void +~virtual System.Windows.Forms.StatusBar.OnPanelClick(System.Windows.Forms.StatusBarPanelClickEventArgs e) -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.Add(string text) -> System.Windows.Forms.StatusBarPanel +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.Add(System.Windows.Forms.StatusBarPanel value) -> int +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.AddRange(System.Windows.Forms.StatusBarPanel[] panels) -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.ContainsKey(string key) -> bool +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.IndexOfKey(string key) -> int +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.Insert(int index, System.Windows.Forms.StatusBarPanel value) -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.Remove(System.Windows.Forms.StatusBarPanel value) -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.RemoveByKey(string key) -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.this[int index].get -> System.Windows.Forms.StatusBarPanel +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.this[int index].set -> void +~virtual System.Windows.Forms.StatusBar.StatusBarPanelCollection.this[string key].get -> System.Windows.Forms.StatusBarPanel +~virtual System.Windows.Forms.StatusBarDrawItemEventHandler.Invoke(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent) -> void +~virtual System.Windows.Forms.StatusBarPanelClickEventHandler.Invoke(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e) -> void +~virtual System.Windows.Forms.ToolBar.OnButtonClick(System.Windows.Forms.ToolBarButtonClickEventArgs e) -> void +~virtual System.Windows.Forms.ToolBar.OnButtonDropDown(System.Windows.Forms.ToolBarButtonClickEventArgs e) -> void +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.ContainsKey(string key) -> bool +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.IndexOfKey(string key) -> int +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.RemoveByKey(string key) -> void +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.this[int index].get -> System.Windows.Forms.ToolBarButton +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.this[int index].set -> void +~virtual System.Windows.Forms.ToolBar.ToolBarButtonCollection.this[string key].get -> System.Windows.Forms.ToolBarButton +~virtual System.Windows.Forms.ToolBarButtonClickEventHandler.Invoke(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) -> void \ No newline at end of file diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index bd5038d7524..dacaaeb5bbf 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -12845,4 +12845,52 @@ internal ToolStripControlHost? ToolStripControlHost internal HWND HWND => (HWND)Handle; internal virtual bool AllowsChildrenToShowToolTips() => true; + + // Unsupported types don't support nullability. +#nullable disable + /// + /// This property is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.ContextMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public virtual ContextMenu ContextMenu + { + get; + set; + } + + /// + /// This event is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.ContextMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public event EventHandler ContextMenuChanged + { + add { } + remove { } + } + + /// + /// This method is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.ContextMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + protected virtual void OnContextMenuChanged(EventArgs e) { } +#nullable enable } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/ContextMenu.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/ContextMenu.cs new file mode 100644 index 00000000000..8c73772752e --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/ContextMenu.cs @@ -0,0 +1,60 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[DefaultEvent(nameof(Popup))] +[Obsolete( + Obsoletions.ContextMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class ContextMenu : Menu +{ + public ContextMenu() : base(items: default) => throw new PlatformNotSupportedException(); + + public ContextMenu(MenuItem[] menuItems) : base(items: menuItems) => throw new PlatformNotSupportedException(); + + [Localizable(true)] + [DefaultValue(RightToLeft.No)] + public virtual RightToLeft RightToLeft + { + get => throw null; + set { } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Control SourceControl => throw null; + + public event EventHandler Popup + { + add { } + remove { } + } + + public event EventHandler Collapse + { + add { } + remove { } + } + + protected internal virtual void OnCollapse(EventArgs e) { } + + protected internal virtual void OnPopup(EventArgs e) { } + + protected internal virtual bool ProcessCmdKey(ref Message msg, Keys keyData, Control control) => throw null; + + public void Show(Control control, Point pos) { } + + public void Show(Control control, Point pos, LeftRightAlignment alignment) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.MenuItemCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.MenuItemCollection.cs new file mode 100644 index 00000000000..25c431d90b3 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.MenuItemCollection.cs @@ -0,0 +1,92 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +public abstract partial class Menu +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.MenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + [ListBindable(false)] + public class MenuItemCollection : IList + { + public MenuItemCollection(Menu owner) => throw new PlatformNotSupportedException(); + + public virtual MenuItem this[int index] => throw null; + + object IList.this[int index] + { + get => throw null; + set { } + } + + public virtual MenuItem this[string key] => throw null; + + public int Count => throw null; + + object ICollection.SyncRoot => throw null; + + bool ICollection.IsSynchronized => throw null; + + bool IList.IsFixedSize => throw null; + + public bool IsReadOnly => throw null; + + public virtual MenuItem Add(string caption) => throw null; + + public virtual MenuItem Add(string caption, EventHandler onClick) => throw null; + + public virtual MenuItem Add(string caption, MenuItem[] items) => throw null; + + public virtual int Add(MenuItem item) => throw null; + + public virtual int Add(int index, MenuItem item) => throw null; + + public virtual void AddRange(MenuItem[] items) { } + + int IList.Add(object value) => throw null; + + public bool Contains(MenuItem value) => throw null; + + bool IList.Contains(object value) => throw null; + + public virtual bool ContainsKey(string key) => throw null; + + public virtual void Clear() { } + + public void CopyTo(Array dest, int index) { } + + public MenuItem[] Find(string key, bool searchAllChildren) => throw null; + + public int IndexOf(MenuItem value) => throw null; + + public virtual int IndexOfKey(string key) => throw null; + + int IList.IndexOf(object value) => throw null; + + void IList.Insert(int index, object value) { } + + public IEnumerator GetEnumerator() => throw null; + + public virtual void RemoveAt(int index) { } + + public virtual void RemoveByKey(string key) { } + + public virtual void Remove(MenuItem item) { } + + void IList.Remove(object value) { } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.cs new file mode 100644 index 00000000000..16a3d6d783e --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/Menu.cs @@ -0,0 +1,80 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.MenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ListBindable(false)] +[ToolboxItemFilter("System.Windows.Forms")] +public abstract partial class Menu : Component +{ + public const int FindHandle = 0; + public const int FindShortcut = 1; + + protected Menu(MenuItem[] items) => throw new PlatformNotSupportedException(); + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IntPtr Handle => throw null; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public virtual bool IsParent => throw null; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public MenuItem MdiListItem => throw null; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string Name + { + get => throw null; + set { } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [MergableProperty(false)] + public MenuItemCollection MenuItems => throw null; + + [Localizable(false)] + [Bindable(true)] + [DefaultValue(null)] + [TypeConverter(typeof(StringConverter))] + public object Tag + { + get => throw null; + set { } + } + + protected internal void CloneMenu(Menu menuSrc) { } + + protected virtual IntPtr CreateMenuHandle() => throw null; + + public MenuItem FindMenuItem(int type, IntPtr value) => throw null; + + protected int FindMergePosition(int mergeOrder) => throw null; + + public ContextMenu GetContextMenu() => throw null; + + public MainMenu GetMainMenu() => throw null; + + public virtual void MergeMenu(Menu menuSrc) { } + + protected internal virtual bool ProcessCmdKey(ref Message msg, Keys keyData) => throw null; +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuItem.cs new file mode 100644 index 00000000000..796345c289e --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuItem.cs @@ -0,0 +1,270 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.MenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +[DefaultEvent(nameof(Click))] +[DefaultProperty(nameof(Text))] +public class MenuItem : Menu +{ + public MenuItem() : this( + mergeType: MenuMerge.Add, + mergeOrder: 0, + shortcut: 0, + text: null, + onClick: null, + onPopup: null, + onSelect: null, + items: null) => throw new PlatformNotSupportedException(); + + public MenuItem(string text) : this( + mergeType: MenuMerge.Add, + mergeOrder: 0, + shortcut: 0, + text: text, + onClick: null, + onPopup: null, + onSelect: null, + items: null) => throw new PlatformNotSupportedException(); + + public MenuItem(string text, EventHandler onClick) : this( + mergeType: MenuMerge.Add, + mergeOrder: 0, + shortcut: 0, + text: text, + onClick: onClick, + onPopup: null, + onSelect: null, + items: null) => throw new PlatformNotSupportedException(); + + public MenuItem(string text, EventHandler onClick, Shortcut shortcut) : this( + mergeType: MenuMerge.Add, + mergeOrder: 0, + shortcut: shortcut, + text: text, + onClick: onClick, + onPopup: null, + onSelect: null, + items: null) => throw new PlatformNotSupportedException(); + + public MenuItem(string text, MenuItem[] items) : this( + mergeType: MenuMerge.Add, + mergeOrder: 0, + shortcut: 0, + text: text, + onClick: null, + onPopup: null, + onSelect: null, + items: items) => throw new PlatformNotSupportedException(); + + public MenuItem( + MenuMerge mergeType, + int mergeOrder, + Shortcut shortcut, + string text, + EventHandler onClick, + EventHandler onPopup, + EventHandler onSelect, + MenuItem[] items) : base(items: items) => throw new PlatformNotSupportedException(); + + [Browsable(false)] + [DefaultValue(false)] + public bool BarBreak + { + get => throw null; + set { } + } + + [Browsable(false)] + [DefaultValue(false)] + public bool Break + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public bool Checked + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public bool DefaultItem + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public bool OwnerDraw + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(true)] + public bool Enabled + { + get => throw null; + set { } + } + + [Browsable(false)] + public int Index + { + get => throw null; + set { } + } + + [Browsable(false)] + public override bool IsParent + { + get => throw null; + } + + [DefaultValue(false)] + public bool MdiList + { + get => throw null; + set { } + } + + protected int MenuID + { + get => throw null; + } + + [DefaultValue(MenuMerge.Add)] + public MenuMerge MergeType + { + get => throw null; + set { } + } + + [DefaultValue(0)] + public int MergeOrder + { + get => throw null; + set { } + } + + [Browsable(false)] + public char Mnemonic => throw null; + + [Browsable(false)] + public Menu Parent + { + get => throw null; + } + + [DefaultValue(false)] + public bool RadioCheck + { + get => throw null; + set { } + } + + [Localizable(true)] + public string Text + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(Shortcut.None)] + public Shortcut Shortcut + { + get => throw null; + set { } + } + + [DefaultValue(true)] + [Localizable(true)] + public bool ShowShortcut + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(true)] + public bool Visible + { + get => throw null; + set { } + } + + public event EventHandler Click + { + add { } + remove { } + } + + public event DrawItemEventHandler DrawItem + { + add { } + remove { } + } + + public event MeasureItemEventHandler MeasureItem + { + add { } + remove { } + } + + public event EventHandler Popup + { + add { } + remove { } + } + + public event EventHandler Select + { + add { } + remove { } + } + + public virtual MenuItem CloneMenu() => throw null; + + protected void CloneMenu(MenuItem itemSrc) { } + + public virtual MenuItem MergeMenu() => throw null; + + public void MergeMenu(MenuItem itemSrc) { } + + protected virtual void OnClick(EventArgs e) { } + + protected virtual void OnDrawItem(DrawItemEventArgs e) { } + + protected virtual void OnInitMenuPopup(EventArgs e) { } + + protected virtual void OnMeasureItem(MeasureItemEventArgs e) { } + + protected virtual void OnPopup(EventArgs e) { } + + protected virtual void OnSelect(EventArgs e) { } + + public void PerformClick() { } + + public virtual void PerformSelect() { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuMerge.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuMerge.cs new file mode 100644 index 00000000000..213491c8c79 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ContextMenu/MenuMerge.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.MenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum MenuMerge +{ + Add = 0, + Replace = 1, + MergeItems = 2, + Remove = 3, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestInfo.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestInfo.cs new file mode 100644 index 00000000000..83dc85c3308 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestInfo.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +public partial class DataGrid +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public sealed class HitTestInfo + { + internal HitTestInfo() => throw new PlatformNotSupportedException(); + + public static readonly HitTestInfo Nowhere; + + public int Column => throw null; + + public int Row => throw null; + + public HitTestType Type => throw null; + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestType.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestType.cs new file mode 100644 index 00000000000..6ef140092a7 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.HitTestType.cs @@ -0,0 +1,32 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +public partial class DataGrid +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + [Flags] + public enum HitTestType + { + None = 0x00000000, + Cell = 0x00000001, + ColumnHeader = 0x00000002, + RowHeader = 0x00000004, + ColumnResize = 0x00000008, + RowResize = 0x00000010, + Caption = 0x00000020, + ParentRows = 0x00000040 + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.cs new file mode 100644 index 00000000000..976a75dbe1d --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGrid.cs @@ -0,0 +1,599 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; +using System.Runtime.InteropServices; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ComVisible(true)] +[ClassInterface(ClassInterfaceType.AutoDispatch)] +[Designer($"System.Windows.Forms.Design.DataGridDesigner, {AssemblyRef.SystemDesign}")] +[DefaultProperty(nameof(DataSource))] +[DefaultEvent(nameof(Navigate))] +[ComplexBindingProperties(nameof(DataSource), nameof(DataMember))] +public partial class DataGrid : Control, ISupportInitialize, IDataGridEditingService +{ + // Implement the default constructor explicitly to ensure that class can't be constructed. + public DataGrid() => throw new PlatformNotSupportedException(); + + [DefaultValue(true)] + public bool AllowNavigation + { + get => throw null; + set { } + } + + [DefaultValue(true)] + public bool AllowSorting + { + get => throw null; + set { } + } + + public Color AlternatingBackColor + { + get => throw null; + set { } + } + + public Color BackgroundColor + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Image BackgroundImage + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override ImageLayout BackgroundImageLayout + { + get => throw null; + set { } + } + + [DefaultValue(BorderStyle.Fixed3D)] + [DispId(-504)] + public BorderStyle BorderStyle + { + get => throw null; + set { } + } + + public event EventHandler BorderStyleChanged + { + add { } + remove { } + } + + public Color CaptionBackColor + { + get => throw null; + set { } + } + + public Color CaptionForeColor + { + get => throw null; + set { } + } + + [Localizable(true)] + [AmbientValue(null)] + public Font CaptionFont + { + get => throw null; + set { } + } + + [DefaultValue("")] + [Localizable(true)] + public string CaptionText + { + get => throw null; + set { } + } + + [DefaultValue(true)] + public bool CaptionVisible + { + get => throw null; + set { } + } + + public event EventHandler CaptionVisibleChanged + { + add { } + remove { } + } + + [DefaultValue(true)] + public bool ColumnHeadersVisible + { + get => throw null; + set { } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DataGridCell CurrentCell + { + get => throw null; + set { } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int CurrentRowIndex + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Cursor Cursor + { + get => throw null; + set { } + } + + [DefaultValue(null)] + [RefreshProperties(RefreshProperties.Repaint)] + [AttributeProvider(typeof(IListSource))] + public object DataSource + { + get => throw null; + set { } + } + + public event EventHandler DataSourceChanged + { + add { } + remove { } + } + + [DefaultValue(null)] + [Editor($"System.Windows.Forms.Design.DataMemberListEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + public string DataMember + { + get => throw null; + set { } + } + + public event EventHandler CurrentCellChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler CursorChanged + { + add { } + remove { } + } + + public Color SelectionBackColor + { + get => throw null; + set { } + } + + public Color SelectionForeColor + { + get => throw null; + set { } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [Localizable(true)] + public GridTableStylesCollection TableStyles => throw null; + + public Color GridLineColor + { + get => throw null; + set { } + } + + [DefaultValue(DataGridLineStyle.Solid)] + public DataGridLineStyle GridLineStyle + { + get => throw null; + set { } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [DefaultValue(DataGridParentRowsLabelStyle.Both)] + public DataGridParentRowsLabelStyle ParentRowsLabelStyle + { + get => throw null; + set { } + } + + public event EventHandler ParentRowsLabelStyleChanged + { + add { } + remove { } + } + + [Browsable(false)] + public int FirstVisibleColumn => throw null; + + [DefaultValue(false)] + public bool FlatMode + { + get => throw null; + set { } + } + + public event EventHandler FlatModeChanged + { + add { } + remove { } + } + + public Color HeaderBackColor + { + get => throw null; + set { } + } + + public Font HeaderFont + { + get => throw null; + set { } + } + + public Color HeaderForeColor + { + get => throw null; + set { } + } + + public event EventHandler BackgroundColorChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageLayoutChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + protected internal CurrencyManager ListManager + { + get => throw null; + set { } + } + + public void ResetAlternatingBackColor() { } + + public void ResetGridLineColor() { } + + public void ResetHeaderBackColor() { } + + public void ResetHeaderFont() { } + + public void ResetSelectionBackColor() { } + + public void ResetSelectionForeColor() { } + + protected bool ShouldSerializeSelectionBackColor() => throw null; + + protected virtual bool ShouldSerializeSelectionForeColor() => throw null; + + public void SetDataBinding(object dataSource, string dataMember) { } + + protected virtual bool ShouldSerializeGridLineColor() => throw null; + + protected virtual bool ShouldSerializeCaptionBackColor() => throw null; + + protected virtual bool ShouldSerializeAlternatingBackColor() => throw null; + + protected virtual bool ShouldSerializeCaptionForeColor() => throw null; + + protected virtual bool ShouldSerializeHeaderBackColor() => throw null; + + protected virtual bool ShouldSerializeBackgroundColor() => throw null; + + protected bool ShouldSerializeHeaderFont() => throw null; + + protected virtual bool ShouldSerializeHeaderForeColor() => throw null; + + public void ResetHeaderForeColor() { } + + protected ScrollBar HorizScrollBar => throw null; + + public Color LinkColor + { + get => throw null; + set { } + } + + public void ResetLinkColor() { } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public Color LinkHoverColor + { + get => throw null; + set { } + } + + protected virtual bool ShouldSerializeLinkHoverColor() => throw null; + + public void ResetLinkHoverColor() { } + + public event EventHandler AllowNavigationChanged + { + add { } + remove { } + } + + public Color ParentRowsBackColor + { + get => throw null; + set { } + } + + protected virtual bool ShouldSerializeParentRowsBackColor() => throw null; + + public Color ParentRowsForeColor + { + get => throw null; + set { } + } + + protected virtual bool ShouldSerializeParentRowsForeColor() => throw null; + + [DefaultValue(75)] + [TypeConverter(typeof(DataGridPreferredColumnWidthTypeConverter))] + public int PreferredColumnWidth + { + get => throw null; + set { } + } + + public int PreferredRowHeight + { + get => throw null; + set { } + } + + protected bool ShouldSerializePreferredRowHeight() => throw null; + + [DefaultValue(false)] + public bool ReadOnly + { + get => throw null; + set { } + } + + public event EventHandler ReadOnlyChanged + { + add { } + remove { } + } + + [DefaultValue(true)] + public bool ParentRowsVisible + { + get => throw null; + set { } + } + + public event EventHandler ParentRowsVisibleChanged + { + add { } + remove { } + } + + [DefaultValue(true)] + public bool RowHeadersVisible + { + get => throw null; + set { } + } + + [DefaultValue(35)] + public int RowHeaderWidth + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Bindable(false)] + public override string Text + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + protected ScrollBar VertScrollBar => throw null; + + [Browsable(false)] + public int VisibleColumnCount => throw null; + + [Browsable(false)] + public int VisibleRowCount => throw null; + + public object this[int rowIndex, int columnIndex] + { + get => throw null; + set { } + } + + public object this[DataGridCell cell] + { + get => throw null; + set { } + } + + protected virtual void OnBorderStyleChanged(EventArgs e) { } + + protected virtual void OnCaptionVisibleChanged(EventArgs e) { } + + protected virtual void OnCurrentCellChanged(EventArgs e) { } + + protected virtual void OnFlatModeChanged(EventArgs e) { } + + protected virtual void OnBackgroundColorChanged(EventArgs e) { } + + protected virtual void OnAllowNavigationChanged(EventArgs e) { } + + protected virtual void OnParentRowsVisibleChanged(EventArgs e) { } + + protected virtual void OnParentRowsLabelStyleChanged(EventArgs e) { } + + protected virtual void OnReadOnlyChanged(EventArgs e) { } + + protected void OnNavigate(NavigateEventArgs e) { } + + protected void OnRowHeaderClick(EventArgs e) { } + + protected void OnScroll(EventArgs e) { } + + protected virtual void GridHScrolled(object sender, ScrollEventArgs se) { } + + protected virtual void GridVScrolled(object sender, ScrollEventArgs se) { } + + protected void OnBackButtonClicked(object sender, EventArgs e) { } + + protected virtual void OnDataSourceChanged(EventArgs e) { } + + protected void OnShowParentDetailsButtonClicked(object sender, EventArgs e) { } + + public event NavigateEventHandler Navigate + { + add { } + remove { } + } + + protected event EventHandler RowHeaderClick + { + add { } + remove { } + } + + public event EventHandler Scroll + { + add { } + remove { } + } + + public bool BeginEdit(DataGridColumnStyle gridColumn, int rowNumber) => throw null; + + public void BeginInit() { } + + public void Collapse(int row) { } + + protected internal virtual void ColumnStartedEditing(Rectangle bounds) { } + + protected internal virtual void ColumnStartedEditing(Control editingControl) { } + + public bool EndEdit(DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort) => throw null; + + public void Expand(int row) { } + + protected virtual DataGridColumnStyle CreateGridColumn(PropertyDescriptor prop, bool isDefault) => throw null; + + protected virtual DataGridColumnStyle CreateGridColumn(PropertyDescriptor prop) => throw null; + + public void EndInit() { } + + public Rectangle GetCurrentCellBounds() => throw null; + + public Rectangle GetCellBounds(int row, int col) => throw null; + + public Rectangle GetCellBounds(DataGridCell dgc) => throw null; + + public HitTestInfo HitTest(int x, int y) => throw null; + + public HitTestInfo HitTest(Point position) => throw null; + + public bool IsExpanded(int rowNumber) => throw null; + + public bool IsSelected(int row) => throw null; + + public void NavigateBack() { } + + public void NavigateTo(int rowNumber, string relationName) { } + + protected bool ProcessGridKey(KeyEventArgs ke) => throw null; + + protected bool ProcessTabKey(Keys keyData) => throw null; + + protected virtual void CancelEditing() { } + + public event EventHandler BackButtonClick + { + add { } + remove { } + } + + public event EventHandler ShowParentDetailsButtonClick + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TextChanged + { + add { } + remove { } + } + + protected void ResetSelection() { } + + public void Select(int row) { } + + public void SubObjectsSiteChange(bool site) { } + + public void UnSelect(int row) { } + + protected virtual string GetOutputTextDelimiter() => throw null; +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridBoolColumn.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridBoolColumn.cs new file mode 100644 index 00000000000..92c4b866ea2 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridBoolColumn.cs @@ -0,0 +1,105 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class DataGridBoolColumn : DataGridColumnStyle +{ + public DataGridBoolColumn() => throw new PlatformNotSupportedException(); + + public DataGridBoolColumn(PropertyDescriptor prop) => throw new PlatformNotSupportedException(); + + public DataGridBoolColumn(PropertyDescriptor prop, bool isDefault) => throw new PlatformNotSupportedException(); + + [DefaultValue(true)] + public bool AllowNull + { + get => throw null; + set { } + } + + public event EventHandler AllowNullChanged + { + add { } + remove { } + } + + [TypeConverter(typeof(StringConverter))] + [DefaultValue(true)] + public object TrueValue + { + get => throw null; + set { } + } + + public event EventHandler TrueValueChanged + { + add { } + remove { } + } + + [TypeConverter(typeof(StringConverter))] + [DefaultValue(false)] + public object FalseValue + { + get => throw null; + set { } + } + + public event EventHandler FalseValueChanged + { + add { } + remove { } + } + + [TypeConverter(typeof(StringConverter))] + public object NullValue + { + get => throw null; + set { } + } + + // We need a concrete implementation for an abstract method. + protected internal override Size GetPreferredSize(Graphics g, object value) => throw null; + + protected internal override int GetMinimumHeight() => throw null; + + protected internal override int GetPreferredHeight(Graphics g, object value) => throw null; + + protected internal override void Abort(int rowNum) { } + + protected internal override bool Commit(CurrencyManager dataSource, int rowNum) => throw null; + + protected internal override void Edit(CurrencyManager source, + int rowNum, + Rectangle bounds, + bool readOnly, + string displayText, + bool cellIsVisible) + { } + + protected internal override void Paint(Graphics g, + Rectangle bounds, + CurrencyManager source, + int rowNum, + bool alignToRight) + { } + + protected internal override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum) + { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridCell.cs new file mode 100644 index 00000000000..cdf148139bb --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridCell.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "This type is provided for public surface compatibility with .NET Framework only. It can't run.")] +public struct DataGridCell +{ +#pragma warning disable IDE0251 // Make member 'readonly' - applies to `set` methods. + public DataGridCell(int r, int c) => throw new PlatformNotSupportedException(); + + public int ColumnNumber + { + readonly get => throw null; + set { } + } + + public int RowNumber + { + readonly get => throw null; + set { } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.CompModSwitches.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.CompModSwitches.cs new file mode 100644 index 00000000000..5c87a8e3e1c --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.CompModSwitches.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +public partial class DataGridColumnStyle +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + protected class CompModSwitches + { + public CompModSwitches() => throw new PlatformNotSupportedException(); + + public static TraceSwitch DGEditColumnEditing => throw new PlatformNotSupportedException(); + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.cs new file mode 100644 index 00000000000..16c7313ab19 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.DataGridColumnHeaderAccessibleObject.cs @@ -0,0 +1,32 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace System.Windows.Forms; + +#nullable disable + +public partial class DataGridColumnStyle +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [ComVisible(true)] + [Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + protected class DataGridColumnHeaderAccessibleObject : AccessibleObject + { + public DataGridColumnHeaderAccessibleObject(DataGridColumnStyle owner) => throw new PlatformNotSupportedException(); + + public DataGridColumnHeaderAccessibleObject() => throw new PlatformNotSupportedException(); + + protected DataGridColumnStyle Owner => throw null; + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.cs new file mode 100644 index 00000000000..c693bfc7750 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridColumnStyle.cs @@ -0,0 +1,227 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +[DefaultProperty("Header")] +public abstract partial class DataGridColumnStyle : Component, IDataGridColumnStyleEditingNotificationService +{ + public DataGridColumnStyle() => throw new PlatformNotSupportedException(); + + public DataGridColumnStyle(PropertyDescriptor prop) => throw new PlatformNotSupportedException(); + + [Localizable(true)] + [DefaultValue(HorizontalAlignment.Left)] + public virtual HorizontalAlignment Alignment + { + get => throw null; + set { } + } + + public event EventHandler AlignmentChanged + { + add { } + remove { } + } + + [Browsable(false)] + public AccessibleObject HeaderAccessibleObject => throw null; + + [DefaultValue(null)] + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + public virtual PropertyDescriptor PropertyDescriptor + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + public event EventHandler PropertyDescriptorChanged + { + add { } + remove { } + } + + [Browsable(false)] + public virtual DataGridTableStyle DataGridTableStyle => throw null; + + protected int FontHeight => throw null; + + public event EventHandler FontChanged + { + add { } + remove { } + } + + [Localizable(true)] + public virtual string HeaderText + { + get => throw null; + set { } + } + + public event EventHandler HeaderTextChanged + { + add { } + remove { } + } + + [Editor($"System.Windows.Forms.Design.DataGridColumnStyleMappingNameEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + [Localizable(true)] + [DefaultValue("")] + public string MappingName + { + get => throw null; + set { } + } + + public event EventHandler MappingNameChanged + { + add { } + remove { } + } + + [Localizable(true)] + public virtual string NullText + { + get => throw null; + set { } + } + + public event EventHandler NullTextChanged + { + add { } + remove { } + } + + [DefaultValue(false)] + public virtual bool ReadOnly + { + get => throw null; + set { } + } + + public event EventHandler ReadOnlyChanged + { + add { } + remove { } + } + + [Localizable(true)] + [DefaultValue(100)] + public virtual int Width + { + get => throw null; + set { } + } + + public event EventHandler WidthChanged + { + add { } + remove { } + } + + protected virtual AccessibleObject CreateHeaderAccessibleObject() => throw null; + + protected virtual void SetDataGrid(DataGrid value) { } + + protected virtual void SetDataGridInColumn(DataGrid value) { } + + protected void BeginUpdate() { } + + protected void EndUpdate() { } + + protected internal abstract Size GetPreferredSize(Graphics g, object value); + + protected internal abstract int GetMinimumHeight(); + + protected internal abstract int GetPreferredHeight(Graphics g, object value); + + protected internal virtual object GetColumnValueAtRow(CurrencyManager source, int rowNum) => throw null; + + protected virtual void Invalidate() { } + + protected void CheckValidDataSource(CurrencyManager value) { } + + protected internal abstract void Abort(int rowNum); + + protected internal abstract bool Commit(CurrencyManager dataSource, int rowNum); + + protected internal virtual void Edit( + CurrencyManager source, + int rowNum, + Rectangle bounds, + bool readOnly) + { } + + protected internal virtual void Edit( + CurrencyManager source, + int rowNum, + Rectangle bounds, + bool readOnly, + string displayText) + { } + + protected internal abstract void Edit( + CurrencyManager source, + int rowNum, + Rectangle bounds, + bool readOnly, + string displayText, + bool cellIsVisible); + + protected internal virtual void EnterNullValue() { } + + protected internal virtual void ConcedeFocus() { } + + protected internal abstract void Paint( + Graphics g, + Rectangle bounds, + CurrencyManager source, + int rowNum, + bool alignToRight); + + protected internal virtual void Paint( + Graphics g, + Rectangle bounds, + CurrencyManager source, + int rowNum, + Brush backBrush, + Brush foreBrush, + bool alignToRight) + { } + + protected internal abstract void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum); + + protected internal virtual void ReleaseHostedControl() { } + + public void ResetHeaderText() { } + + protected internal virtual void SetColumnValueAtRow(CurrencyManager source, int rowNum, object value) { } + + void IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control editingControl) { } + + protected internal virtual void ColumnStartedEditing(Control editingControl) { } + + protected internal virtual void UpdateUI(CurrencyManager source, int rowNum, string displayText) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridLineStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridLineStyle.cs new file mode 100644 index 00000000000..97fc0aa249f --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridLineStyle.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum DataGridLineStyle +{ + None, + Solid +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridParentRowsLabel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridParentRowsLabel.cs new file mode 100644 index 00000000000..b8ecd8d2075 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridParentRowsLabel.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum DataGridParentRowsLabelStyle +{ + None = 0, + TableName = 1, + ColumnName = 2, + Both = 3, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridPreferredColumnWidthTypeConverter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridPreferredColumnWidthTypeConverter.cs new file mode 100644 index 00000000000..b1af37e754e --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridPreferredColumnWidthTypeConverter.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class DataGridPreferredColumnWidthTypeConverter : TypeConverter +{ + // Added explicit constructor to prevent the creation of a default constructor by the compiler. + public DataGridPreferredColumnWidthTypeConverter() => throw new PlatformNotSupportedException(); +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTableStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTableStyle.cs new file mode 100644 index 00000000000..eea42f70cff --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTableStyle.cs @@ -0,0 +1,394 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +public class DataGridTableStyle : Component, IDataGridEditingService +{ + public DataGridTableStyle() : this(isDefaultTableStyle: false) => throw new PlatformNotSupportedException(); + + public DataGridTableStyle(bool isDefaultTableStyle) => throw new PlatformNotSupportedException(); + + public DataGridTableStyle(CurrencyManager listManager) : this() => throw new PlatformNotSupportedException(); + + [DefaultValue(true)] + public bool AllowSorting + { + get => throw null; + set { } + } + + public event EventHandler AllowSortingChanged + { + add { } + remove { } + } + + public Color AlternatingBackColor + { + get => throw null; + set { } + } + + public event EventHandler AlternatingBackColorChanged + { + add { } + remove { } + } + + public void ResetAlternatingBackColor() { } + + protected virtual bool ShouldSerializeAlternatingBackColor() => throw null; + + protected bool ShouldSerializeBackColor() => throw null; + + protected bool ShouldSerializeForeColor() => throw null; + + public Color BackColor + { + get => throw null; + set { } + } + + public event EventHandler BackColorChanged + { + add { } + remove { } + } + + public void ResetBackColor() { } + + public Color ForeColor + { + get => throw null; + set { } + } + + public event EventHandler ForeColorChanged + { + add { } + remove { } + } + + public void ResetForeColor() { } + + public Color GridLineColor + { + get => throw null; + set { } + } + + public event EventHandler GridLineColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeGridLineColor() => throw null; + + public void ResetGridLineColor() { } + + [DefaultValue(DataGridLineStyle.Solid)] + public DataGridLineStyle GridLineStyle + { + get => throw null; + set { } + } + + public event EventHandler GridLineStyleChanged + { + add { } + remove { } + } + + public Color HeaderBackColor + { + get => throw null; + set { } + } + + public event EventHandler HeaderBackColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeHeaderBackColor() => throw null; + + public void ResetHeaderBackColor() { } + + [Localizable(true)] + [AmbientValue(null)] + public Font HeaderFont + { + get => throw null; + set { } + } + + public event EventHandler HeaderFontChanged + { + add { } + remove { } + } + + public void ResetHeaderFont() { } + + public Color HeaderForeColor + { + get => throw null; + set { } + } + + public event EventHandler HeaderForeColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeHeaderForeColor() => throw null; + + public void ResetHeaderForeColor() { } + + public Color LinkColor + { + get => throw null; + set { } + } + + public event EventHandler LinkColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeLinkColor() => throw null; + + public void ResetLinkColor() { } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public Color LinkHoverColor + { + get => throw null; + set { } + } + + public event EventHandler LinkHoverColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeLinkHoverColor() => throw null; + + public void ResetLinkHoverColor() { } + + [DefaultValue(75)] + [Localizable(true)] + [TypeConverter(typeof(DataGridPreferredColumnWidthTypeConverter))] + public int PreferredColumnWidth + { + get => throw null; + set { } + } + + public event EventHandler PreferredColumnWidthChanged + { + add { } + remove { } + } + + [Localizable(true)] + public int PreferredRowHeight + { + get => throw null; + set { } + } + + public event EventHandler PreferredRowHeightChanged + { + add { } + remove { } + } + + protected bool ShouldSerializePreferredRowHeight() => throw null; + + [DefaultValue(true)] + public bool ColumnHeadersVisible + { + get => throw null; + set { } + } + + public event EventHandler ColumnHeadersVisibleChanged + { + add { } + remove { } + } + + [DefaultValue(true)] + public bool RowHeadersVisible + { + get => throw null; + set { } + } + + public event EventHandler RowHeadersVisibleChanged + { + add { } + remove { } + } + + [DefaultValue(35)] + [Localizable(true)] + public int RowHeaderWidth + { + get => throw null; + set { } + } + + public event EventHandler RowHeaderWidthChanged + { + add { } + remove { } + } + + public Color SelectionBackColor + { + get => throw null; + set { } + } + + public event EventHandler SelectionBackColorChanged + { + add { } + remove { } + } + + protected bool ShouldSerializeSelectionBackColor() => throw null; + + public void ResetSelectionBackColor() { } + + [Description("The foreground color for the current data grid row")] + public Color SelectionForeColor + { + get => throw null; + set { } + } + + public event EventHandler SelectionForeColorChanged + { + add { } + remove { } + } + + protected virtual bool ShouldSerializeSelectionForeColor() => throw null; + + public void ResetSelectionForeColor() { } + + public static readonly DataGridTableStyle DefaultTableStyle; + + [Editor($"System.Windows.Forms.Design.DataGridTableStyleMappingNameEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + [DefaultValue("")] + public string MappingName + { + get => throw null; + set { } + } + + public event EventHandler MappingNameChanged + { + add { } + remove { } + } + + [Localizable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public virtual GridColumnStylesCollection GridColumnStyles => throw null; + + [Browsable(false)] + public virtual DataGrid DataGrid + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public virtual bool ReadOnly + { + get => throw null; + set { } + } + + public event EventHandler ReadOnlyChanged + { + add { } + remove { } + } + + public bool BeginEdit(DataGridColumnStyle gridColumn, int rowNumber) => throw null; + + public bool EndEdit(DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort) => throw null; + + protected internal virtual DataGridColumnStyle CreateGridColumn(PropertyDescriptor prop, bool isDefault) => throw null; + + protected internal virtual DataGridColumnStyle CreateGridColumn(PropertyDescriptor prop) => throw null; + + protected virtual void OnReadOnlyChanged(EventArgs e) { } + + protected virtual void OnMappingNameChanged(EventArgs e) { } + + protected virtual void OnAlternatingBackColorChanged(EventArgs e) { } + + protected virtual void OnForeColorChanged(EventArgs e) { } + + protected virtual void OnBackColorChanged(EventArgs e) { } + + protected virtual void OnAllowSortingChanged(EventArgs e) { } + + protected virtual void OnGridLineColorChanged(EventArgs e) { } + + protected virtual void OnGridLineStyleChanged(EventArgs e) { } + + protected virtual void OnHeaderBackColorChanged(EventArgs e) { } + + protected virtual void OnHeaderFontChanged(EventArgs e) { } + + protected virtual void OnHeaderForeColorChanged(EventArgs e) { } + + protected virtual void OnLinkColorChanged(EventArgs e) { } + + protected virtual void OnLinkHoverColorChanged(EventArgs e) { } + + protected virtual void OnPreferredRowHeightChanged(EventArgs e) { } + + protected virtual void OnPreferredColumnWidthChanged(EventArgs e) { } + + protected virtual void OnColumnHeadersVisibleChanged(EventArgs e) { } + + protected virtual void OnRowHeadersVisibleChanged(EventArgs e) { } + + protected virtual void OnRowHeaderWidthChanged(EventArgs e) { } + + protected virtual void OnSelectionForeColorChanged(EventArgs e) { } + + protected virtual void OnSelectionBackColorChanged(EventArgs e) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBox.cs new file mode 100644 index 00000000000..a798de6ed36 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBox.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ComVisible(true)] +[ClassInterface(ClassInterfaceType.AutoDispatch)] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +[DefaultProperty("GridEditName")] +public class DataGridTextBox : TextBox +{ + public DataGridTextBox() => throw new PlatformNotSupportedException(); + + public void SetDataGrid(DataGrid parentGrid) { } + + public bool IsInEditOrNavigateMode + { + get => throw null; + set { } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBoxColumn.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBoxColumn.cs new file mode 100644 index 00000000000..16e64e74aad --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/DataGridTextBoxColumn.cs @@ -0,0 +1,108 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class DataGridTextBoxColumn : DataGridColumnStyle +{ + public DataGridTextBoxColumn() => throw new PlatformNotSupportedException(); + + public DataGridTextBoxColumn(PropertyDescriptor prop) => throw new PlatformNotSupportedException(); + + public DataGridTextBoxColumn(PropertyDescriptor prop, string format) => throw new PlatformNotSupportedException(); + + public DataGridTextBoxColumn(PropertyDescriptor prop, string format, bool isDefault) => throw new PlatformNotSupportedException(); + + public DataGridTextBoxColumn(PropertyDescriptor prop, bool isDefault) => throw new PlatformNotSupportedException(); + + [Browsable(false)] + public virtual TextBox TextBox => throw null; + + [DefaultValue(null)] + [Editor($"System.Windows.Forms.Design.DataGridColumnStyleFormatEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + public string Format + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + public IFormatProvider FormatInfo + { + get => throw null; + set { } + } + + [DefaultValue(null)] + public override PropertyDescriptor PropertyDescriptor + { + set { } + } + + protected void HideEditBox() { } + + protected void EndEdit() { } + + protected void PaintText( + Graphics g, + Rectangle bounds, + string text, + bool alignToRight) + { } + + protected void PaintText( + Graphics g, + Rectangle textBounds, + string text, + Brush backBrush, + Brush foreBrush, + bool alignToRight) + { } + + protected internal override Size GetPreferredSize(Graphics g, object value) => throw null; + + protected internal override int GetMinimumHeight() => throw null; + + protected internal override int GetPreferredHeight(Graphics g, object value) => throw null; + + protected internal override void Abort(int rowNum) { } + + protected internal override bool Commit(CurrencyManager dataSource, int rowNum) => throw null; + + protected internal override void Edit( + CurrencyManager source, + int rowNum, + Rectangle bounds, + bool readOnly, + string displayText, + bool cellIsVisible) + { } + + protected internal override void Paint( + Graphics g, + Rectangle bounds, + CurrencyManager source, + int rowNum, + bool alignToRight) + { } + + protected internal override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum) + { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridColumnStylesCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridColumnStylesCollection.cs new file mode 100644 index 00000000000..8740951d7b4 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridColumnStylesCollection.cs @@ -0,0 +1,95 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.ComponentModel; +using System.Drawing.Design; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[Editor($"System.Windows.Forms.Design.DataGridColumnCollectionEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] +[ListBindable(false)] +public class GridColumnStylesCollection : BaseCollection, IList +{ + private GridColumnStylesCollection() { } + + int IList.Add(object value) => throw null; + + void IList.Clear() { } + + bool IList.Contains(object value) => throw null; + + int IList.IndexOf(object value) => throw null; + + void IList.Insert(int index, object value) { } + + void IList.Remove(object value) { } + + void IList.RemoveAt(int index) { } + + bool IList.IsFixedSize => throw null; + + bool IList.IsReadOnly => throw null; + + object IList.this[int index] + { + get => throw null; + set { } + } + + void ICollection.CopyTo(Array array, int index) { } + + int ICollection.Count => throw null; + + bool ICollection.IsSynchronized => throw null; + + object ICollection.SyncRoot => throw null; + + IEnumerator IEnumerable.GetEnumerator() => throw null; + + public DataGridColumnStyle this[int index] => throw null; + + public DataGridColumnStyle this[string columnName] => throw null; + + public DataGridColumnStyle this[PropertyDescriptor propertyDesciptor] => throw null; + + public virtual int Add(DataGridColumnStyle column) => throw null; + + public void AddRange(DataGridColumnStyle[] columns) { } + + public event CollectionChangeEventHandler CollectionChanged + { + add { } + remove { } + } + + public void Clear() { } + + public bool Contains(PropertyDescriptor propertyDescriptor) => throw null; + + public bool Contains(DataGridColumnStyle column) => throw null; + + public bool Contains(string name) => throw null; + + public int IndexOf(DataGridColumnStyle element) => throw null; + + protected void OnCollectionChanged(CollectionChangeEventArgs e) { } + + public void Remove(DataGridColumnStyle column) { } + + public void RemoveAt(int index) { } + + public void ResetPropertyDescriptors() { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTableStylesCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTableStylesCollection.cs new file mode 100644 index 00000000000..7b1f7bf9c92 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTableStylesCollection.cs @@ -0,0 +1,85 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ListBindable(false)] +public class GridTableStylesCollection : BaseCollection, IList +{ + private GridTableStylesCollection() { } + + int IList.Add(object value) => throw null; + + void IList.Clear() { } + + bool IList.Contains(object value) => throw null; + + int IList.IndexOf(object value) => throw null; + + void IList.Insert(int index, object value) { } + + void IList.Remove(object value) { } + + void IList.RemoveAt(int index) { } + + bool IList.IsFixedSize => throw null; + + bool IList.IsReadOnly => throw null; + + object IList.this[int index] + { + get => throw null; + set { } + } + + void ICollection.CopyTo(Array array, int index) { } + + int ICollection.Count => throw null; + + bool ICollection.IsSynchronized => throw null; + + object ICollection.SyncRoot => throw null; + + IEnumerator IEnumerable.GetEnumerator() => throw null; + + public DataGridTableStyle this[int index] => throw null; + + public DataGridTableStyle this[string tableName] => throw null; + + public virtual int Add(DataGridTableStyle table) => throw null; + + public virtual void AddRange(DataGridTableStyle[] tables) { } + + public event CollectionChangeEventHandler CollectionChanged + { + add { } + remove { } + } + + public void Clear() { } + + public bool Contains(DataGridTableStyle table) => throw null; + + public bool Contains(string name) => throw null; + + protected void OnCollectionChanged(CollectionChangeEventArgs e) { } + + public void Remove(DataGridTableStyle table) { } + + public void RemoveAt(int index) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTablesFactory.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTablesFactory.cs new file mode 100644 index 00000000000..d1001b33f63 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/GridTablesFactory.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public sealed class GridTablesFactory +{ + private GridTablesFactory() { } + + public static DataGridTableStyle[] CreateGridTables( + DataGridTableStyle gridTable, + object dataSource, + string dataMember, + BindingContext bindingManager) => throw new PlatformNotSupportedException(); +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/IDataGridEditingService.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/IDataGridEditingService.cs new file mode 100644 index 00000000000..d4245b9a5e4 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/DataGrid/IDataGridEditingService.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.DataGridMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public interface IDataGridEditingService +{ + bool BeginEdit(DataGridColumnStyle gridColumn, int rowNumber); + + bool EndEdit(DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort); +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/MainMenu/MainMenu.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/MainMenu/MainMenu.cs new file mode 100644 index 00000000000..5098969a376 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/MainMenu/MainMenu.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.MainMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ToolboxItemFilter("System.Windows.Forms.MainMenu")] +public class MainMenu : Menu +{ + public MainMenu() : base(items: default) => throw new PlatformNotSupportedException(); + + public MainMenu(IContainer container) : this() => throw new PlatformNotSupportedException(); + + public MainMenu(MenuItem[] items) : base(items: items) => throw new PlatformNotSupportedException(); + + public event EventHandler Collapse + { + add { } + remove { } + } + + [Localizable(true)] + [AmbientValue(RightToLeft.Inherit)] + public virtual RightToLeft RightToLeft + { + get => throw null; + set { } + } + + public virtual MainMenu CloneMenu() => throw null; + + public Form GetForm() => throw null; + + protected internal virtual void OnCollapse(EventArgs e) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.StatusBarPanelCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.StatusBarPanelCollection.cs new file mode 100644 index 00000000000..6238b478caf --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.StatusBarPanelCollection.cs @@ -0,0 +1,92 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +public partial class StatusBar +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + [ListBindable(false)] + public class StatusBarPanelCollection : IList + { + public StatusBarPanelCollection(StatusBar owner) => throw new PlatformNotSupportedException(); + + public virtual StatusBarPanel this[int index] + { + get => throw null; + set { } + } + + object IList.this[int index] + { + get => throw null; + set { } + } + + public virtual StatusBarPanel this[string key] => throw null; + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public int Count => throw null; + + object ICollection.SyncRoot => throw null; + + bool ICollection.IsSynchronized => throw null; + + bool IList.IsFixedSize => throw null; + + public bool IsReadOnly => throw null; + + public virtual StatusBarPanel Add(string text) => throw null; + + public virtual int Add(StatusBarPanel value) => throw null; + + int IList.Add(object value) => throw null; + + public virtual void AddRange(StatusBarPanel[] panels) { } + + public bool Contains(StatusBarPanel panel) => throw null; + + bool IList.Contains(object panel) => throw null; + + public virtual bool ContainsKey(string key) => throw null; + + public int IndexOf(StatusBarPanel panel) => throw null; + + int IList.IndexOf(object panel) => throw null; + + public virtual int IndexOfKey(string key) => throw null; + + public virtual void Insert(int index, StatusBarPanel value) { } + + void IList.Insert(int index, object value) { } + + public virtual void Clear() { } + + public virtual void Remove(StatusBarPanel value) { } + + void IList.Remove(object value) { } + + public virtual void RemoveAt(int index) { } + + public virtual void RemoveByKey(string key) { } + + void ICollection.CopyTo(Array dest, int index) { } + + public IEnumerator GetEnumerator() => throw null; + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.cs new file mode 100644 index 00000000000..72b155014e1 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBar.cs @@ -0,0 +1,181 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ComVisible(true)] +[ClassInterface(ClassInterfaceType.AutoDispatch)] +[DefaultEvent(nameof(PanelClick))] +[DefaultProperty(nameof(Text))] +[Designer($"System.Windows.Forms.Design.StatusBarDesigner, {AssemblyRef.SystemDesign}")] +public partial class StatusBar : Control +{ + // Adding this constructor to suppress creation of a default one. + public StatusBar() => throw new PlatformNotSupportedException(); + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Color BackColor + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Drawing.Image BackgroundImage + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override ImageLayout BackgroundImageLayout + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(DockStyle.Bottom)] + public override DockStyle Dock + { + get => throw null; + set { } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected override bool DoubleBuffered + { + get => throw null; + set { } + } + + [Localizable(true)] + public override Drawing.Font Font + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Color ForeColor + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new ImeMode ImeMode + { + get => throw null; + set { } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [Localizable(true)] + [MergableProperty(false)] + public StatusBarPanelCollection Panels => throw null; + + [DefaultValue(false)] + public bool ShowPanels + { + get => throw null; + set { } + } + + [DefaultValue(true)] + public bool SizingGrip + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public new bool TabStop { get => throw null; set { } } + + [Localizable(true)] + public override string Text { get => throw null; set { } } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackColorChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageLayoutChanged + { + add { } + remove { } + } + + public event StatusBarDrawItemEventHandler DrawItem + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ForeColorChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ImeModeChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event PaintEventHandler Paint + { + add { } + remove { } + } + + public event StatusBarPanelClickEventHandler PanelClick + { + add { } + remove { } + } + + protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e) { } + + protected virtual void OnDrawItem(StatusBarDrawItemEventArgs sbdievent) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventArgs.cs new file mode 100644 index 00000000000..b31a1193567 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventArgs.cs @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class StatusBarDrawItemEventArgs : DrawItemEventArgs +{ + public StatusBarDrawItemEventArgs( + Graphics g, + Font font, + Rectangle r, + int itemId, + DrawItemState itemState, + StatusBarPanel panel) : base( + graphics: g, + font: font, + rect: r, + index: itemId, + state: itemState) => throw new PlatformNotSupportedException(); + + public StatusBarDrawItemEventArgs( + Graphics g, + Font font, + Rectangle r, + int itemId, + DrawItemState itemState, + StatusBarPanel panel, + Color foreColor, + Color backColor) : base( + graphics: g, + font: font, + rect: r, + index: itemId, + state: itemState, + foreColor: foreColor, + backColor: backColor) => throw new PlatformNotSupportedException(); + + public StatusBarPanel Panel => throw null; +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventHandler.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventHandler.cs new file mode 100644 index 00000000000..cbf19aa4e41 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarDrawItemEventHandler.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public delegate void StatusBarDrawItemEventHandler(object sender, StatusBarDrawItemEventArgs sbdevent); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanel.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanel.cs new file mode 100644 index 00000000000..1e44a1d1c7e --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanel.cs @@ -0,0 +1,124 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +[DefaultProperty(nameof(Text))] +public class StatusBarPanel : Component, ISupportInitialize +{ + // Added public constructor to suppress creation of the default one. + public StatusBarPanel() => throw new PlatformNotSupportedException(); + + [DefaultValue(HorizontalAlignment.Left)] + [Localizable(true)] + public HorizontalAlignment Alignment + { + get => throw null; + set { } + } + + [DefaultValue(StatusBarPanelAutoSize.None)] + [RefreshProperties(RefreshProperties.All)] + public StatusBarPanelAutoSize AutoSize + { + get => throw null; + set { } + } + + [DefaultValue(StatusBarPanelBorderStyle.Sunken)] + [Runtime.InteropServices.DispId(-504)] + public StatusBarPanelBorderStyle BorderStyle + { + get => throw null; + set { } + } + + [DefaultValue(null)] + [Localizable(true)] + public Icon Icon + { + get => throw null; + set { } + } + + [DefaultValue(10)] + [Localizable(true)] + [RefreshProperties(RefreshProperties.All)] + public int MinWidth + { + get => throw null; + set { } + } + + [Localizable(true)] + public string Name + { + get => throw null; + set { } + } + + [Browsable(false)] + public StatusBar Parent => throw null; + + [DefaultValue(StatusBarPanelStyle.Text)] + public StatusBarPanelStyle Style + { + get => throw null; + set { } + } + + [Localizable(false)] + [Bindable(true)] + [DefaultValue(null)] + [TypeConverter(typeof(StringConverter))] + public object Tag + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue("")] + public string Text + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue("")] + public string ToolTipText + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(100)] + public int Width + { + get => throw null; + set { } + } + + public void BeginInit() { } + + public void EndInit() { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelAutoSize.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelAutoSize.cs new file mode 100644 index 00000000000..b78874cffd5 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelAutoSize.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum StatusBarPanelAutoSize +{ + None = 1, + Spring = 2, + Contents = 3, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelBorderStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelBorderStyle.cs new file mode 100644 index 00000000000..d110afee09c --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelBorderStyle.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum StatusBarPanelBorderStyle +{ + None = 1, + Raised = 2, + Sunken = 3, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventArgs.cs new file mode 100644 index 00000000000..7d88956e421 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventArgs.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class StatusBarPanelClickEventArgs : MouseEventArgs +{ + public StatusBarPanelClickEventArgs( + StatusBarPanel statusBarPanel, + MouseButtons button, + int clicks, + int x, + int y) : base(button: button, clicks: clicks, x: x, y: y, delta: 0) => throw new PlatformNotSupportedException(); + + public StatusBarPanel StatusBarPanel => throw null; +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventHandler.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventHandler.cs new file mode 100644 index 00000000000..91dca75d577 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelClickEventHandler.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public delegate void StatusBarPanelClickEventHandler(object sender, StatusBarPanelClickEventArgs e); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelStyle.cs new file mode 100644 index 00000000000..c524ccbcc4d --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/StatusBar/StatusBarPanelStyle.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.StatusBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum StatusBarPanelStyle +{ + Text = 1, + OwnerDraw = 2, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.ToolBarButtonCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.ToolBarButtonCollection.cs new file mode 100644 index 00000000000..38c2ebaf7f5 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.ToolBarButtonCollection.cs @@ -0,0 +1,90 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +public partial class ToolBar +{ + /// + /// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public class ToolBarButtonCollection : IList + { + public ToolBarButtonCollection(ToolBar owner) => throw new PlatformNotSupportedException(); + + public virtual ToolBarButton this[int index] + { + get => throw null; + set { } + } + + object IList.this[int index] + { + get => throw null; + set { } + } + + public virtual ToolBarButton this[string key] => throw null; + + [Browsable(false)] + public int Count => throw null; + + object ICollection.SyncRoot => throw null; + + bool ICollection.IsSynchronized => throw null; + + bool IList.IsFixedSize => throw null; + + public bool IsReadOnly => throw null; + + public int Add(ToolBarButton button) => throw null; + + public int Add(string text) => throw null; + + int IList.Add(object button) => throw null; + + public void AddRange(ToolBarButton[] buttons) { } + + public void Clear() { } + + public bool Contains(ToolBarButton button) => throw null; + + bool IList.Contains(object button) => throw null; + + public virtual bool ContainsKey(string key) => throw null; + + void ICollection.CopyTo(Array dest, int index) { } + + public int IndexOf(ToolBarButton button) => throw null; + + int IList.IndexOf(object button) => throw null; + + public virtual int IndexOfKey(string key) => throw null; + + public void Insert(int index, ToolBarButton button) { } + + void IList.Insert(int index, object button) { } + + public void RemoveAt(int index) { } + + public virtual void RemoveByKey(string key) { } + + public void Remove(ToolBarButton button) { } + + void IList.Remove(object button) { } + + public IEnumerator GetEnumerator() => throw null; + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.cs new file mode 100644 index 00000000000..67bd3ffad73 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBar.cs @@ -0,0 +1,283 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[ComVisible(true)] +[ClassInterface(ClassInterfaceType.AutoDispatch)] +[DefaultEvent(nameof(ButtonClick))] +[Designer($"System.Windows.Forms.Design.ToolBarDesigner, {AssemblyRef.SystemDesign}")] +[DefaultProperty(nameof(Buttons))] +public partial class ToolBar : Control +{ + // Suppress creation of the default constructor by the compiler. This class should not be constructed. + public ToolBar() => throw new PlatformNotSupportedException(); + + [DefaultValue(ToolBarAppearance.Normal)] + [Localizable(true)] + public ToolBarAppearance Appearance + { + get => throw null; + set { } + } + + [DefaultValue(true)] + [Localizable(true)] + [Browsable(true)] + [EditorBrowsable(EditorBrowsableState.Always)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + public override bool AutoSize + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Color BackColor + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Image BackgroundImage + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override ImageLayout BackgroundImageLayout + { + get => throw null; + set { } + } + + [DefaultValue(BorderStyle.None)] + [DispId(-504)] + public BorderStyle BorderStyle + { + get => throw null; + set { } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [Localizable(true)] + [MergableProperty(false)] + public ToolBarButtonCollection Buttons => throw null; + + [RefreshProperties(RefreshProperties.All)] + [Localizable(true)] + public Size ButtonSize + { + get => throw null; + set { } + } + + [DefaultValue(true)] + public bool Divider + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue(DockStyle.Top)] + public override DockStyle Dock + { + get => throw null; + set { } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected override bool DoubleBuffered + { + get => throw null; + set { } + } + + [DefaultValue(false)] + [Localizable(true)] + public bool DropDownArrows + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override Color ForeColor + { + get => throw null; + set { } + } + + [DefaultValue(null)] + public ImageList ImageList + { + get => throw null; + set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Size ImageSize => throw null; + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new ImeMode ImeMode { get => throw null; set { } } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override RightToLeft RightToLeft { get => throw null; set { } } + + [DefaultValue(false)] + [Localizable(true)] + public bool ShowToolTips + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public new bool TabStop + { + get => throw null; set { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Bindable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override string Text + { + get => throw null; set { } + } + + [DefaultValue(ToolBarTextAlign.Underneath)] + [Localizable(true)] + public ToolBarTextAlign TextAlign + { + get => throw null; + set { } + } + + [DefaultValue(true)] + [Localizable(true)] + public bool Wrappable + { + get => throw null; + set { } + } + + [Browsable(true)] + [EditorBrowsable(EditorBrowsableState.Always)] + public new event EventHandler AutoSizeChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackColorChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageLayoutChanged + { + add { } + remove { } + } + + public event ToolBarButtonClickEventHandler ButtonClick + { + add { } + remove { } + } + + public event ToolBarButtonClickEventHandler ButtonDropDown + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ForeColorChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ImeModeChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event PaintEventHandler Paint + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler RightToLeftChanged + { + add { } + remove { } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TextChanged + { + add { } + remove { } + } + + protected virtual void OnButtonClick(ToolBarButtonClickEventArgs e) { } + + protected virtual void OnButtonDropDown(ToolBarButtonClickEventArgs e) { } + + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ScaleCore(float dx, float dy) { } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarAppearance.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarAppearance.cs new file mode 100644 index 00000000000..dc6994f3243 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarAppearance.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum ToolBarAppearance +{ + Normal = 0, + Flat = 1, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButton.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButton.cs new file mode 100644 index 00000000000..129eb7caf33 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButton.cs @@ -0,0 +1,137 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +[Designer($"System.Windows.Forms.Design.ToolBarButtonDesigner, {AssemblyRef.SystemDesign}")] +[DefaultProperty(nameof(Text))] +[ToolboxItem(false)] +[DesignTimeVisible(false)] +public class ToolBarButton : Component +{ + public ToolBarButton() => throw new PlatformNotSupportedException(); + + public ToolBarButton(string text) => throw new PlatformNotSupportedException(); + + [DefaultValue(null)] + [TypeConverter(typeof(ReferenceConverter))] + public Menu DropDownMenu + { + get => throw null; + set { } + } + + [DefaultValue(true)] + [Localizable(true)] + public bool Enabled + { + get => throw null; + set { } + } + + [TypeConverter(typeof(ImageIndexConverter))] + [Editor($"System.Windows.Forms.Design.ImageIndexEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + [DefaultValue(-1)] + [RefreshProperties(RefreshProperties.Repaint)] + [Localizable(true)] + public int ImageIndex + { + get => throw null; + set { } + } + + [TypeConverter(typeof(ImageKeyConverter))] + [Editor($"System.Windows.Forms.Design.ImageIndexEditor, {AssemblyRef.SystemDesign}", typeof(UITypeEditor))] + [DefaultValue("")] + [Localizable(true)] + [RefreshProperties(RefreshProperties.Repaint)] + public string ImageKey + { + get => throw null; + set { } + } + + [Browsable(false)] + public string Name + { + get => throw null; + set { } + } + + [Browsable(false)] + public ToolBar Parent => throw null; + + [DefaultValue(false)] + public bool PartialPush + { + get => throw null; + set { } + } + + [DefaultValue(false)] + public bool Pushed + { + get => throw null; + set { } + } + + public Rectangle Rectangle => throw null; + + [DefaultValue(ToolBarButtonStyle.PushButton)] + [RefreshProperties(RefreshProperties.Repaint)] + public ToolBarButtonStyle Style + { + get => throw null; + set { } + } + + [Localizable(false)] + [Bindable(true)] + [DefaultValue(null)] + [TypeConverter(typeof(StringConverter))] + public object Tag + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue("")] + public string Text + { + get => throw null; + set { } + } + + [Localizable(true)] + [DefaultValue("")] + public string ToolTipText + { + get => throw null; + set { } + } + + [DefaultValue(true)] + [Localizable(true)] + public bool Visible + { + get => throw null; + set { } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventArgs.cs new file mode 100644 index 00000000000..431ae6aab82 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventArgs.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public class ToolBarButtonClickEventArgs : EventArgs +{ + public ToolBarButtonClickEventArgs(ToolBarButton button) => throw new PlatformNotSupportedException(); + + public ToolBarButton Button + { + get => throw null; + set { } + } +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventHandler.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventHandler.cs new file mode 100644 index 00000000000..f701edcc316 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonClickEventHandler.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +#nullable disable + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public delegate void ToolBarButtonClickEventHandler(object sender, ToolBarButtonClickEventArgs e); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonStyle.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonStyle.cs new file mode 100644 index 00000000000..6bf122955e5 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarButtonStyle.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum ToolBarButtonStyle +{ + PushButton = 1, + ToggleButton = 2, + Separator = 3, + DropDownButton = 4, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarTextAlign.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarTextAlign.cs new file mode 100644 index 00000000000..2ea70b12f2d --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/ToolBar/ToolBarTextAlign.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms; + +/// +/// This type is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. +/// +[Obsolete( + Obsoletions.ToolBarMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Browsable(false)] +public enum ToolBarTextAlign +{ + Underneath = 0, + Right = 1, +} diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/readme.md b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/readme.md new file mode 100644 index 00000000000..dc81dcc3320 --- /dev/null +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Unsupported/readme.md @@ -0,0 +1,47 @@ +### History +WinForms had documented some NETFX 1.1 APIs as obsolete in NETFX 2.0, but didn't decorate them with the [Obsolete] attributes. We shipped them in .NET3.0, then removed them completely in .NET3.1 - https://learn.microsoft.com/dotnet/core/compatibility/winforms#removed-controls. +The reason to remove these types was that replacement types have been implemented in .NET Framework 2.0 and we had stopped maintaining these classes. Meanwhile, they fell befind in support of the modern features and particularly they don't comply with the accessibility requirements. + +### Problem +Since then we received 2 requests to re-introduce the public surface in order to facilitate migration from the .NET Framework. Consider an application that supports extensibility plug ins compiled against the .NET Framework. .NET application can load .NET Framework assemblies if .NET Framework types can be forwarded to the .NET implementations, even if those implementations do nothing. Such plug-ins would load and work if they avoid the unsupported code. However, if the unsupported code is executed, the JIT throws a MissingMemberException that is hard to catch and handle. + +### Solution +We are re-adding the previously removed types as "hollow" types to provide binary compatibility. This "implementation" is copied from the .NET Framework 4.8.1 reference assembly. These types can't be executed, as they should be replaced with the modern counterparts as users migrate their applications. The main advantage is that now the above mentioned plugin would load and would throw PlatformNotSupportedException when the problematic code is executed instead of the missing member exceptions at JIT time. And the developer has an option for conditionally avoid calling the hollow methods. +We should not modify code in this folder. + +#### Description of changes: +* None of the re-added types can be constructed, all constructors throw new PlatformNotSupportedException(), default constructors are suppressed by introducing throwing public constructors if needed. +* All attributes that have been present on the .NET Framework types, are preserved, as they are accessible by reflection. +* All re-introduced types are decorated with [EditorBrowsable(EditorBrowsableState.Never)] attribute that hides them from the intellisense. Type names can be typed in by the developer manually and intellisense would show the same members as it did for .NET Framework projects. +* All re-introduced types are decorated with the ObsoleteAttribute that results in a compile time warning. All types share a single deprecation warning Id, to simplify suppression, but have different explanation messages. +* All re-introduced types are decorated with [Browsable(false)] attribute to not show custom control properties of these types in the property browser. +* All public members are re-introduced with their metadata, except for the private attributes. +* Members inherited from the base classes (Control, for example) are not re-introduced even if they had been overridden in the past because they are not required for binary compatibility, unless they are decorated with different attributes. +* Members that are re-added to the existing types (Form and Control) are returning defaults or doing nothing. +* Non-void public or protected instance members on the restored types `throw null`, not the `PlatformNotSupportedException` to save space. +* Void public or protected instance members do nothing. +* Public or protected fields return default values. +* Nullability is disabled for all re-added classes, structs and delegates for compatibility with the .NET Framework. + +### Use Case +.NET applications can reference .NET Framework 3rd party libraries that use these types. Code will JIT and if the unsupported code is executed, it will throw an exception that can be caught instead of JIT throwing a missing member exception. For example: + +```cs +if (control.ContextMenu is not null) +{ + control.ShowContextMenu(); +} +else +{ + // show a ContextMenuStrip +} + +try +{ + LegacyControl.ShowContextMenu(); +} +catch (PlatformNotSupportedException) +{ + // create a new ContextMenuStrip +} +``` \ No newline at end of file diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs index 6c535fa1940..026e8c5851a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs @@ -7127,4 +7127,38 @@ protected override void WndProc(ref Message m) break; } } + + // Unsupported types don't support nullability. +#nullable disable + /// + /// This property is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.MainMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public MainMenu Menu + { + get; + set; + } + + /// + /// This property is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. + /// + [Obsolete( + Obsoletions.MainMenuMessage, + error: false, + DiagnosticId = Obsoletions.UnsupportedControlsDiagnosticId, + UrlFormat = Obsoletions.SharedUrlFormat)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public MainMenu MergedMenu + { + get; + } +#nullable enable } diff --git a/src/System.Windows.Forms/tests/AxHosts/AxHosts.cs b/src/System.Windows.Forms/tests/AxHosts/AxHosts.cs index fa2d3595374..2889584c3f2 100644 --- a/src/System.Windows.Forms/tests/AxHosts/AxHosts.cs +++ b/src/System.Windows.Forms/tests/AxHosts/AxHosts.cs @@ -1,10 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.ComponentModel; using System.IO; namespace AxHosts; +[DesignerCategory("Default")] public partial class AxHosts : Form { public AxHosts() diff --git a/src/System.Windows.Forms/tests/CreateFrameworkTypes.cs b/src/System.Windows.Forms/tests/CreateFrameworkTypes.cs new file mode 100644 index 00000000000..fc860280e5a --- /dev/null +++ b/src/System.Windows.Forms/tests/CreateFrameworkTypes.cs @@ -0,0 +1,423 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Windows.Forms; + +namespace UnsupportedTypes; + +// For details see +// https://learn.microsoft.com/dotnet/desktop/winforms/controls/datagrid-control-overview-windows-forms +public sealed class CreateFrameworkTypes : IDisposable +{ + private ContextMenu _contextMenu; + private MenuItem _menuItem1; + private MenuItem _menuItem2; + private DataSet _dataSet; + private int _count; + + public void Dispose() + { + _contextMenu?.Dispose(); + _menuItem1?.Dispose(); + _menuItem2?.Dispose(); + Console.WriteLine(_count); + } + + // This test creates ContextMenu, Menu, Menu.MenuItemCollection, MenuItem, MenuMerge enum. + public void CreateMenus(Button button) + { + _contextMenu = new(); + _contextMenu.Popup += ContextMenu_Popup; + _contextMenu.MenuItems.Clear(); + _menuItem1 = new("Item1", OnClick); + _contextMenu.MenuItems.Add(_menuItem1); + _menuItem2 = new(MenuMerge.Add, mergeOrder: 0, Shortcut.Alt0, "Item2", onClick: null, OnPopup, OnSelect, [new("Item2-1"), new("Item2-2")]); + _menuItem2.MergeMenu(_menuItem1.CloneMenu()); + _contextMenu.MenuItems.Add(_menuItem2); + + _contextMenu.Show(button, button.Location); + + void OnClick(object sender, EventArgs e) => MessageBox.Show("Clicked Item1", "CreateContextMenu"); + void OnSelect(object sender, EventArgs e) => MessageBox.Show("Selected Item2", "CreateContextMenu"); + void OnPopup(object sender, EventArgs e) => MessageBox.Show("Item2 popped up", "CreateContextMenu"); + void ContextMenu_Popup(object sender, EventArgs e) => _contextMenu.MenuItems.Add(new MenuItem("Item3")); + } + + // This test creates MainMenu, MenuItem. + public static MainMenu CreateMainMenu() + { + MainMenu mainMenu = new(); + MenuItem fileMenuItem = new("MainMenuItem", (s, e) => MessageBox.Show("New menu item clicked", "MainMenu")); + mainMenu.MenuItems.Add(fileMenuItem); + + return mainMenu; + } + + // This method creates DataGrid, DataGridCell, DataGridLineStyle, DataGridParentRowsLabelStyle, DataGrid.HitTestInfo, + // DataGrid.HitTestType, DataGridTableStyle, DataGridColumnStyle, DataGridBoolColumn, DataGridTextBoxColumn, + // GridColumnStylesCollection, GridTableStylesCollection + public void CreateDataGrid(Form form) + { + DataGrid dataGrid = new() + { + DataMember = "", + HeaderForeColor = SystemColors.ControlText, + Location = new Point(200, 60), + Name = "dataGrid", + Size = new Size(300, 300), + TabIndex = 2 + }; + + form.Controls.Add(dataGrid); + + _dataSet = CreateDataSet(); + + // Bind the DataGrid to the DataSet. The dataMember + // specifies that the Customers table should be displayed. + dataGrid.SetDataBinding(_dataSet, "Customers"); + + AddCustomDataTableStyle(form, dataGrid, _dataSet); + + if (dataGrid.CurrentCell is DataGridCell dataGridCell) + { + dataGrid.CurrentCellChanged += (sender, e) => _count++; + } + + if (dataGrid.GridLineStyle == DataGridLineStyle.None) + { + dataGrid.GridLineStyle = DataGridLineStyle.Solid; + } + + if (dataGrid.ParentRowsLabelStyle == DataGridParentRowsLabelStyle.Both) + { + dataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName; + } + + DataGridTextBox textBox = new(); + textBox.SetDataGrid(dataGrid); + + dataGrid.MouseUp += DataGrid_MouseUp; + } + + // Creates ToolBar, ToolBarButton, ToolBar.ButtonCollection, ToolBarButtonClickEventArgs, ToolBarButtonClickEventHandler, + // ToolBarButtonCollection, ToolBarButtonStyle, ToolBarTextAlign, ToolBarAppearance. + public void CreateToolBar(Form form) + { + TestToolBar toolBar = new() + { + Appearance = ToolBarAppearance.Flat, + Buttons = + { + new ToolBarButton { Text = "toolBarButton1" }, + new ToolBarButton { Text = "toolBarButton2", Style = ToolBarButtonStyle.DropDownButton} + }, + DropDownArrows = true, + Location = new Point(0, 0), + Name = "toolBar1", + ShowToolTips = true, + Size = new Size(100, 42), + TabIndex = 0, + TextAlign = ToolBarTextAlign.Underneath + }; + + toolBar.ButtonClick += (sender, e) => _count++; + + form.Controls.Add(toolBar); + } + + // Creates StatusBar, StatusBarPanel, StatusBarPanelAutoSize, StatusBarPanelBorderStyle, StatusBarPanelCollection, + // StatusBarPanelClickEventHandler, StatusBarPanelStyle, StatusBarDrawItemEventArgs, StatusBarPanelClickEventArgs. + public void CreateStatusBar(Form form) + { + TestStatusBar statusBar = new() + { + Location = new Point(0, 0), + Name = "statusBar", + Size = new Size(100, 22), + TabIndex = 0, + Text = "Status Bar" + }; + + StatusBarPanel statusBarPanel = new() + { + Alignment = HorizontalAlignment.Center, + AutoSize = StatusBarPanelAutoSize.Contents, + BorderStyle = StatusBarPanelBorderStyle.Sunken, + MinWidth = 100, + Name = "statusBarPanel", + Style = StatusBarPanelStyle.OwnerDraw, + Text = "statusBarPanel", + Width = 100 + }; + + statusBar.PanelClick += (sender, e) => _count++; + statusBar.DrawItem += (sender, e) => _count++; + + statusBar.Panels.Add(statusBarPanel); + + form.Controls.Add(statusBar); + } + + /// + /// Create a DataSet with two tables and one relation. + /// + private static DataSet CreateDataSet() + { + // Create a DataSet. + DataSet dataSet = new("myDataSet"); + + // Create two DataTables. + DataTable customerDataTable = new("Customers"); + DataTable orderDataTable = new("Orders"); + + // Create two columns, and add them to the first table. + DataColumn customerIdDataColumn = new("CustID", typeof(int)); + DataColumn customerNameDataColumn = new("CustName"); + DataColumn currentDataColumn = new("Current", typeof(bool)); + customerDataTable.Columns.Add(customerIdDataColumn); + customerDataTable.Columns.Add(customerNameDataColumn); + customerDataTable.Columns.Add(currentDataColumn); + + // Create three columns, and add them to the second table. + DataColumn idDataColumn = new("CustID", typeof(int)); + DataColumn orderDateDataColumn = new("orderDate", typeof(DateTime)); + DataColumn orderAmountDataColumn = new("OrderAmount", typeof(decimal)); + orderDataTable.Columns.Add(orderAmountDataColumn); + orderDataTable.Columns.Add(idDataColumn); + orderDataTable.Columns.Add(orderDateDataColumn); + + // Add the tables to the DataSet. + dataSet.Tables.Add(customerDataTable); + dataSet.Tables.Add(orderDataTable); + + // Create a DataRelation, and add it to the DataSet. + DataRelation dataRelation = new DataRelation("customerToOrders", customerIdDataColumn, idDataColumn); + dataSet.Relations.Add(dataRelation); + + // Populates the tables. For each customer and order, creates two DataRow variables. + DataRow newRow1; + DataRow newRow2; + + // Create three customers in the Customers Table. + for (int i = 1; i < 4; i++) + { + newRow1 = customerDataTable.NewRow(); + newRow1["CustID"] = i; + // Add the row to the Customers table. + customerDataTable.Rows.Add(newRow1); + } + + // Give each customer a distinct name. + customerDataTable.Rows[0]["CustName"] = "Customer1"; + customerDataTable.Rows[1]["CustName"] = "Customer2"; + customerDataTable.Rows[2]["CustName"] = "Customer3"; + + // Give the Current column a value. + customerDataTable.Rows[0]["Current"] = true; + customerDataTable.Rows[1]["Current"] = true; + customerDataTable.Rows[2]["Current"] = false; + + // For each customer, create five rows in the Orders table. + for (int i = 1; i < 4; i++) + { + for (int j = 1; j < 6; j++) + { + newRow2 = orderDataTable.NewRow(); + newRow2["CustID"] = i; + newRow2["orderDate"] = new DateTime(2001, i, j * 2); + newRow2["OrderAmount"] = (i * 10) + (j * .1); + // Add the row to the Orders table. + orderDataTable.Rows.Add(newRow2); + } + } + + return dataSet; + } + + // This method creates DataGrid, DataGridTableStyle, DataGridColumnStyle, DataGridBoolColumn, DataGridTextBoxColumn, + // GridColumnStylesCollection, GridTableStylesCollection + public void AddCustomDataTableStyle(Form form, DataGrid dataGrid = null, DataSet dataSet = null) + { + dataGrid ??= new DataGrid(); + + dataSet ??= CreateDataSet(); + + DataGridTableStyle customerDGTableStyle = new() + { + MappingName = "Customers", + // Set other properties. + AlternatingBackColor = Color.LightGray + }; + + customerDGTableStyle.GridColumnStyles.CollectionChanged += (sender, e) => _count++; + + // Add a GridColumnStyle and set its MappingName + // to the name of a DataColumn in the DataTable. + // Set the HeaderText and Width properties. + + DataGridColumnStyle currentDGTableStyle = new DataGridBoolColumn + { + MappingName = "Current", + HeaderText = "IsCurrent Customer", + Width = 150 + }; + customerDGTableStyle.GridColumnStyles.Add(currentDGTableStyle); + + // Add a second column style. + DataGridColumnStyle customerNameDGTableStyle = new DataGridTextBoxColumn + { + MappingName = "customerName", + HeaderText = "Customer Name", + Width = 250 + }; + customerDGTableStyle.GridColumnStyles.Add(customerNameDGTableStyle); + + // Create the second table style with columns. + DataGridTableStyle OrderDGTableStyle = new() + { + MappingName = "Orders", + + // Set other properties. + AlternatingBackColor = Color.LightBlue + }; + + // Create new ColumnStyle objects + DataGridColumnStyle orderDateDGColumnStyle = new DataGridTextBoxColumn + { + MappingName = "OrderDate", + HeaderText = "Order Date", + Width = 100 + }; + OrderDGTableStyle.GridColumnStyles.Add(orderDateDGColumnStyle); + + // Use a PropertyDescriptor to create a formatted + // column. First get the PropertyDescriptorCollection + // for the data source and data member. + PropertyDescriptorCollection propertyDescriptorCollection = + form.BindingContext[dataSet, "Customers.customerToOrders"].GetItemProperties(); + + // Create a formatted column using a PropertyDescriptor. + // The formatting character "c" specifies a currency format. + DataGridColumnStyle csOrderAmount = new DataGridTextBoxColumn(propertyDescriptorCollection["OrderAmount"], "c", isDefault: true) + { + MappingName = "OrderAmount", + HeaderText = "Total", + Width = 100 + }; + OrderDGTableStyle.GridColumnStyles.Add(csOrderAmount); + + // Add the DataGridTableStyle instances to the GridTableStylesCollection. + dataGrid.TableStyles.Add(customerDGTableStyle); + dataGrid.TableStyles.Add(OrderDGTableStyle); + } + + public static void DataGrid_MouseUp(object sender, MouseEventArgs e) + { + DataGrid.HitTestInfo hitInfo = ((DataGrid)sender).HitTest(e.X, e.Y); + if (hitInfo == DataGrid.HitTestInfo.Nowhere) + { + return; + } + + if (hitInfo.Type == DataGrid.HitTestType.Cell) + { + MessageBox.Show($"Cell [{hitInfo.Column}, {hitInfo.Row}] clicked", "DataGrid"); + } + } + + public static bool InteropWithUnsupportedEnums( + DataGrid.HitTestType hitTestType, + DataGridLineStyle dataGridLineStyle, + DataGridParentRowsLabelStyle dataGridParentRowsLabelStyle, + MenuMerge menuMerge, + StatusBarPanelAutoSize statusBarPanelAutoSize, + StatusBarPanelBorderStyle statusBarPanelBorderStyle, + StatusBarPanelStyle statusBarPanelStyle, + ToolBarAppearance toolBarAppearance, + ToolBarButtonStyle toolBarButtonStyle, + ToolBarTextAlign toolBarTextAlign) + { + if (hitTestType != DataGrid.HitTestType.Caption) + { + return false; + } + + if (dataGridLineStyle != DataGridLineStyle.Solid) + { + return false; + } + + if (dataGridParentRowsLabelStyle != DataGridParentRowsLabelStyle.TableName) + { + return false; + } + + if (menuMerge != MenuMerge.Remove) + { + return false; + } + + if (statusBarPanelAutoSize != StatusBarPanelAutoSize.Spring) + { + return false; + } + + if (statusBarPanelBorderStyle != StatusBarPanelBorderStyle.Sunken) + { + return false; + } + + if (statusBarPanelStyle != StatusBarPanelStyle.OwnerDraw) + { + return false; + } + + if (toolBarAppearance != ToolBarAppearance.Flat) + { + return false; + } + + if (toolBarButtonStyle != ToolBarButtonStyle.DropDownButton) + { + return false; + } + + if (toolBarTextAlign != ToolBarTextAlign.Underneath) + { + return false; + } + + return true; + } + + private class TestToolBar : ToolBar + { + public void MyClick() + { + if (Buttons[0] is ToolBarButton button) + { + OnButtonClick(new ToolBarButtonClickEventArgs(button)); + } + } + } + + private class TestStatusBar : StatusBar + { + public void MyClick() + { + if (Panels[0] is StatusBarPanel panel) + { + OnPanelClick(new StatusBarPanelClickEventArgs(panel, MouseButtons.Middle, clicks: 1, x: 2, y: 3)); + } + } + + public void MyDrawItem() + { + OnDrawItem(new StatusBarDrawItemEventArgs(CreateGraphics(), font: null!, r: new(1, 1, 1, 1), itemId: 1, DrawItemState.Default, Panels[0])); + } + } +} \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/MainForm.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/MainForm.cs index c719dc271ab..ed81c65346d 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/MainForm.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/MainForm.cs @@ -291,9 +291,9 @@ private void UpdateLayout() int padding = overarchingFlowLayoutPanel.Controls[0].Margin.All; ClientSize = new Size( - (biggestButton.Width + padding * 2) * 3 + padding * 2 + overarchingFlowLayoutPanel.Location.X * 2, - (int)Math.Ceiling((overarchingFlowLayoutPanel.Controls.Count + 1) / 3.0) * (biggestButton.Height + padding * 2) - + padding * 2 + overarchingFlowLayoutPanel.Location.Y * 2); + ((biggestButton.Width + (padding * 2)) * 3) + (padding * 2) + (overarchingFlowLayoutPanel.Location.X * 2), + ((int)Math.Ceiling((overarchingFlowLayoutPanel.Controls.Count + 1) / 3.0) * (biggestButton.Height + (padding * 2))) + + (padding * 2) + (overarchingFlowLayoutPanel.Location.Y * 2)); MinimumSize = Size; Debug.WriteLine($"Minimum form size: {MinimumSize}", nameof(MainForm)); } diff --git a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ScrollableControls.cs b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ScrollableControls.cs index fa01269f1ec..5959b2ae824 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ScrollableControls.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/ScrollableControls.cs @@ -1,15 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace WinFormsControlsTest +namespace WinFormsControlsTest; + +[DesignerCategory("Default")] +public partial class ScrollableControls : Form { - [DesignerCategory("Default")] - public partial class ScrollableControls : Form + public ScrollableControls() { - public ScrollableControls() - { - InitializeComponent(); - treeView1.ExpandAll(); - } + InitializeComponent(); + treeView1.ExpandAll(); } } diff --git a/src/System.Windows.Forms/tests/TestUtilities/DialogHostForm.cs b/src/System.Windows.Forms/tests/TestUtilities/DialogHostForm.cs index c501bdd87e5..f8a4a4a24de 100644 --- a/src/System.Windows.Forms/tests/TestUtilities/DialogHostForm.cs +++ b/src/System.Windows.Forms/tests/TestUtilities/DialogHostForm.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.ComponentModel; using System.Windows.Forms; using Windows.Win32; using Windows.Win32.Foundation; @@ -12,6 +13,7 @@ namespace System; /// Helper class to host dialogs for testing. /// This class is typically passed as a parameter to a call to . /// +[DesignerCategory("Default")] internal class DialogHostForm : Form { protected override void WndProc(ref Message m) diff --git a/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj b/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj index a493260991c..5c84faa43d9 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj +++ b/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj @@ -66,6 +66,12 @@ + + + $(ArtifactsBinDir)\UnsupportedTypes\$(Configuration)\net472\UnsupportedTypes.dll + + + PreserveNewest diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/AccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/AccessibleObjectTests.cs index 24e12592c2b..633593093bf 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/AccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/AccessibleObjectTests.cs @@ -2690,6 +2690,13 @@ public void AccessibleObject_GetPropertyValue_ReturnsNull_IfExpected(int propert public static IEnumerable AccessibleObject_RuntimeId_IsOverridden_TestData() { +#pragma warning disable WFDEV006 // Type or member is obsolete + var dataGridColumnHeaderAccessibleObjectType = typeof(DataGridColumnStyle).GetNestedType("DataGridColumnHeaderAccessibleObject", BindingFlags.NonPublic); +#pragma warning restore WFDEV006 + var typesToIgnore = new[] + { + typeof(ComboBox.ChildAccessibleObject), + }; Assembly assembly = typeof(AccessibleObject).Assembly; foreach (Type type in assembly.GetTypes()) { @@ -2699,7 +2706,12 @@ public static IEnumerable AccessibleObject_RuntimeId_IsOverridden_Test continue; } - if (type == typeof(ComboBox.ChildAccessibleObject)) + if (type == dataGridColumnHeaderAccessibleObjectType) + { + continue; + } + + if (typesToIgnore.Contains(type)) { continue; } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/Control.ControlAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/Control.ControlAccessibleObjectTests.cs index 79a08c2e2a9..109da2ddf87 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/Control.ControlAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/Control.ControlAccessibleObjectTests.cs @@ -44,6 +44,17 @@ public class Control_ControlAccessibleObjectTests typeof(DateTimePicker), typeof(WebBrowser) ]; +#pragma warning disable WFDEV006 // Type or member is obsolete + private static readonly Type[] s_unsupportedControls = + [ + // These controls are implemented in .NET Framework only, NET10+ ships hollowed out types that can't be instantiated. + typeof(DataGrid), + typeof(StatusBar), + typeof(ToolBar), + typeof(DataGridTextBox) + ]; +#pragma warning restore WFDEV006 + [WinFormsFact] public void ControlAccessibleObject_Ctor_ControlWithoutHandle() { @@ -1233,7 +1244,9 @@ public void ControlAccessibleObject_Supports_LegacyIAccessiblePattern_IfOwnerSup public static IEnumerable ControlAccessibleObject_TestData() { - return ReflectionHelper.GetPublicNotAbstractClasses().Select(type => new object[] { type }); + return ReflectionHelper.GetPublicNotAbstractClasses() + .Where(t => !s_unsupportedControls.Contains(t)) + .Select(type => new object[] { type }); } [WinFormsTheory] @@ -1348,6 +1361,11 @@ public static IEnumerable ControlAccessibleObject_DefaultName_TestData foreach (Type type in ReflectionHelper.GetPublicNotAbstractClasses()) { + if (s_unsupportedControls.Contains(type)) + { + continue; + } + yield return new object[] { type, diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/Design/DesignerAttributeTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/Design/DesignerAttributeTests.cs index 66e9f681e27..fcd5da1e45d 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/Design/DesignerAttributeTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/Design/DesignerAttributeTests.cs @@ -13,23 +13,29 @@ namespace System.Windows.Forms.Design.Tests; public class DesignerAttributeTests { private const string AssemblyRef_SystemWinforms = $"System.Windows.Forms, Version={FXAssembly.Version}, Culture=neutral, PublicKeyToken={AssemblyRef.MicrosoftPublicKey}"; - private const string AssemblyRef_SystemWinformsDesign = $"System.Windows.Forms.Design, Version={FXAssembly.Version}, Culture=neutral, PublicKeyToken={AssemblyRef.MicrosoftPublicKey}"; private readonly ITestOutputHelper _output; private static ImmutableHashSet SkipList { get; } = [ - "System.Windows.Forms.Design.ControlBindingsConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.AxDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.AxHostDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.StatusBarDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.WebBrowserDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.DataGridViewColumnDataPropertyNameEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.DataGridViewComponentEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.DataMemberListEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.ToolStripCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", - "System.Windows.Forms.Design.ToolStripImageIndexEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", + $"System.Windows.Forms.Design.AxDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.AxHostDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.ControlBindingsConverter, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridColumnCollectionEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridColumnStyleFormatEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridColumnStyleMappingNameEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridTableStyleMappingNameEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridViewColumnDataPropertyNameEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataGridViewComponentEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataMemberFieldEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.DataMemberListEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.StatusBarDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.ToolBarButtonDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.ToolBarDesigner, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.ToolStripCollectionEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.ToolStripImageIndexEditor, {AssemblyRef.SystemDesign}", + $"System.Windows.Forms.Design.WebBrowserDesigner, {AssemblyRef.SystemDesign}", ]; public DesignerAttributeTests(ITestOutputHelper output) @@ -74,9 +80,9 @@ public static IEnumerable GetAttributeWithProperty_TestData(string ass [Theory] [MemberData(nameof(GetAttributeOfType_TestData), AssemblyRef_SystemWinforms, typeof(DesignerAttribute))] - public void DesignerAttributes_DesignerAttribute_TypeExists(Type annotatedType, DesignerAttribute attribute) + public void DesignerAttribute_TypeExists(Type annotatedType, DesignerAttribute attribute) { - var type = Type.GetType(attribute.DesignerTypeName, false); + var type = Type.GetType(attribute.DesignerTypeName, throwOnError: false); _output.WriteLine($"{annotatedType.FullName}: {attribute.DesignerTypeName} --> {type?.FullName}"); if (SkipList.Contains(attribute.DesignerTypeName)) @@ -91,8 +97,8 @@ public void DesignerAttributes_DesignerAttribute_TypeExists(Type annotatedType, [Theory] [MemberData(nameof(GetAttributeOfType_TestData), AssemblyRef.SystemDrawing, typeof(DesignerSerializerAttribute))] [MemberData(nameof(GetAttributeOfType_TestData), AssemblyRef_SystemWinforms, typeof(DesignerSerializerAttribute))] - [MemberData(nameof(GetAttributeOfType_TestData), AssemblyRef_SystemWinformsDesign, typeof(DesignerSerializerAttribute))] - public void DesignerAttributes_DesignerSerializerAttribute_TypeExists(Type annotatedType, DesignerSerializerAttribute attribute) + [MemberData(nameof(GetAttributeOfType_TestData), AssemblyRef.SystemDesign, typeof(DesignerSerializerAttribute))] + public void DesignerSerializerAttribute_TypeExists(Type annotatedType, DesignerSerializerAttribute attribute) { var type = Type.GetType(attribute.SerializerTypeName, false); _output.WriteLine($"{annotatedType.FullName}: {attribute.SerializerTypeName} --> {type?.FullName}"); @@ -108,17 +114,28 @@ public void DesignerAttributes_DesignerSerializerAttribute_TypeExists(Type annot [Theory] [MemberData(nameof(GetAttributeWithType_TestData), AssemblyRef_SystemWinforms, typeof(DefaultPropertyAttribute))] - public void DesignerAttributes_DefaultPropertyAttribute_PropertyExists(Type type, DefaultPropertyAttribute attribute) + public void DefaultPropertyAttribute_PropertyExists(Type type, DefaultPropertyAttribute attribute) { - var propertyInfo = type.GetProperty(attribute.Name); - _output.WriteLine($"{type.FullName}: {attribute.Name} --> {propertyInfo?.Name}"); + string property = attribute.Name; + var propertyInfo = type.GetProperty(property); + _output.WriteLine($"{type.FullName}: {property} --> {propertyInfo?.Name}"); - Assert.NotNull(propertyInfo); +#pragma warning disable WFDEV006 // Type or member is obsolete + if ((type == typeof(DataGridColumnStyle) && property == "Header") || (type == typeof(DataGridTextBox) && property == "GridEditName")) +#pragma warning restore WFDEV006 + { + // Attributes are defined on non-instanciatiable base classes, but the corresponding properties are available on the derived classes. + Assert.Null(propertyInfo); + } + else + { + Assert.NotNull(propertyInfo); + } } [Theory] [MemberData(nameof(GetAttributeWithType_TestData), AssemblyRef_SystemWinforms, typeof(DefaultBindingPropertyAttribute))] - public void DesignerAttributes_DefaultBindingPropertyAttribute_PropertyExists(Type type, DefaultBindingPropertyAttribute attribute) + public void DefaultBindingPropertyAttribute_PropertyExists(Type type, DefaultBindingPropertyAttribute attribute) { var propertyInfo = type.GetProperty(attribute.Name); _output.WriteLine($"{type.FullName}: {attribute.Name} --> {propertyInfo?.Name}"); @@ -128,7 +145,7 @@ public void DesignerAttributes_DefaultBindingPropertyAttribute_PropertyExists(Ty [Theory] [MemberData(nameof(GetAttributeWithType_TestData), AssemblyRef_SystemWinforms, typeof(DefaultEventAttribute))] - public void DesignerAttributes_DefaultEventAttribute_EventExists(Type type, DefaultEventAttribute attribute) + public void DefaultEventAttribute_EventExists(Type type, DefaultEventAttribute attribute) { var eventInfo = type.GetEvent(attribute.Name); _output.WriteLine($"{type.FullName}: {attribute.Name} --> {eventInfo?.Name}"); @@ -139,7 +156,7 @@ public void DesignerAttributes_DefaultEventAttribute_EventExists(Type type, Defa [Theory] [MemberData(nameof(GetAttributeOfTypeAndProperty_TestData), AssemblyRef.SystemDrawing, typeof(TypeConverterAttribute))] [MemberData(nameof(GetAttributeOfTypeAndProperty_TestData), AssemblyRef_SystemWinforms, typeof(TypeConverterAttribute))] - public void DesignerAttributes_TypeConverterAttribute_TypeExists(string subject, TypeConverterAttribute attribute) + public void TypeConverterAttribute_TypeExists(string subject, TypeConverterAttribute attribute) { var type = Type.GetType(attribute.ConverterTypeName, false); _output.WriteLine($"{subject}: {attribute.ConverterTypeName} --> {type?.Name}"); @@ -156,7 +173,7 @@ public void DesignerAttributes_TypeConverterAttribute_TypeExists(string subject, [Theory] [MemberData(nameof(GetAttributeOfTypeAndProperty_TestData), AssemblyRef.SystemDrawing, typeof(EditorAttribute))] [MemberData(nameof(GetAttributeOfTypeAndProperty_TestData), AssemblyRef_SystemWinforms, typeof(EditorAttribute))] - public void DesignerAttributes_EditorAttribute_TypeExists(string subject, EditorAttribute attribute) + public void EditorAttribute_TypeExists(string subject, EditorAttribute attribute) { var type = Type.GetType(attribute.EditorTypeName, false); _output.WriteLine($"{subject}: {attribute.EditorTypeName} --> {type?.Name}"); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/UnsupportedTypesTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/UnsupportedTypesTests.cs new file mode 100644 index 00000000000..ea396942e19 --- /dev/null +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/UnsupportedTypesTests.cs @@ -0,0 +1,227 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +using System.ComponentModel; +using System.Drawing; +using UnsupportedTypes; + +namespace System.Windows.Forms.Tests; + +// Test for https://github.com/dotnet/winforms/issues/3783 +public class UnsupportedTypesTests +{ +#pragma warning disable WFDEV006, CS0618 // Type or member is obsolete + + public static TheoryData UnsupportedControlsConstructors => + [ + () => new ContextMenu(), + () => new ContextMenu(menuItems: null!), + () => new DataGrid(), + () => new DataGridBoolColumn(), + () => new DataGridBoolColumn(prop: null!), + () => new DataGridBoolColumn(prop: null!, isDefault: true), + () => new DataGridCell(r:1, c: 2), + () => new DataGridPreferredColumnWidthTypeConverter(), + () => new DataGridTableStyle(), + () => new DataGridTableStyle(isDefaultTableStyle: true), + () => new DataGridTableStyle(listManager: null!), + () => new DataGridTextBox(), + () => new DataGridTextBoxColumn(), + () => new DataGridTextBoxColumn(prop: null!), + () => new DataGridTextBoxColumn(prop: null!, format: "format"), + () => new DataGridTextBoxColumn(prop: null!, format: "format", isDefault: true), + () => new DataGridTextBoxColumn(prop : null!, isDefault: false), + () => new TestDataGridColumnStyle(), + TestDataGridColumnStyle.CreateCompModSwitches, + () => new TestDataGridColumnStyle(prop: null!), + TestDataGridColumnStyle.Create_DataGridColumnHeaderAccessibleObject, + TestDataGridColumnStyle.Create_DataGridColumnHeaderAccessibleObject1, + () => GridTablesFactory.CreateGridTables(gridTable: null!, dataSource: null!, dataMember: "data member", bindingManager: null!), + () => new Menu.MenuItemCollection(owner: null!), + () => new MainMenu(), + () => new MainMenu(container: null!), + () => new MainMenu(items: null!), + () => new MenuItem(), + () => new MenuItem(text: "text"), + () => new MenuItem(text: "text", onClick: null!), + () => new MenuItem(text: "text", onClick: null!, Shortcut.Alt0), + () => new MenuItem(text: "text", items: null!), + () => new MenuItem(MenuMerge.Add, mergeOrder: 1, Shortcut.Alt0, text: "text", onClick: null!, onPopup: null!, onSelect: null, items: null!), + () => new StatusBar(), + () => new StatusBar.StatusBarPanelCollection(owner: null!), + () => new StatusBarPanel(), + () => new StatusBarPanelClickEventArgs(statusBarPanel: null!, MouseButtons.Left, clicks: 1, x: 1, y: 1), + () => new ToolBar(), + () => new ToolBarButton(), + () => new ToolBarButton(text: "text"), + () => new ToolBar.ToolBarButtonCollection(owner: null!), + () => new ToolBarButtonClickEventArgs(button: null!) + ]; + + [Theory] + [MemberData(nameof(UnsupportedControlsConstructors))] + public void UnsupportedControl_Constructor_Throws(Action action) => + action.Should().Throw(); + + [Fact] + public void CompModSwitches_Throw() => + ((Func)(() => TestDataGridColumnStyle.Call_DGEditColumnEditing())).Should().Throw(); + + [Fact] + public void DataGridTableStyle_static_IsDefault() => + DataGridTableStyle.DefaultTableStyle.Should().BeNull(); + + [Fact] + public void DataGrid_HitTestInfo_Nowhere_static_IsDefault() => + DataGrid.HitTestInfo.Nowhere.Should().BeNull(); + + [Fact] + public void StatusBarDrawItemEventArgs_Constructor_Throws() + { + using Control control = new(); + using Graphics graphics = control.CreateGraphics(); + Rectangle rectangle = new(1, 2, 3, 4); + + ((Action)(() => new StatusBarDrawItemEventArgs(graphics, font: null!, rectangle, itemId: 0, DrawItemState.Checked, panel: null!))) + .Should().Throw(); + ((Action)(() => new StatusBarDrawItemEventArgs(graphics, font: null!, rectangle, itemId: 0, DrawItemState.Checked, panel: null!, foreColor: Color.Red, backColor: Color.Black))) + .Should().Throw(); + } + + [Fact] + public void Control_ContextMenu() + { + using Control control = new(); + + control.ContextMenu.Should().BeNull(); + control.ContextMenu = null; + } + + [Fact] + public void Control_ContextMenuChanged() + { + using ControlWithContextMenu control = new(); + int contextMenuChangedCount = 0; + + control.ContextMenuChanged += Control_ContextMenuChanged1; + control.OnContextMenuChanged(EventArgs.Empty); + contextMenuChangedCount.Should().Be(0); + control.OnContextMenuChangedCount.Should().Be(1); + control.ContextMenuChanged -= Control_ContextMenuChanged1; + + void Control_ContextMenuChanged1(object? sender, EventArgs e) => contextMenuChangedCount++; + } + + [Fact] + public void Form_Menu() + { + using Form form = new(); + + form.Menu.Should().BeNull(); + form.Menu = null; + } + + [Fact] + public void Form_MergedMenu() + { + using Form form = new(); + form.MergedMenu.Should().BeNull(); + } + + [Fact] + public void CreateMenus_Throws() + { + using Button button = new(); + using CreateFrameworkTypes createFrameworkTypes = new(); + ((Action)(() => createFrameworkTypes.CreateMenus(button))).Should().Throw(); + } + + [Fact] + public void CreateMainMenu_Throws() + { + using Form form = new(); + ((Action)(() => form.Menu = CreateFrameworkTypes.CreateMainMenu())).Should().Throw(); + } + + [Fact] + public void CreateDataGrid_Throws() + { + using Form form = new(); + using CreateFrameworkTypes createFrameworkTypes = new(); + ((Action)(() => createFrameworkTypes.CreateDataGrid(form))).Should().Throw(); + } + + [Fact] + public void AddCustomDataTableStyle_Throws() + { + using Form form = new(); + using CreateFrameworkTypes createFrameworkTypes = new(); + ((Action)(() => createFrameworkTypes.AddCustomDataTableStyle(form))).Should().Throw(); + } + + [Fact] + public void AccessHitTestInfo_DoesNotThrowMissingField() => + ((Action)(() => CreateFrameworkTypes.DataGrid_MouseUp(null, null))).Should().Throw(); + + [Fact] + public void CreateToolBar_Throws() + { + using Form form = new(); + using CreateFrameworkTypes createFrameworkTypes = new(); + ((Action)(() => createFrameworkTypes.CreateToolBar(form))).Should().Throw(); + } + + [Fact] + public void CreateStatusBar_Throws() + { + using Form form = new(); + using CreateFrameworkTypes createFrameworkTypes = new(); + ((Action)(() => createFrameworkTypes.CreateStatusBar(form))).Should().Throw(); + } + + [Fact] + public void InteropWithUnsupportedEnums() + { + CreateFrameworkTypes.InteropWithUnsupportedEnums( + DataGrid.HitTestType.Caption, + DataGridLineStyle.Solid, + DataGridParentRowsLabelStyle.TableName, + MenuMerge.Remove, + StatusBarPanelAutoSize.Spring, + StatusBarPanelBorderStyle.Sunken, + StatusBarPanelStyle.OwnerDraw, + ToolBarAppearance.Flat, + ToolBarButtonStyle.DropDownButton, + ToolBarTextAlign.Underneath).Should().BeTrue(); + } + + internal class ControlWithContextMenu : Control + { + public int OnContextMenuChangedCount; + public new void OnContextMenuChanged(EventArgs e) + { + OnContextMenuChangedCount++; + base.OnContextMenuChanged(e); + } + } + + internal class TestDataGridColumnStyle : DataGridColumnStyle + { + public TestDataGridColumnStyle() : base() { } + public TestDataGridColumnStyle(PropertyDescriptor prop) : base(prop) { } + public static void Create_DataGridColumnHeaderAccessibleObject() => _ = new DataGridColumnHeaderAccessibleObject(); + public static void Create_DataGridColumnHeaderAccessibleObject1() => _ = new DataGridColumnHeaderAccessibleObject(owner: null!); + public static void CreateCompModSwitches() => _ = new CompModSwitches(); + public static bool Call_DGEditColumnEditing() => CompModSwitches.DGEditColumnEditing.TraceError; + protected internal override void Abort(int rowNum) => throw new NotImplementedException(); + protected internal override bool Commit(CurrencyManager dataSource, int rowNum) => throw new NotImplementedException(); + protected internal override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly, string displayText, bool cellIsVisible) => throw new NotImplementedException(); + protected internal override int GetMinimumHeight() => throw new NotImplementedException(); + protected internal override int GetPreferredHeight(Graphics g, object value) => throw new NotImplementedException(); + protected internal override Size GetPreferredSize(Graphics g, object value) => throw new NotImplementedException(); + protected internal override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, bool alignToRight) => throw new NotImplementedException(); + protected internal override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum) => throw new NotImplementedException(); + } +} diff --git a/src/System.Windows.Forms/tests/UnsupportedTypes.csproj b/src/System.Windows.Forms/tests/UnsupportedTypes.csproj new file mode 100644 index 00000000000..ff2fd5e0bf0 --- /dev/null +++ b/src/System.Windows.Forms/tests/UnsupportedTypes.csproj @@ -0,0 +1,20 @@ + + + + Library + net472 + disable + true + preview + UnsupportedTypes + UnsupportedTypes + true + Open + disable + false + AnyCPU + false + false + + + \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/UnsupportedTypes/App.config b/src/System.Windows.Forms/tests/UnsupportedTypes/App.config new file mode 100644 index 00000000000..56efbc7b5f1 --- /dev/null +++ b/src/System.Windows.Forms/tests/UnsupportedTypes/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/UnsupportedTypes/CreateFrameworkTypes.cs b/src/System.Windows.Forms/tests/UnsupportedTypes/CreateFrameworkTypes.cs new file mode 100644 index 00000000000..eeb1ad094cd --- /dev/null +++ b/src/System.Windows.Forms/tests/UnsupportedTypes/CreateFrameworkTypes.cs @@ -0,0 +1,423 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Windows.Forms; + +namespace UnsupportedTypes; + +// For details see +// https://learn.microsoft.com/dotnet/desktop/winforms/controls/datagrid-control-overview-windows-forms +public sealed class CreateFrameworkTypes : IDisposable +{ + private ContextMenu _contextMenu; + private MenuItem _menuItem1; + private MenuItem _menuItem2; + private DataSet _dataSet; + private int _count; + + public void Dispose() + { + _contextMenu?.Dispose(); + _menuItem1?.Dispose(); + _menuItem2?.Dispose(); + Console.WriteLine(_count); + } + + // This test creates ContextMenu, Menu, Menu.MenuItemCollection, MenuItem, MenuMerge enum. + public void CreateMenus(Button button) + { + _contextMenu = new(); + _contextMenu.Popup += ContextMenu_Popup; + _contextMenu.MenuItems.Clear(); + _menuItem1 = new("Item1", OnClick); + _contextMenu.MenuItems.Add(_menuItem1); + _menuItem2 = new(MenuMerge.Add, mergeOrder: 0, Shortcut.Alt0, "Item2", onClick: null, OnPopup, OnSelect, [new("Item2-1"), new("Item2-2")]); + _menuItem2.MergeMenu(_menuItem1.CloneMenu()); + _contextMenu.MenuItems.Add(_menuItem2); + + _contextMenu.Show(button, button.Location); + + void OnClick(object sender, EventArgs e) => MessageBox.Show("Clicked Item1", "CreateContextMenu"); + void OnSelect(object sender, EventArgs e) => MessageBox.Show("Selected Item2", "CreateContextMenu"); + void OnPopup(object sender, EventArgs e) => MessageBox.Show("Item2 popped up", "CreateContextMenu"); + void ContextMenu_Popup(object sender, EventArgs e) => _contextMenu.MenuItems.Add(new MenuItem("Item3")); + } + + // This test creates MainMenu, MenuItem. + public static MainMenu CreateMainMenu() + { + MainMenu mainMenu = new(); + MenuItem fileMenuItem = new("MainMenuItem", (s, e) => MessageBox.Show("New menu item clicked", "MainMenu")); + mainMenu.MenuItems.Add(fileMenuItem); + + return mainMenu; + } + + // This method creates DataGrid, DataGridCell, DataGridLineStyle, DataGridParentRowsLabelStyle, DataGrid.HitTestInfo, + // DataGrid.HitTestType, DataGridTableStyle, DataGridColumnStyle, DataGridBoolColumn, DataGridTextBoxColumn, + // GridColumnStylesCollection, GridTableStylesCollection + public void CreateDataGrid(Form form) + { + DataGrid dataGrid = new() + { + DataMember = "", + HeaderForeColor = SystemColors.ControlText, + Location = new Point(200, 60), + Name = "dataGrid", + Size = new Size(300, 300), + TabIndex = 2 + }; + + form.Controls.Add(dataGrid); + + _dataSet = CreateDataSet(); + + // Bind the DataGrid to the DataSet. The dataMember + // specifies that the Customers table should be displayed. + dataGrid.SetDataBinding(_dataSet, "Customers"); + + AddCustomDataTableStyle(form, dataGrid, _dataSet); + + if (dataGrid.CurrentCell is DataGridCell dataGridCell) + { + dataGrid.CurrentCellChanged += (sender, e) => _count++; + } + + if (dataGrid.GridLineStyle == DataGridLineStyle.None) + { + dataGrid.GridLineStyle = DataGridLineStyle.Solid; + } + + if (dataGrid.ParentRowsLabelStyle == DataGridParentRowsLabelStyle.Both) + { + dataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName; + } + + DataGridTextBox textBox = new(); + textBox.SetDataGrid(dataGrid); + + dataGrid.MouseUp += DataGrid_MouseUp; + } + + // Creates ToolBar, ToolBarButton, ToolBar.ButtonCollection, ToolBarButtonClickEventArgs, ToolBarButtonClickEventHandler, + // ToolBarButtonCollection, ToolBarButtonStyle, ToolBarTextAlign, ToolBarAppearance. + public void CreateToolBar(Form form) + { + TestToolBar toolBar = new() + { + Appearance = ToolBarAppearance.Flat, + Buttons = + { + new ToolBarButton { Text = "toolBarButton1" }, + new ToolBarButton { Text = "toolBarButton2", Style = ToolBarButtonStyle.DropDownButton} + }, + DropDownArrows = true, + Location = new Point(0, 0), + Name = "toolBar1", + ShowToolTips = true, + Size = new Size(100, 42), + TabIndex = 0, + TextAlign = ToolBarTextAlign.Underneath + }; + + toolBar.ButtonClick += (sender, e) => _count++; + + form.Controls.Add(toolBar); + } + + // Creates StatusBar, StatusBarPanel, StatusBarPanelAutoSize, StatusBarPanelBorderStyle, StatusBarPanelCollection, + // StatusBarPanelClickEventHandler, StatusBarPanelStyle, StatusBarDrawItemEventArgs, StatusBarPanelClickEventArgs. + public void CreateStatusBar(Form form) + { + TestStatusBar statusBar = new() + { + Location = new Point(0, 0), + Name = "statusBar", + Size = new Size(100, 22), + TabIndex = 0, + Text = "Status Bar" + }; + + StatusBarPanel statusBarPanel = new() + { + Alignment = HorizontalAlignment.Center, + AutoSize = StatusBarPanelAutoSize.Contents, + BorderStyle = StatusBarPanelBorderStyle.Sunken, + MinWidth = 100, + Name = "statusBarPanel", + Style = StatusBarPanelStyle.OwnerDraw, + Text = "statusBarPanel", + Width = 100 + }; + + statusBar.PanelClick += (sender, e) => _count++; + statusBar.DrawItem += (sender, e) => _count++; + + statusBar.Panels.Add(statusBarPanel); + + form.Controls.Add(statusBar); + } + + /// + /// Create a DataSet with two tables and one relation. + /// + private static DataSet CreateDataSet() + { + // Create a DataSet. + DataSet dataSet = new("myDataSet"); + + // Create two DataTables. + DataTable customerDataTable = new("Customers"); + DataTable orderDataTable = new("Orders"); + + // Create two columns, and add them to the first table. + DataColumn customerIdDataColumn = new("CustID", typeof(int)); + DataColumn customerNameDataColumn = new("CustName"); + DataColumn currentDataColumn = new("Current", typeof(bool)); + customerDataTable.Columns.Add(customerIdDataColumn); + customerDataTable.Columns.Add(customerNameDataColumn); + customerDataTable.Columns.Add(currentDataColumn); + + // Create three columns, and add them to the second table. + DataColumn idDataColumn = new("CustID", typeof(int)); + DataColumn orderDateDataColumn = new("orderDate", typeof(DateTime)); + DataColumn orderAmountDataColumn = new("OrderAmount", typeof(decimal)); + orderDataTable.Columns.Add(orderAmountDataColumn); + orderDataTable.Columns.Add(idDataColumn); + orderDataTable.Columns.Add(orderDateDataColumn); + + // Add the tables to the DataSet. + dataSet.Tables.Add(customerDataTable); + dataSet.Tables.Add(orderDataTable); + + // Create a DataRelation, and add it to the DataSet. + DataRelation dataRelation = new DataRelation("customerToOrders", customerIdDataColumn, idDataColumn); + dataSet.Relations.Add(dataRelation); + + // Populates the tables. For each customer and order, creates two DataRow variables. + DataRow newRow1; + DataRow newRow2; + + // Create three customers in the Customers Table. + for (int i = 1; i < 4; i++) + { + newRow1 = customerDataTable.NewRow(); + newRow1["CustID"] = i; + // Add the row to the Customers table. + customerDataTable.Rows.Add(newRow1); + } + + // Give each customer a distinct name. + customerDataTable.Rows[0]["CustName"] = "Customer1"; + customerDataTable.Rows[1]["CustName"] = "Customer2"; + customerDataTable.Rows[2]["CustName"] = "Customer3"; + + // Give the Current column a value. + customerDataTable.Rows[0]["Current"] = true; + customerDataTable.Rows[1]["Current"] = true; + customerDataTable.Rows[2]["Current"] = false; + + // For each customer, create five rows in the Orders table. + for (int i = 1; i < 4; i++) + { + for (int j = 1; j < 6; j++) + { + newRow2 = orderDataTable.NewRow(); + newRow2["CustID"] = i; + newRow2["orderDate"] = new DateTime(2001, i, j * 2); + newRow2["OrderAmount"] = (i * 10) + (j * .1); + // Add the row to the Orders table. + orderDataTable.Rows.Add(newRow2); + } + } + + return dataSet; + } + + // This method creates DataGrid, DataGridTableStyle, DataGridColumnStyle, DataGridBoolColumn, DataGridTextBoxColumn, + // GridColumnStylesCollection, GridTableStylesCollection + public void AddCustomDataTableStyle(Form form, DataGrid dataGrid = null, DataSet dataSet = null) + { + dataGrid ??= new DataGrid(); + + dataSet ??= CreateDataSet(); + + DataGridTableStyle customerDGTableStyle = new() + { + MappingName = "Customers", + // Set other properties. + AlternatingBackColor = Color.LightGray + }; + + customerDGTableStyle.GridColumnStyles.CollectionChanged += (sender, e) => _count++; + + // Add a GridColumnStyle and set its MappingName + // to the name of a DataColumn in the DataTable. + // Set the HeaderText and Width properties. + + DataGridColumnStyle currentDGTableStyle = new DataGridBoolColumn + { + MappingName = "Current", + HeaderText = "IsCurrent Customer", + Width = 150 + }; + customerDGTableStyle.GridColumnStyles.Add(currentDGTableStyle); + + // Add a second column style. + DataGridColumnStyle customerNameDGTableStyle = new DataGridTextBoxColumn + { + MappingName = "customerName", + HeaderText = "Customer Name", + Width = 250 + }; + customerDGTableStyle.GridColumnStyles.Add(customerNameDGTableStyle); + + // Create the second table style with columns. + DataGridTableStyle OrderDGTableStyle = new() + { + MappingName = "Orders", + + // Set other properties. + AlternatingBackColor = Color.LightBlue + }; + + // Create new ColumnStyle objects + DataGridColumnStyle orderDateDGColumnStyle = new DataGridTextBoxColumn + { + MappingName = "OrderDate", + HeaderText = "Order Date", + Width = 100 + }; + OrderDGTableStyle.GridColumnStyles.Add(orderDateDGColumnStyle); + + // Use a PropertyDescriptor to create a formatted + // column. First get the PropertyDescriptorCollection + // for the data source and data member. + PropertyDescriptorCollection propertyDescriptorCollection = + form.BindingContext[dataSet, "Customers.customerToOrders"].GetItemProperties(); + + // Create a formatted column using a PropertyDescriptor. + // The formatting character "c" specifies a currency format. + DataGridColumnStyle csOrderAmount = new DataGridTextBoxColumn(propertyDescriptorCollection["OrderAmount"], "c", isDefault: true) + { + MappingName = "OrderAmount", + HeaderText = "Total", + Width = 100 + }; + OrderDGTableStyle.GridColumnStyles.Add(csOrderAmount); + + // Add the DataGridTableStyle instances to the GridTableStylesCollection. + dataGrid.TableStyles.Add(customerDGTableStyle); + dataGrid.TableStyles.Add(OrderDGTableStyle); + } + + public static void DataGrid_MouseUp(object sender, MouseEventArgs e) + { + DataGrid.HitTestInfo hitInfo = ((DataGrid)sender).HitTest(e.X, e.Y); + if (hitInfo == DataGrid.HitTestInfo.Nowhere) + { + return; + } + + if (hitInfo.Type == DataGrid.HitTestType.Cell) + { + MessageBox.Show($"Cell [{hitInfo.Column}, {hitInfo.Row}] clicked", "DataGrid"); + } + } + + public static bool InteropWithUnsupportedEnums( + DataGrid.HitTestType hitTestType, + DataGridLineStyle dataGridLineStyle, + DataGridParentRowsLabelStyle dataGridParentRowsLabelStyle, + MenuMerge menuMerge, + StatusBarPanelAutoSize statusBarPanelAutoSize, + StatusBarPanelBorderStyle statusBarPanelBorderStyle, + StatusBarPanelStyle statusBarPanelStyle, + ToolBarAppearance toolBarAppearance, + ToolBarButtonStyle toolBarButtonStyle, + ToolBarTextAlign toolBarTextAlign) + { + if (hitTestType != DataGrid.HitTestType.Caption) + { + return false; + } + + if (dataGridLineStyle != DataGridLineStyle.Solid) + { + return false; + } + + if (dataGridParentRowsLabelStyle != DataGridParentRowsLabelStyle.TableName) + { + return false; + } + + if (menuMerge != MenuMerge.Remove) + { + return false; + } + + if (statusBarPanelAutoSize != StatusBarPanelAutoSize.Spring) + { + return false; + } + + if (statusBarPanelBorderStyle != StatusBarPanelBorderStyle.Sunken) + { + return false; + } + + if (statusBarPanelStyle != StatusBarPanelStyle.OwnerDraw) + { + return false; + } + + if (toolBarAppearance != ToolBarAppearance.Flat) + { + return false; + } + + if (toolBarButtonStyle != ToolBarButtonStyle.DropDownButton) + { + return false; + } + + if (toolBarTextAlign != ToolBarTextAlign.Underneath) + { + return false; + } + + return true; + } + + private class TestToolBar : ToolBar + { + public void MyClick() + { + if (Buttons[0] is ToolBarButton button) + { + OnButtonClick(new ToolBarButtonClickEventArgs(button)); + } + } + } + + private class TestStatusBar : StatusBar + { + public void MyClick() + { + if (Panels[0] is StatusBarPanel panel) + { + OnPanelClick(new StatusBarPanelClickEventArgs(panel, MouseButtons.Middle, clicks: 1, x: 2, y: 3)); + } + } + + public void MyDrawItem() + { + OnDrawItem(new StatusBarDrawItemEventArgs(CreateGraphics(), font: null!, r: new(1, 1, 1, 1), itemId: 1, DrawItemState.Default, Panels[0])); + } + } +} diff --git a/src/System.Windows.Forms/tests/UnsupportedTypes/UnsupportedTypes.csproj b/src/System.Windows.Forms/tests/UnsupportedTypes/UnsupportedTypes.csproj new file mode 100644 index 00000000000..4c49b92c7bc --- /dev/null +++ b/src/System.Windows.Forms/tests/UnsupportedTypes/UnsupportedTypes.csproj @@ -0,0 +1,20 @@ + + + + Library + net472 + disable + true + preview + UnsupportedTypes + UnsupportedTypes + true + Open + disable + false + AnyCPU + false + false + + + \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/app.config b/src/System.Windows.Forms/tests/app.config new file mode 100644 index 00000000000..20939707c81 --- /dev/null +++ b/src/System.Windows.Forms/tests/app.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file