From 17fd2a33ecb8f56c03a8798b5025f115bdea3d58 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Tue, 6 Feb 2024 20:01:31 -0800 Subject: [PATCH] Some simple format cleanup (#10842) Clean up some of what hits `dotnet format` on System.Windows.Forms. --- .../Forms/ActiveX/AxHost.PropertyBagStream.cs | 2 +- .../Control.ActiveXImpl.PropertyBagStream.cs | 2 +- .../ActiveX/Control_ActiveXControlInterfaces.cs | 2 +- .../Windows/Forms/Application.ThreadContext.cs | 6 +++--- .../src/System/Windows/Forms/Application.cs | 2 +- .../COM2IManagedPerPropertyBrowsingHandler.cs | 2 +- .../COM2Interop/COM2TypeInfoProcessor.cs | 2 +- .../ComboBox/ComboBox.ComboBoxUiaTextProvider.cs | 2 +- .../DataGridView/DataGridView.Methods.cs | 2 +- ...ListBox.CheckedListBoxItemAccessibleObject.cs | 2 +- .../ListView/ListView.ListViewItemCollection.cs | 16 ++++++++-------- ...tViewItem.ListViewItemBaseAccessibleObject.cs | 15 ++++++++++----- ...onthCalendar.MonthCalendarAccessibleObject.cs | 2 +- .../Forms/Controls/PropertyGrid/PropertyGrid.cs | 4 ++-- .../PropertyGridInternal/PropertyGridView.cs | 5 ++++- .../ToolStrips/ToolStripHighContrastRenderer.cs | 2 +- .../Forms/Controls/ToolStrips/ToolStripItem.cs | 2 +- ...on.ToolStripOverflowButtonAccessibleObject.cs | 6 +++--- .../Controls/ToolStrips/ToolStripPanelRow.cs | 4 ++-- .../Controls/WebBrowser/HtmlElementCollection.cs | 2 +- .../WebBrowser/WebBrowser.WebBrowserSite.cs | 4 ++-- .../Controls/WebBrowser/WebBrowserSiteBase.cs | 2 +- .../Forms/DataBinding/BindingManagerBase.cs | 6 +++++- .../Forms/Dialogs/TaskDialog/TaskDialog.cs | 2 +- .../Forms/Dialogs/TaskDialog/TaskDialogPage.cs | 2 +- .../Forms/Layout/TableLayout.LayoutInfo.cs | 4 ++-- .../Windows/Forms/MDI/MdiWindowListStrip.cs | 6 +++--- .../Windows/Forms/OLE/DataObject.BitmapBinder.cs | 2 +- 28 files changed, 61 insertions(+), 49 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs index 4d5d1ed0b8a..ade948fdaf9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.PropertyBagStream.cs @@ -5,8 +5,8 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms.BinaryFormat; using Windows.Win32.System.Com; -using Windows.Win32.System.Variant; using Windows.Win32.System.Com.StructuredStorage; +using Windows.Win32.System.Variant; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs index 968c3263d1f..1d74c44d449 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.PropertyBagStream.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Windows.Forms.BinaryFormat; using Windows.Win32.System.Com; using Windows.Win32.System.Com.StructuredStorage; using Windows.Win32.System.Variant; -using System.Windows.Forms.BinaryFormat; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control_ActiveXControlInterfaces.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control_ActiveXControlInterfaces.cs index c0dcac85e28..7487db545f9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control_ActiveXControlInterfaces.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control_ActiveXControlInterfaces.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Drawing; +using System.Runtime.InteropServices; using Windows.Win32.System.Com; using Windows.Win32.System.Com.StructuredStorage; using Windows.Win32.System.Ole; -using System.Runtime.InteropServices; using ComIDataObject = Windows.Win32.System.Com.IDataObject; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs index 6c01d1fc4ea..165ba210e36 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs @@ -3,13 +3,13 @@ using System.ComponentModel; using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; +using System.Windows.Forms.Primitives; +using Microsoft.Office; using Windows.Win32.System.Com; using ComIMessageFilter = Windows.Win32.Media.Audio.IMessageFilter; using ComIServiceProvider = Windows.Win32.System.Com.IServiceProvider; -using Microsoft.Office; -using System.Windows.Forms.Primitives; -using System.Runtime.ExceptionServices; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index a4f384aa6e5..b59d23f154b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -7,8 +7,8 @@ using System.Reflection; using System.Text; using System.Windows.Forms.VisualStyles; -using Microsoft.Win32; using Microsoft.Office; +using Microsoft.Win32; using Directory = System.IO.Directory; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2IManagedPerPropertyBrowsingHandler.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2IManagedPerPropertyBrowsingHandler.cs index e6608723d9d..5e8dff5945d 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2IManagedPerPropertyBrowsingHandler.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2IManagedPerPropertyBrowsingHandler.cs @@ -3,8 +3,8 @@ using System.Reflection; using System.Runtime.InteropServices; -using Windows.Win32.System.Variant; using Microsoft.VisualStudio.Shell; +using Windows.Win32.System.Variant; namespace System.Windows.Forms.ComponentModel.Com2Interop; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2TypeInfoProcessor.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2TypeInfoProcessor.cs index 9b9881c2679..233afacdb40 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2TypeInfoProcessor.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComponentModel/COM2Interop/COM2TypeInfoProcessor.cs @@ -10,8 +10,8 @@ using Windows.Win32.System.Ole; using Windows.Win32.System.Variant; using static Windows.Win32.System.Com.TYPEKIND; -using static Windows.Win32.System.Variant.VARENUM; using static Windows.Win32.System.Com.VARFLAGS; +using static Windows.Win32.System.Variant.VARENUM; namespace System.Windows.Forms.ComponentModel.Com2Interop; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.ComboBoxUiaTextProvider.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.ComboBoxUiaTextProvider.cs index e2adc6f5397..aff7f0dcc86 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.ComboBoxUiaTextProvider.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.ComboBoxUiaTextProvider.cs @@ -344,7 +344,7 @@ public override HRESULT RangeFromPoint(UiaPoint point, ITextRangeProvider** pRet // (Essentially ScreenToClient but MapWindowPoints accounts for window mirroring using WS_EX_LAYOUTRTL.) if (PInvoke.MapWindowPoints((HWND)default, _owningChildEdit, ref clientLocation) == 0) { - *pRetVal = ComHelpers.GetComPointer( + *pRetVal = ComHelpers.GetComPointer( new UiaTextRange( _owningComboBox.ChildEditAccessibleObject, this, diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.Methods.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.Methods.cs index 059660b7bbf..cce1b6d07d0 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.Methods.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.Methods.cs @@ -29732,7 +29732,7 @@ private void UpdateSelectedCellsBlock( if (Columns.DisplayInOrder(oldEdgeColumnIndex, newEdgeColumnIndex) && (Columns.DisplayInOrder(anchorColumnIndex, oldEdgeColumnIndex) || anchorColumnIndex == oldEdgeColumnIndex) - && oldEdgeRowIndex == newEdgeRowIndex) + && oldEdgeRowIndex == newEdgeRowIndex) { // h1 DataGridViewColumn? dataGridViewColumn = Columns.GetNextColumn(Columns[oldEdgeColumnIndex], DataGridViewElementStates.Visible, DataGridViewElementStates.None); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/CheckedListBox.CheckedListBoxItemAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/CheckedListBox.CheckedListBoxItemAccessibleObject.cs index 8981f6e5856..a8b2de0c4b3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/CheckedListBox.CheckedListBoxItemAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListBoxes/CheckedListBox.CheckedListBoxItemAccessibleObject.cs @@ -113,7 +113,7 @@ internal override ToggleState ToggleState { get { - ToggleState toggleState= ToggleState.ToggleState_Off; + ToggleState toggleState = ToggleState.ToggleState_Off; switch (_owningCheckedListBox.GetItemCheckState(CurrentIndex)) { case CheckState.Checked: diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs index 34205e64edf..6af6c9273e5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.ListViewItemCollection.cs @@ -164,7 +164,7 @@ int IList.Add(object? item) return IndexOf(Add(listViewItem)); } - if (item is {} obj) + if (item is { } obj) { return IndexOf(Add(obj.ToString())); } @@ -425,7 +425,7 @@ void IList.Insert(int index, object? item) { Insert(index, listViewItem); } - else if (item is {} obj) + else if (item is { } obj) { Insert(index, obj.ToString()); } @@ -438,15 +438,15 @@ public ListViewItem Insert(int index, string? text, string? imageKey) public virtual ListViewItem Insert(int index, string? key, string? text, string? imageKey) => Insert(index, new ListViewItem(text, imageKey) - { - Name = key - }); + { + Name = key + }); public virtual ListViewItem Insert(int index, string? key, string? text, int imageIndex) => Insert(index, new ListViewItem(text, imageIndex) - { - Name = key - }); + { + Name = key + }); // END - NEW INSERT OVERLOADS IN WHIDBEY --> diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemBaseAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemBaseAccessibleObject.cs index b1d9966b7ae..cf21ee17395 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemBaseAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemBaseAccessibleObject.cs @@ -174,10 +174,14 @@ internal override VARIANT GetPropertyValue(UIA_PROPERTY_ID propertyID) { switch (propertyID) { - case UIA_PROPERTY_ID.UIA_ControlTypePropertyId: return (VARIANT)(int)UIA_CONTROLTYPE_ID.UIA_ListItemControlTypeId; - case UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId: return (VARIANT)OwningListItemFocused; - case UIA_PROPERTY_ID.UIA_IsEnabledPropertyId: return (VARIANT)_owningListView.Enabled; - case UIA_PROPERTY_ID.UIA_IsKeyboardFocusablePropertyId: return (VARIANT)State.HasFlag(AccessibleStates.Focusable); + case UIA_PROPERTY_ID.UIA_ControlTypePropertyId: + return (VARIANT)(int)UIA_CONTROLTYPE_ID.UIA_ListItemControlTypeId; + case UIA_PROPERTY_ID.UIA_HasKeyboardFocusPropertyId: + return (VARIANT)OwningListItemFocused; + case UIA_PROPERTY_ID.UIA_IsEnabledPropertyId: + return (VARIANT)_owningListView.Enabled; + case UIA_PROPERTY_ID.UIA_IsKeyboardFocusablePropertyId: + return (VARIANT)State.HasFlag(AccessibleStates.Focusable); case UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId: if (OwningGroup?.CollapsedState == ListViewGroupCollapsedState.Collapsed) { @@ -188,7 +192,8 @@ internal override VARIANT GetPropertyValue(UIA_PROPERTY_ID propertyID) return result.IsEmpty ? VARIANT.False : result; case UIA_PROPERTY_ID.UIA_NativeWindowHandlePropertyId: return UIAHelper.WindowHandleToVariant(HWND.Null); - default: return base.GetPropertyValue(propertyID); + default: + return base.GetPropertyValue(propertyID); } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.MonthCalendarAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.MonthCalendarAccessibleObject.cs index c5e5c9c0128..6b4e839b324 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.MonthCalendarAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/MonthCalendar/MonthCalendar.MonthCalendarAccessibleObject.cs @@ -619,7 +619,7 @@ and not MONTH_CALDENDAR_MESSAGES_VIEW.MCMV_DECADE internal void UpdateDisplayRange() { - if(!this.TryGetOwnerAs(out MonthCalendar? owner)) + if (!this.TryGetOwnerAs(out MonthCalendar? owner)) { return; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs index 949c0df2bbd..19de619a6ff 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs @@ -3558,7 +3558,7 @@ internal void RemoveTabs(PropertyTabScope classification, bool setupToolbar) SelectViewTabButtonDefault(selectedButton); // Clear the component refs of the tabs. - foreach (TabInfo info in _tabs) + foreach (TabInfo info in _tabs) { info.Tab.Components = Array.Empty(); } @@ -3638,7 +3638,7 @@ internal void RemoveTab(Type tabType) private void ResetHelpBackColor() => _helpPane.ResetBackColor(); - private void ResetHelpForeColor() => _helpPane.ResetBackColor(); + private void ResetHelpForeColor() => _helpPane.ResetBackColor(); /// /// This method is intended for use in replacing a specific selected root object with another object of the diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs index 2dd3889b631..703e725487f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs @@ -5202,7 +5202,10 @@ private void TabSelection() _dropDownHolder.FocusComponent(); return; } - else _currentEditor?.Focus(); + else + { + _currentEditor?.Focus(); + } return; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripHighContrastRenderer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripHighContrastRenderer.cs index d95dfb14510..5cd05b20d68 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripHighContrastRenderer.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripHighContrastRenderer.cs @@ -489,7 +489,7 @@ private void RenderItemImageOfLowColorDepth(ToolStripItemImageRenderEventArgs e) using ImageAttributes attrs = new(); - if (IsHighContrastWhiteOnBlack() && !(FillWhenSelected && (item.Pressed || item. Selected))) + if (IsHighContrastWhiteOnBlack() && !(FillWhenSelected && (item.Pressed || item.Selected))) { // Translate white, black and blue to colors visible in high contrast mode. ColorMap cm1 = new(); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripItem.cs index 7faf28825c3..97300080feb 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripItem.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripItem.cs @@ -7,8 +7,8 @@ using System.Drawing.Design; using System.Drawing.Imaging; using System.Windows.Forms.Layout; -using Com = Windows.Win32.System.Com; using Windows.Win32.System.Ole; +using Com = Windows.Win32.System.Com; using IComDataObject = System.Runtime.InteropServices.ComTypes.IDataObject; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObject.cs index 746bc6ad87b..dcd6c81ce6f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObject.cs @@ -28,9 +28,9 @@ NavigateDirection.NavigateDirection_FirstChild or NavigateDirection.NavigateDire => _owningToolStripOverflowButton.DropDown.Visible ? _owningToolStripOverflowButton.DropDown.AccessibilityObject : null, - // Don't show the inner menu while it is invisible. - // Otherwise it will affect accessibility tree, - // especially for items-controls that have not been created yet. + // Don't show the inner menu while it is invisible. + // Otherwise it will affect accessibility tree, + // especially for items-controls that have not been created yet. _ => base.FragmentNavigate(direction), }; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripPanelRow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripPanelRow.cs index 1b1d55abb9a..5882ce67275 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripPanelRow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripPanelRow.cs @@ -724,7 +724,7 @@ void IArrangedElement.PerformLayout(IArrangedElement container, string? property } } -#region MouseStuff + #region MouseStuff #if DEBUG internal static readonly TraceSwitch ToolStripPanelMouseDebug = new("ToolStripPanelMouse", "Debug ToolStrip WM_MOUSEACTIVATE code"); @@ -762,5 +762,5 @@ internal void LeaveRow(ToolStrip toolStripToDrag) } } -#endregion + #endregion } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/HtmlElementCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/HtmlElementCollection.cs index e379e28bafc..4895c7326e9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/HtmlElementCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/HtmlElementCollection.cs @@ -75,7 +75,7 @@ public HtmlElement? this[string elementId] using var nativeHtmlElementCollection = NativeHtmlElementCollection.GetInterface(); using var variantElementId = (VARIANT)elementId; using ComScope dispatch = new(null); - nativeHtmlElementCollection.Value->item(variantElementId, (VARIANT)0, dispatch).ThrowOnFailure();; + nativeHtmlElementCollection.Value->item(variantElementId, (VARIANT)0, dispatch).ThrowOnFailure(); IHTMLElement* htmlElement; return !dispatch.IsNull && dispatch.Value->QueryInterface(IID.Get(), (void**)&htmlElement).Succeeded ? new(_shimManager, htmlElement) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowser.WebBrowserSite.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowser.WebBrowserSite.cs index 141a4b38370..1e2820be914 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowser.WebBrowserSite.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowser.WebBrowserSite.cs @@ -3,10 +3,10 @@ using System.Drawing; using Windows.Win32.System.Ole; -using MsHtml = Windows.Win32.Web.MsHtml; using static Interop.Mshtml; -using Ole = Windows.Win32.System.Ole; using ComTypes = System.Runtime.InteropServices.ComTypes; +using MsHtml = Windows.Win32.Web.MsHtml; +using Ole = Windows.Win32.System.Ole; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowserSiteBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowserSiteBase.cs index 8a68e12caaa..4b12ea49581 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowserSiteBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/WebBrowser/WebBrowserSiteBase.cs @@ -4,8 +4,8 @@ using System.ComponentModel.Design; using System.Drawing; using System.Runtime.InteropServices; -using Windows.Win32.System.Ole; using Windows.Win32.System.Com; +using Windows.Win32.System.Ole; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/BindingManagerBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/BindingManagerBase.cs index cfb45f50f50..2bb8fae9c1d 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/BindingManagerBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/BindingManagerBase.cs @@ -91,7 +91,11 @@ internal BindingManagerBase(object? dataSource) return GetItemProperties(BindType, 0, dataSources, listAccessors); } - protected virtual PropertyDescriptorCollection? GetItemProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]Type listType, int offset, ArrayList dataSources, ArrayList listAccessors) + protected virtual PropertyDescriptorCollection? GetItemProperties( + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type listType, + int offset, + ArrayList dataSources, + ArrayList listAccessors) { if (listAccessors.Count < offset) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs index d58823d8be2..fb9b99bebfe 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialog.cs @@ -4,8 +4,8 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TASKDIALOGCONFIG_MainIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous1_e__Union; using TASKDIALOGCONFIG_FooterIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous2_e__Union; +using TASKDIALOGCONFIG_MainIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous1_e__Union; namespace System.Windows.Forms; /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogPage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogPage.cs index a189eb3aff6..285a2afc0fd 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogPage.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogPage.cs @@ -1,7 +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 TASKDIALOGCONFIG_MainIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous1_e__Union; using TASKDIALOGCONFIG_FooterIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous2_e__Union; +using TASKDIALOGCONFIG_MainIcon = Windows.Win32.UI.Controls.TASKDIALOGCONFIG._Anonymous1_e__Union; namespace System.Windows.Forms; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.LayoutInfo.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.LayoutInfo.cs index 370c5e8f1d2..2708c0b7a99 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.LayoutInfo.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.LayoutInfo.cs @@ -43,7 +43,7 @@ public LayoutInfo(IArrangedElement element) public int RowSpan { get; set; } = 1; - #if DEBUG +#if DEBUG public LayoutInfo Clone() => new(Element) { RowStart = RowStart, @@ -77,6 +77,6 @@ public override int GetHashCode() hash.Add(ColumnPosition); return hash.ToHashCode(); } - #endif +#endif } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MdiWindowListStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MdiWindowListStrip.cs index b2983dbef51..2a8024fbf6f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MdiWindowListStrip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/MDI/MdiWindowListStrip.cs @@ -31,9 +31,9 @@ internal ToolStripMenuItem MergeItem get { _mergeItem ??= new ToolStripMenuItem - { - MergeAction = MergeAction.MatchOnly - }; + { + MergeAction = MergeAction.MatchOnly + }; if (_mergeItem.Owner is null) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs index 33351de597d..f73ed94856e 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.BitmapBinder.cs @@ -27,7 +27,7 @@ private sealed class BitmapBinder : SerializationBinder private const string AllowedAssemblyName = "System.Drawing"; // .NET Framework PublicKeyToken=b03f5f7f11d50a3a - private static ReadOnlySpan AllowedToken => [ 0xB0, 0x3F, 0x5F, 0x7F, 0x11, 0xD5, 0x0A, 0x3A ]; + private static ReadOnlySpan AllowedToken => [0xB0, 0x3F, 0x5F, 0x7F, 0x11, 0xD5, 0x0A, 0x3A]; public override Type? BindToType(string assemblyName, string typeName) {