diff --git a/src/System.Drawing.Common/src/Windows/Win32/PInvoke.SHGetStockIconInfo.cs b/src/System.Drawing.Common/src/Windows/Win32/PInvoke.SHGetStockIconInfo.cs index 8d7fad5a109..7b1faadc333 100644 --- a/src/System.Drawing.Common/src/Windows/Win32/PInvoke.SHGetStockIconInfo.cs +++ b/src/System.Drawing.Common/src/Windows/Win32/PInvoke.SHGetStockIconInfo.cs @@ -20,7 +20,7 @@ internal partial class PInvoke /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -30,7 +30,7 @@ internal partial class PInvoke /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -44,7 +44,7 @@ internal partial class PInvoke /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/DEVNAMES.cs b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/DEVNAMES.cs index ee356976158..410fc9526df 100644 --- a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/DEVNAMES.cs +++ b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/DEVNAMES.cs @@ -9,7 +9,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Learn more about this API from learn.Microsoft.com. +/// Learn more about this API from learn.microsoft.com. /// /// /// @@ -33,7 +33,7 @@ internal partial struct DEVNAMES /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -46,7 +46,7 @@ internal partial struct DEVNAMES /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -59,7 +59,7 @@ internal partial struct DEVNAMES /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -78,7 +78,7 @@ internal partial struct DEVNAMES /// /// /// - /// Read more on learn.Microsoft.com + /// Read more on learn.microsoft.com /// /// /// diff --git a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGEXW.cs b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGEXW.cs index 90f361172c6..650524c7d75 100644 --- a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGEXW.cs +++ b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGEXW.cs @@ -12,7 +12,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Read more on learn.Microsoft.com. +/// Read more on learn.microsoft.com. /// /// /// @@ -32,7 +32,7 @@ internal partial struct PRINTDLGEXW /// Type: DWORD The structure size, in bytes. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -45,7 +45,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -70,7 +70,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -96,7 +96,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -110,7 +110,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -132,7 +132,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -148,7 +148,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -163,7 +163,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -181,7 +181,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -194,7 +194,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -207,7 +207,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -230,7 +230,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -247,7 +247,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -263,7 +263,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -288,7 +288,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -298,7 +298,7 @@ internal partial struct PRINTDLGEXW /// Type: DWORD The number of property page handles in the lphPropertyPages array. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -316,7 +316,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -331,7 +331,7 @@ internal partial struct PRINTDLGEXW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTPAGERANGE.cs b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTPAGERANGE.cs index e898b1ee961..749c3f0c884 100644 --- a/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTPAGERANGE.cs +++ b/src/System.Private.Windows.Core/src/Windows/Win32/UI/Controls/Dialogs/PRINTPAGERANGE.cs @@ -10,7 +10,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Learn more about this API from learn.Microsoft.com. +/// Learn more about this API from learn.microsoft.com. /// /// /// @@ -30,7 +30,7 @@ internal partial struct PRINTPAGERANGE /// Type: DWORD The first page of the range. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -40,7 +40,7 @@ internal partial struct PRINTPAGERANGE /// Type: DWORD The last page of the range. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Windows.Forms.Design/src/Resources/MaskDesignerDialog.Designer.cs b/src/System.Windows.Forms.Design/src/Resources/MaskDesignerDialog.Designer.cs index 2d7c32945a5..7ae8866ac81 100644 --- a/src/System.Windows.Forms.Design/src/Resources/MaskDesignerDialog.Designer.cs +++ b/src/System.Windows.Forms.Design/src/Resources/MaskDesignerDialog.Designer.cs @@ -298,7 +298,8 @@ internal static int lblHeader_TabIndex { } /// - /// Looks up a localized string similar to &Select a predefined mask description from the list below or select Custom to define a custom mask.. + /// Looks up a localized string similar to &Select a predefined mask description from the list below or + /// select Custom to define a custom mask.. /// internal static string lblHeader_Text { get { @@ -582,7 +583,16 @@ internal static int maskTryItTable_ColumnCount { } /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="checkBoxUseValidatingType" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lblMask" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="txtBoxMask" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lblTryIt" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maskedTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Aut [rest of string was truncated]";. + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?>< + /// TableLayoutSettings><Controls><Control Name="checkBoxUseValidatingType" Row=" + /// 0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name=" + /// lblMask" Row="0" RowSpan="1" Column="0" ColumnSpan="1" />< + /// Control Name="txtBoxMask" Row="0" RowSpan="1" Column=" + /// 1" ColumnSpan="1" /><Control Name="lblTryIt" Row=" + /// 1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name=" + /// maskedTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan=" + /// 1" /></Controls><Columns Styles=" + /// AutoSize,0,Percent,100,Aut [rest of string was truncated]";. /// internal static string maskTryItTable_LayoutSettings { get { @@ -661,7 +671,12 @@ internal static int okCancelTableLayoutPanel_ColumnCount { } /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="btnCancel" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="btnOK" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50" /><Rows Styles="AutoSize,0" /></TableLayoutSettings>. + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?>< + /// TableLayoutSettings><Controls><Control Name="btnCancel" Row=" + /// 0" RowSpan="1" Column="1" ColumnSpan="1" />< + /// Control Name="btnOK" Row="0" RowSpan="1" Column=" + /// 0" ColumnSpan="1" /></Controls><Columns Styles=" + /// Percent,50,Percent,50" /><Rows Styles="AutoSize,0" /></TableLayoutSettings>. /// internal static string okCancelTableLayoutPanel_LayoutSettings { get { @@ -730,7 +745,15 @@ internal static int overarchingTableLayoutPanel_ColumnCount { } /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="maskTryItTable" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="okCancelTableLayoutPanel" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lblHeader" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="listViewCannedMasks" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,50" /><Rows Styles="AutoSize,0,AutoSize,0,Percent,50,AutoSize,0,AutoSize,0" /></ [rest of string was truncated]";. + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?>< + /// TableLayoutSettings><Controls><Control Name="maskTryItTable" Row="3" + /// RowSpan="1" Column="0" ColumnSpan="1" /><Control Name=" + /// okCancelTableLayoutPanel" Row="4" RowSpan="1" Column="0" ColumnSpan=" + /// 1" /><Control Name="lblHeader" Row="1" RowSpan="1" Column=" + /// 0" ColumnSpan="1" /><Control Name="listViewCannedMasks" Row="2" + /// RowSpan="1" Column="0" ColumnSpan="1" /></Controls>< + /// Columns Styles="Percent,50" /><Rows Styles=" + /// AutoSize,0,AutoSize,0,Percent,50,AutoSize,0,AutoSize,0" /></ [rest of string was truncated]";. /// internal static string overarchingTableLayoutPanel_LayoutSettings { get { diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs index 2eec684ceef..54610cac56e 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionListsChangedEventHandler.cs @@ -4,6 +4,7 @@ namespace System.ComponentModel.Design; /// -/// This event is raised by the when a shortcut is either added or removed to/from the related object. +/// This event is raised by the when a shortcut is either added or removed +/// to/from the related object. /// public delegate void DesignerActionListsChangedEventHandler(object sender, DesignerActionListsChangedEventArgs e); diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionUIStateChangeEventArgs.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionUIStateChangeEventArgs.cs index 037d248b3db..f910e5886bd 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionUIStateChangeEventArgs.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerActionUIStateChangeEventArgs.cs @@ -4,12 +4,14 @@ namespace System.ComponentModel.Design; /// -/// This EventArgs class is used by the DesignerActionService to signify that there has been a change in DesignerActionLists (added or removed) on the related object. +/// This EventArgs class is used by the DesignerActionService to signify that there has been a change in +/// DesignerActionLists (added or removed) on the related object. /// public class DesignerActionUIStateChangeEventArgs : EventArgs { /// - /// Constructor that requires the object in question, the type of change and the remaining actionlists left for the object on the related object. + /// Constructor that requires the object in question, + /// the type of change and the remaining ActionLists left for the object on the related object. /// public DesignerActionUIStateChangeEventArgs(object? relatedObject, DesignerActionUIStateChangeType changeType) { diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerHost.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerHost.cs index 79c6fbda93f..c0910f6bf07 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerHost.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/DesignerHost.cs @@ -17,8 +17,10 @@ namespace System.ComponentModel.Design; internal sealed partial class DesignerHost : Container, IDesignerLoaderHost2, IDesignerHostTransactionState, IComponentChangeService, IReflect { // State flags for the state of the designer host - private static readonly int s_stateLoading = BitVector32.CreateMask(); // Designer is currently loading from the loader host. - private static readonly int s_stateUnloading = BitVector32.CreateMask(s_stateLoading); // Designer is currently unloading. + // Designer is currently loading from the loader host. + private static readonly int s_stateLoading = BitVector32.CreateMask(); + // Designer is currently unloading. + private static readonly int s_stateUnloading = BitVector32.CreateMask(s_stateLoading); // A transaction is in the process of being Canceled or Committed. private static readonly int s_stateIsClosingTransaction = BitVector32.CreateMask(s_stateUnloading); @@ -38,7 +40,8 @@ internal sealed partial class DesignerHost : Container, IDesignerLoaderHost2, ID private static readonly object s_eventComponentAdded = new(); // A component was just added to the container private static readonly object s_eventComponentChanging = new(); // A component is about to be changed private static readonly object s_eventComponentChanged = new(); // A component has changed - private static readonly object s_eventComponentRemoving = new(); // A component is about to be removed from the container + // A component is about to be removed from the container + private static readonly object s_eventComponentRemoving = new(); private static readonly object s_eventComponentRemoved = new(); // A component has been removed from the container private static readonly object s_eventComponentRename = new(); // A component has been renamed @@ -237,8 +240,8 @@ internal void AddToContainerPostProcess(IComponent component, IContainer contain IDesigner? designer; // Is this the first component the loader has created? If so, then it must be the root component (by definition) - // so we will expect there to be a root designer associated with the component. Otherwise, we search for a normal - // designer, which can be optionally provided. + // so we will expect there to be a root designer associated with the component. + // Otherwise, we search for a normal designer, which can be optionally provided. if (_rootComponent is null) { designer = _surface!.CreateDesigner(component, true) as IRootDesigner; @@ -355,7 +358,8 @@ internal void BeginLoad(DesignerLoader loader) if (_designerEventService is null) { - // If there is no designer event service, make this designer the currently active designer. It will remain active. + // If there is no designer event service, make this designer the currently active designer. + // It will remain active. OnActiveDesignerChanged(sender: null, new ActiveDesignerEventArgs(oldDesigner: null, this)); } } @@ -931,7 +935,7 @@ IComponent IDesignerHost.CreateComponent(Type componentType, string name) IComponent? component; LicenseContext oldContext = LicenseManager.CurrentContext; - // We don't want if there is a recursivity (creating a component create another one) to change the context again. + // We don't want if there is a recursively (creating a component create another one) to change the context again. // We already have the one we want and that would create a locking problem. bool changingContext = false; if (oldContext != LicenseContext) @@ -1197,7 +1201,7 @@ bool IDesignerLoaderHost2.IgnoreErrorsDuringReload bool IDesignerLoaderHost2.CanReloadWithErrors { get; set; } - // We implement IReflect to keep our reflection surface contstrained to IDesignerHost. + // We implement IReflect to keep our reflection surface constrained to IDesignerHost. [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] MethodInfo? IReflect.GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/SelectionService.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/SelectionService.cs index 0b1c869d9af..f924f1cc1ea 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/SelectionService.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/SelectionService.cs @@ -189,7 +189,7 @@ private void UpdateHelpKeyword(bool tryLater) { // We don't have a HelpService yet, hook up to the ApplicationIdle event. // VS is always returning a UserContext, so instantiating the HelpService - // beforehand and doing class pushcontext on it to try to + // beforehand and doing class PushContext on it to try to // stack up help context in the HelpService to be flushed when we get the // documentation event may not work, so we need to wait for a HelpService instead. Application.Idle += ApplicationIdle; diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs index 0067158163d..ce2fa3ec595 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs @@ -60,7 +60,9 @@ private static void PopulateCompleteStatements(object? data, string name, CodeSt } /// - /// Deserializes the given object state. The results are contained within the serialization manager's name table. The objectNames list is used to deserialize in the proper order, as objectState is unordered. + /// Deserializes the given object state. The results are contained within the serialization manager's + /// name table. The objectNames list is used to deserialize in the proper order, + /// as objectState is unordered. /// internal void Deserialize(IDesignerSerializationManager manager, Dictionary objectState, List objectNames, bool applyDefaults) { @@ -133,7 +135,7 @@ private void OnResolveName(object? sender, ResolveNameEventArgs e) private void DeserializeDefaultProperties(IDesignerSerializationManager manager, string name, List? defProps) { - // Next, default properties, but only if we successfully resolved. + // Next, default properties, but only if we successfully resolved. if (defProps is null || !_applyDefaults) { return; @@ -185,7 +187,11 @@ private static void DeserializeDesignTimeProperties(IDesignerSerializationManage } /// - /// This is used to resolve nested component references. NestedComponents don't exist as sited components within the DesignerHost, they are actually sited within a parent component. This method takes the FullName defined on INestedSite and returns the component which matches it. outerComponent is the name of the topmost component which does exist in the DesignerHost + /// This is used to resolve nested component references. + /// NestedComponents don't exist as sited components within the DesignerHost, + /// they are actually sited within a parent component. + /// This method takes the FullName defined on INestedSite and returns the component which matches it. + /// outerComponent is the name of the topmost component which does exist in the DesignerHost /// This code also exists in VSCodeDomDesignerLoader -- please keep them in sync. /// private static IComponent? ResolveNestedName(IDesignerSerializationManager? manager, string name, [NotNullIfNotNull(nameof(manager))] out string? outerComponent) @@ -350,7 +356,7 @@ private bool ResolveName(IDesignerSerializationManager manager, string name, boo } } - // Sometimes components won't be in either the statements table or the expressions table, for example, this occurs for resources during undo/redo. In these cases the component should be resolvable by the manager. Never do this when we have been asked by the serialization manager to resolve the name; otherwise we may infinitely recurse. + // Sometimes components won't be in either the statements table or the expressions table, for example, this occurs for resources during undo/redo. In these cases the component should be resolvable by the manager. Never do this when we have been asked by the serialization manager to resolve the name; otherwise we may infinitely recurse. if (!resolved && canInvokeManager) { resolved = manager.GetInstance(name) is not null; diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CollectionCodeDomSerializer.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CollectionCodeDomSerializer.cs index 04ab7834126..b45b7fdeaf6 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CollectionCodeDomSerializer.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CollectionCodeDomSerializer.cs @@ -134,12 +134,12 @@ protected bool MethodSupportsSerialization(MethodInfo method) object? result = null; // We serialize collections as follows: - // If the collection is an array, we write out the array. - // If the collection has a method called AddRange, we will call that, providing an array. - // If the collection has an Add method, we will call it repeatedly. - // If the collection is an IList, we will cast to IList and add to it. - // If the collection has no add method, but is marked with PersistContents, - // we will enumerate the collection and serialize each element. + // If the collection is an array, we write out the array. + // If the collection has a method called AddRange, we will call that, providing an array. + // If the collection has an Add method, we will call it repeatedly. + // If the collection is an IList, we will cast to IList and add to it. + // If the collection has no add method, but is marked with PersistContents, + // we will enumerate the collection and serialize each element. // Check to see if there is a CodePropertyReferenceExpression on the stack. // If there is, we can use it as a guide for serialization. CodeExpression? target; diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/DesignerSerializationManager.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/DesignerSerializationManager.cs index c4a0da78b12..0ebd781fc1a 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/DesignerSerializationManager.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/DesignerSerializationManager.cs @@ -775,9 +775,9 @@ object IDesignerSerializationManager.CreateInstance(Type type, ICollection? argu // When RecycleInstances is true if there was a collision the object would have been returned, // so there is no need to store locally. if (name is not null // If we were given a name - && (!(instance is IComponent) // And it's not an icomponent + && (!(instance is IComponent) // And it's not an IComponent || !RecycleInstances)) - { // Or it is an icomponent but recycle instances is turned off + { // Or it is an IComponent but recycle instances is turned off _instancesByName ??= new(StringComparer.CurrentCulture); _namesByInstance ??= new(new ReferenceComparer()); _instancesByName[name] = instance; diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.SerializationResourceManager.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.SerializationResourceManager.cs index da809b6fccc..539ce6c6196 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.SerializationResourceManager.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/ResourceCodeDomSerializer.SerializationResourceManager.cs @@ -446,7 +446,7 @@ private CompareValue CompareWithParentValue(CultureInfo culture, string name, ob /// /// Event handler that gets called when serialization or deserialization is complete. - /// Here we need to write any resources to disk. Sine we open resources for write on demand, + /// Here we need to write any resources to disk. Since we open resources for write on demand, /// this code handles the case of reading resources as well. /// private void OnSerializationComplete(object? sender, EventArgs e) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/SerializeAbsoluteContext.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/SerializeAbsoluteContext.cs index 231f4e91529..4ac829218f7 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/SerializeAbsoluteContext.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/SerializeAbsoluteContext.cs @@ -35,7 +35,8 @@ public SerializeAbsoluteContext(MemberDescriptor? member) } /// - /// This property returns the member this context is bound to. It may be null to indicate the context is bound to all members of an object. + /// This property returns the member this context is bound to. + /// It may be null to indicate the context is bound to all members of an object. /// public MemberDescriptor? Member { get; } diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/UndoEngine.UndoUnit.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/UndoEngine.UndoUnit.cs index edd89ee36fd..165b0040f3e 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/UndoEngine.UndoUnit.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/UndoEngine.UndoUnit.cs @@ -9,7 +9,9 @@ namespace System.ComponentModel.Design; public abstract partial class UndoEngine { /// - /// This class embodies a unit of undoable work. The undo engine creates an undo unit when a change to the designer is about to be made. The undo unit is responsible for tracking changes. The undo engine will call Close on the unit when it no longer needs to track changes. + /// This class embodies a unit of undoable work. The undo engine creates an undo unit when a change to + /// the designer is about to be made. The undo unit is responsible for tracking changes. The undo engine will + /// call Close on the unit when it no longer needs to track changes. /// protected partial class UndoUnit { @@ -166,7 +168,7 @@ public virtual void ComponentChanged(ComponentChangedEventArgs e) { for (int i = 0; i < _events.Count; i++) { - // Determine if we've located the UndoEvent which was created as a result of a corresponding ComponentChanging event. + // Determine if we've located the UndoEvent which was created as a result of a corresponding ComponentChanging event. // If so, reposition to the "Changed" spot in the list if the following is true: // - It must be for a DSV.Content property // - There must be a AddEvent between the Changing and Changed @@ -283,8 +285,8 @@ public virtual void ComponentRemoved(ComponentEventArgs e) if (_events[idx] is AddRemoveUndoEvent evt && evt.OpenComponent == e.Component) { evt.Commit(); - // We should only reorder events if there are change events coming between OnRemoving and OnRemoved. - // If there are other events (such as AddRemoving), the serialization done in OnComponentRemoving might refer to components that aren't available. + // We should only reorder events if there are change events coming between OnRemoving and OnRemoved. + // If there are other events (such as AddRemoving), the serialization done in OnComponentRemoving might refer to components that aren't available. if (idx != _events.Count - 1 && changeEvt is not null) { // ensure only change change events exist between these two events @@ -350,7 +352,9 @@ public virtual void ComponentRename(ComponentRenameEventArgs e) => public override string ToString() => Name; /// - /// Either performs undo, or redo, depending on the state of the unit. UndoUnit initially assumes that the undoable work has already been "done", so the first call to undo will undo the work. The next call will undo the "undo", performing a redo. + /// Either performs undo, or redo, depending on the state of the unit. + /// UndoUnit initially assumes that the undoable work has already been "done", + /// so the first call to undo will undo the work. The next call will undo the "undo", performing a redo. /// public void Undo() { @@ -387,7 +391,10 @@ public void Undo() } /// - /// The undo method invokes this method to perform the actual undo / redo work. You should never call this method directly; override it if you wish, but always call the public Undo method to perform undo work. Undo notifies the undo engine to suspend undo data gathering until this undo is completed, which prevents new undo units from being created in response to this unit doing work. + /// The undo method invokes this method to perform the actual undo / redo work. + /// You should never call this method directly; override it if you wish, but always call the public Undo method + /// to perform undo work. Undo notifies the undo engine to suspend undo data gathering until this + /// undo is completed, which prevents new undo units from being created in response to this unit doing work. /// protected virtual void UndoCore() { @@ -396,9 +403,9 @@ protected virtual void UndoCore() if (_reverse) { // How does BeforeUndo work? You'd think you should just call this in one pass, and then call Undo in another, but you'd be wrong. The complexity arises because there are undo events that have dependencies on other undo events.There are also undo events that have side effects with respect to other events. Here are examples: - // Rename is an undo event that other undo events depend on, because they store names. It must be performed in the right order and it must be performed before any subsequent event's BeforeUndo is called. + // Rename is an undo event that other undo events depend on, because they store names. It must be performed in the right order and it must be performed before any subsequent event's BeforeUndo is called. // Property change is an undo event that may have an unknown side effect if changing the property results in other property changes (for example, reparenting a control removes the control from its former parent) .A property change undo event must have all BeforeUndo methods called before any Undo method is called. To do this, we have a property on UndoEvent called CausesSideEffects. - // As we run through UndoEvents, consecutive events that return true from this property are grouped so that their BeforeUndo methods are all called before their Undo methods. For events that do not have side effects, their BeforeUndo and Undo are invoked immediately. + // As we run through UndoEvents, consecutive events that return true from this property are grouped so that their BeforeUndo methods are all called before their Undo methods. For events that do not have side effects, their BeforeUndo and Undo are invoked immediately. for (int idx = _events.Count - 1; idx >= 0; idx--) { int groupEndIdx = idx; diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/ContainerSelectorBehavior.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/ContainerSelectorBehavior.cs index 0dfa8a2f897..51136d7a51d 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/ContainerSelectorBehavior.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/ContainerSelectorBehavior.cs @@ -111,13 +111,13 @@ public override bool OnMouseDown(Glyph g, MouseButtons button, Point mouseLoc) continue; } - // Don't care if we are looking at the same containerselectorglyph + // Don't care if we are looking at the same ContainerSelectorGlyph if (selNew.Equals(selOld)) { continue; } - // Check if the containercontrols are the same + // Check if the containerControls are the same if (!(selNew.RelatedBehavior is ContainerSelectorBehavior behNew) || !(selOld.RelatedBehavior is ContainerSelectorBehavior behOld)) { continue; @@ -238,7 +238,7 @@ private void StartDragOperation(Point initialMouseLocation) Point controlOrigin; if (_setInitialDragPoint) { - // In this case we want the initialmouselocation to be the control's origin. + // In this case we want the initialMouseLocation to be the control's origin. controlOrigin = _behaviorService.ControlToAdornerWindow(_containerControl); controlOrigin = _behaviorService.AdornerWindowPointToScreen(controlOrigin); } diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/DropSourceBehavior.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/DropSourceBehavior.cs index 32b1c7a6415..f41cc72c455 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/DropSourceBehavior.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/DropSourceBehavior.cs @@ -36,7 +36,7 @@ private struct DragComponent private bool _targetAllowsSnapLines; // indicates if the drop target allows snaplines (flowpanels don't for ex) private IComponent _lastDropTarget; // indicates the drop target on the last 'give feedback' event - private Point _lastSnapOffset; // the last snapoffset we used. + private Point _lastSnapOffset; // the last SnapOffset we used. // These 2 could be different (e.g. if dropping between forms) private readonly BehaviorService _behaviorServiceSource; // ptr back to the BehaviorService in the drop source private BehaviorService _behaviorServiceTarget; // ptr back to the BehaviorService in the drop target @@ -44,7 +44,7 @@ private struct DragComponent // this object will integrate SnapLines into the drag private DragAssistanceManager _dragAssistanceManager; - private Graphics _graphicsTarget; // graphics object of the adornerwindows (via BehaviorService) in drop target + private Graphics _graphicsTarget; // graphics object of the AdornerWindows (via BehaviorService) in drop target private readonly IServiceProvider _serviceProviderSource; private IServiceProvider _serviceProviderTarget; diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs index b1140c6ef13..609e6e3f358 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ISupportInSituService.cs @@ -4,7 +4,7 @@ namespace System.Windows.Forms.Design; /// -/// Provides an interface for a designer to support Insitu editing for selected components. +/// Provides an interface for a designer to support InSitu editing for selected components. /// internal interface ISupportInSituService { @@ -14,7 +14,8 @@ internal interface ISupportInSituService bool IgnoreMessages { get; } /// - /// This method allows the service to handle the first WM_CHAR message. The implementer for this service can perform any tasks that it wants when it gets this message. + /// This method allows the service to handle the first WM_CHAR message. + /// The implementer for this service can perform any tasks that it wants when it gets this message. /// e.g : ToolStripInSituService shows the Editor for each ToolStripItem in HandleKeyChar() /// void HandleKeyChar(); diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/SplitContainerDesigner.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/SplitContainerDesigner.cs index 77b9dc795ac..b403e9361eb 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/SplitContainerDesigner.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/SplitContainerDesigner.cs @@ -51,35 +51,40 @@ public override DesignerActionListCollection ActionLists } /// - /// The will not re-parent any controls that are within it's lasso at creation time. + /// The will not re-parent any controls + /// that are within it's lasso at creation time. /// protected override bool AllowControlLasso => false; protected override bool DrawGrid => !_disableDrawGrid && base.DrawGrid; /// - /// This property is used by deriving classes to determine if it returns the control being designed or some other Container while adding a component to it. - /// e.g: When SplitContainer is selected and a component is being added, the SplitContainer designer would return a SelectedPanel as the ParentControl + /// This property is used by deriving classes to determine if it returns the control being designed or + /// some other Container while adding a component to it. + /// e.g: When SplitContainer is selected and a component is being added, + /// the SplitContainer designer would return a SelectedPanel as the ParentControl /// for all the items being added rather than itself. /// protected override Control? GetParentForComponent(IComponent component) => _splitterPanel1; /// - /// Returns a list of SnapLine objects representing interesting alignment points for this control. These SnapLines are used to assist in the positioning - /// of the control on a parent's surface. + /// Returns a list of SnapLine objects representing interesting alignment points for this control. + /// These SnapLines are used to assist in the positioning of the control on a parent's surface. /// public override IList SnapLines => // We don't want padding snaplines, so call directly to the internal method. EdgeAndMarginSnapLines().Unwrap(); /// - /// Returns the number of internal control designers in the . An internal control is a control that is not in the - /// IDesignerHost.Container.Components collection. We use this to get SnapLines for the internal control designers. + /// Returns the number of internal control designers in the . + /// An internal control is a control that is not in the IDesignerHost.Container.Components collection. + /// We use this to get SnapLines for the internal control designers. /// public override int NumberOfInternalControlDesigners() => NumberOfSplitterPanels; /// - /// Returns the internal control designer with the specified index in the . InternalControlIndex is zero-based. + /// Returns the internal control designer with the specified index in the . + /// InternalControlIndex is zero-based. /// public override ControlDesigner? InternalControlDesigner(int internalControlIndex) { @@ -101,7 +106,8 @@ public override DesignerActionListCollection ActionLists } /// - /// This is the internal Property which stores the currently selected panel. If the user double clicks a controls it is placed in the SelectedPanel. + /// This is the internal Property which stores the currently selected panel. + /// If the user double clicks a controls it is placed in the SelectedPanel. /// internal SplitterPanel? Selected { @@ -183,7 +189,9 @@ protected override void Dispose(bool disposing) protected override bool GetHitTest(Point point) => !(InheritanceAttribute == InheritanceAttribute.InheritedReadOnly) && _splitContainerSelected; /// - /// Returns a 'BodyGlyph' representing the bounds of this control. The BodyGlyph is responsible for hit testing the related CtrlDes and forwarding messages directly to the designer. + /// Returns a 'BodyGlyph' representing the bounds of this control. + /// The BodyGlyph is responsible for hit testing the related CtrlDes and + /// forwarding messages directly to the designer. /// protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selectionType) { @@ -265,8 +273,8 @@ protected override void OnPaintAdornments(PaintEventArgs pe) } /// - /// Determines if the this designer can parent to the specified designer. Generally this means if the control for this designer can parent the - /// given ControlDesigner's designer. + /// Determines if the this designer can parent to the specified designer. + /// Generally this means if the control for this designer can parent the given ControlDesigner's designer. /// public override bool CanParent(Control control) => false; @@ -341,10 +349,12 @@ private void OnSplitterMoving(object? sender, SplitterCancelEventArgs e) return; } - // We are moving the splitter via the mouse or key and not as a result of resize of the container itself (through the ResizeBehavior::OnMouseMove). + // We are moving the splitter via the mouse or key and not as a result of resize of the container itself + // (through the ResizeBehavior::OnMouseMove). _disabledGlyphs = true; - // Find our BodyGlyph adorner offered by the behavior service. We don't want to disable the transparent body glyphs. + // Find our BodyGlyph adorner offered by the behavior service. We don't want to disable + // the transparent body glyphs. SelectionManager? selMgr = GetService(); Adorner? bodyGlyphAdorner = selMgr?.BodyGlyphAdorner; @@ -381,7 +391,8 @@ private void OnSplitterMoving(object? sender, SplitterCancelEventArgs e) } /// - /// Called when the current selection changes. Here we check to see if the newly selected component is one of our Panels. If it is, we make sure that the tab is the currently visible tab. + /// Called when the current selection changes. Here we check to see if the newly selected component + /// is one of our Panels. If it is, we make sure that the tab is the currently visible tab. /// private void OnSelectionChanged(object? sender, EventArgs e) { @@ -414,12 +425,14 @@ private void OnSelectionChanged(object? sender, EventArgs e) } /// - /// Given a component, this retrieves the splitter panel that it's parented to, or null if it's not parented to any splitter panel. + /// Given a component, this retrieves the splitter panel that it's parented to, + /// or null if it's not parented to any splitter panel. /// private static SplitterPanel? CheckIfPanelSelected(object comp) => comp as SplitterPanel; /// - /// Called when one of the child splitter panels receives a MouseHover message. Here, we will simply call the parenting SplitContainer.OnMouseHover so we can get a + /// Called when one of the child splitter panels receives a MouseHover message. + /// Here, we will simply call the parenting SplitContainer.OnMouseHover so we can get a /// grab handle for moving this thing around. /// internal void SplitterPanelHover() => OnMouseHover(); diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDesigner.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDesigner.cs index 0cf4a1a3f0f..b2a7275ad06 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDesigner.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDesigner.cs @@ -358,7 +358,7 @@ public ArrayList Items } /// - /// This is the new item Transaction. This is used when the Insitu editor adds new Item. + /// This is the new item Transaction. This is used when the InSitu editor adds new Item. /// public DesignerTransaction NewItemTransaction { @@ -1276,7 +1276,7 @@ protected override ControlBodyGlyph GetControlGlyph(GlyphSelectionType selection object primarySelection = SelectionService.PrimarySelection; Behavior.Behavior toolStripBehavior = new ToolStripItemBehavior(); - // Sometimes the Collection changes when the ToolStrip gets the Selection and we are in a dummy insitu + // Sometimes the Collection changes when the ToolStrip gets the Selection and we are in a dummy InSitu // edit so remove that before accessing the collection if (ToolStrip.Items.Count > 0) { @@ -2539,7 +2539,7 @@ protected override void WndProc(ref Message m) break; case PInvoke.WM_LBUTTONDOWN: case PInvoke.WM_RBUTTONDOWN: - // commit any insitu if any... + // commit any InSitu if any... Commit(); base.WndProc(ref m); break; diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDropDownDesigner.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDropDownDesigner.cs index a6cf331b0ba..61bd8454a5e 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDropDownDesigner.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripDropDownDesigner.cs @@ -196,7 +196,8 @@ private string SettingsKey // We have to add the glyphs ourselves. private void AddSelectionGlyphs(SelectionManager selectionManager, ISelectionService selectionService) { - // If one or many of our items are selected then Add Selection Glyphs ourselves since this is a ComponentDesigner which won't get called on the "GetGlyphs" + // If one or many of our items are selected then Add Selection Glyphs ourselves since this is a + // ComponentDesigner which won't get called on the "GetGlyphs" ICollection selComponents = selectionService.GetSelectedComponents(); GlyphCollection glyphs = []; foreach (object selComp in selComponents) @@ -352,7 +353,7 @@ public override void Initialize(IComponent component) ToolStripKeyboardHandlingService keyboardHandlingService = (ToolStripKeyboardHandlingService)GetService(typeof(ToolStripKeyboardHandlingService)); keyboardHandlingService ??= new ToolStripKeyboardHandlingService(component.Site); - // Add the InsituEditService so that the ToolStrip can do its own Insitu Editing + // Add the InsituEditService so that the ToolStrip can do its own InSitu Editing ISupportInSituService inSituService = (ISupportInSituService)GetService(typeof(ISupportInSituService)); inSituService ??= new ToolStripInSituService(Component.Site); @@ -547,7 +548,9 @@ private void OnSelectionChanged(object sender, EventArgs e) } /// - /// Allows a designer to filter the set of properties the component it is designing will expose through the TypeDescriptor object. This method is called immediately before its corresponding "Post" method. If you are overriding this method you should call the base implementation before you perform your own filtering. + /// Allows a designer to filter the set of properties the component it is designing will expose through + /// the TypeDescriptor object. This method is called immediately before its corresponding "Post" method. + /// If you are overriding this method you should call the base implementation before you perform your own filtering. /// protected override void PreFilterProperties(IDictionary properties) { @@ -615,7 +618,8 @@ private void ResetRightToLeft() } /// - /// Show the MenuDesigner; used by ToolStripMenuItemDesigner to show the menu when the user selects the dropDown item through the PG or Document outline. The editor node will be selected by default. + /// Show the MenuDesigner; used by ToolStripMenuItemDesigner to show the menu when the user + /// selects the dropDown item through the PG or Document outline. The editor node will be selected by default. /// public void ShowMenu() { diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripEditorManager.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripEditorManager.cs index 9c2cc7bbbb3..5fbdfbc457e 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripEditorManager.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripEditorManager.cs @@ -18,17 +18,18 @@ namespace System.Windows.Forms.Design; /// internal class ToolStripEditorManager { - // Local copy of BehaviorService so that we can add the Insitu Editor to the AdornerWindow. + // Local copy of BehaviorService so that we can add the InSitu Editor to the AdornerWindow. private readonly BehaviorService _behaviorService; // Component for this InSitu Editor... (this is a ToolStripItem) that wants to go into InSitu private readonly IDesignerHost _designerHost; - // The current Bounds of the Insitu Editor on Adorner Window.. These are required for invalidation. + // The current Bounds of the InSitu Editor on Adorner Window.. These are required for invalidation. private Rectangle _lastKnownEditorBounds = Rectangle.Empty; // The encapsulated Editor. private ToolStripEditorControl _editor; // Actual ToolStripEditor for the current ToolStripItem. private ToolStripTemplateNode _editorUI; - // The Current ToolStripItem that needs to go into the InSitu Mode. We keep a local copy so that when a new item comes in, we can "ROLLBACK" the existing edit. + // The Current ToolStripItem that needs to go into the InSitu Mode. + // We keep a local copy so that when a new item comes in, we can "ROLLBACK" the existing edit. private ToolStripItem _currentItem; // The designer for current ToolStripItem. private ToolStripItemDesigner _itemDesigner; @@ -40,7 +41,7 @@ public ToolStripEditorManager(IComponent comp) } /// - /// Activates the editor for the given item.If there's still an editor around for the previous-edited item, it is + /// Activates the editor for the given item.If there's still an editor around for the previous-edited item, it is /// deactivated. Pass in 'null' to deactivate and remove the current editor, if any. /// internal void ActivateEditor(ToolStripItem item) @@ -86,7 +87,7 @@ internal void ActivateEditor(ToolStripItem item) _behaviorService.AdornerWindowControl.Controls.Add(_editor); _lastKnownEditorBounds = _editor.Bounds; _editor.BringToFront(); - // this is important since the ToolStripEditorControl listens to textchanged messages from TextBox. + // this is important since the ToolStripEditorControl listens to textChanged messages from TextBox. _editorUI._ignoreFirstKeyUp = true; // Select the Editor... Put Text and Select it ... _editorUI.FocusEditor(_currentItem); @@ -102,7 +103,7 @@ internal static void CloseManager() } /// - /// This LISTENs to the Editor Resize for resizing the Insitu edit on the Adorner Window ... CURRENTLY DISABLED. + /// This LISTENs to the Editor Resize for resizing the InSitu edit on the Adorner Window ... CURRENTLY DISABLED. /// private void OnEditorResize(object sender, EventArgs e) { @@ -114,7 +115,8 @@ private void OnEditorResize(object sender, EventArgs e) } } - // Private Class Implemented for InSitu Editor. This class just Wraps the ToolStripEditor from the TemplateNode and puts it in a Panel. + // Private Class Implemented for InSitu Editor. This class just Wraps the ToolStripEditor from the TemplateNode + // and puts it in a Panel. private class ToolStripEditorControl : Panel { private readonly Control _wrappedEditor; diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripItemBehavior.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripItemBehavior.cs index 27a776c6fb9..a993e32a1a3 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripItemBehavior.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripItemBehavior.cs @@ -98,7 +98,7 @@ private static void ClearInsertionMark(ToolStripItem item) } } - // Tries to put the item in the Insitu edit mode after the double click timer has ticked + // Tries to put the item in the InSitu edit mode after the double click timer has ticked private static void EnterInSituMode(ToolStripItemGlyph glyph) { if (glyph.ItemDesigner is not null && !glyph.ItemDesigner.IsEditorActive) @@ -185,7 +185,7 @@ private bool MouseHandlerPresent(ToolStripItem item) return (mouseHandler is not null); } - // Occurs when the timer ticks after user has doubleclicked an item + // Occurs when the timer ticks after user has double clicked an item private void OnDoubleClickTimerTick(object sender, EventArgs e) { if (_timer is not null) @@ -195,7 +195,7 @@ private void OnDoubleClickTimerTick(object sender, EventArgs e) _timer.Dispose(); _timer = null; - // Enter Insitu + // Enter InSitu if (_selectedGlyph is not null && _selectedGlyph.Item is ToolStripMenuItem) { EnterInSituMode(_selectedGlyph); diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripKeyboardHandlingService.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripKeyboardHandlingService.cs index b630eea2f7f..bb0d00900ea 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripKeyboardHandlingService.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripKeyboardHandlingService.cs @@ -18,15 +18,19 @@ internal class ToolStripKeyboardHandlingService private IServiceProvider _provider; private IMenuCommandService _menuCommandService; private readonly IDesignerHost _designerHost; - // primary selection during shift operation is the LAST selected item which is different from selSvc.PrimarySelection, hence cache it + // primary selection during shift operation is the LAST selected item which is different + // from selSvc.PrimarySelection, hence cache it private object _shiftPrimary; private bool _shiftPressed; // our cache of currently selected DesignerToolStripControl Host.... private object _currentSelection; - // is the templateNode in Insitu Mode? + // is the templateNode in InSitu Mode? private bool _templateNodeActive; private ToolStripTemplateNode _activeTemplateNode; - // is the TemplateNode ContextMenu open. When the TemplateNode AddItems ContextMenu is opened we want to Disable all the Commands... And we enable them when the contextMenu closes... But if the menu closes by "enter Key" we get OnKeyDefault and hence go into InSitu Edit Mode.. to avoid this we have a new flag to IGNORE the first OnKeyDefault. + // is the TemplateNode ContextMenu open. When the TemplateNode AddItems ContextMenu is + // opened we want to Disable all the Commands... And we enable them when the contextMenu closes... + // But if the menu closes by "enter Key" we get OnKeyDefault and hence go into InSitu Edit Mode.. + // to avoid this we have a new flag to IGNORE the first OnKeyDefault. private bool _templateNodeContextMenuOpen; // old commands private List _oldCommands; @@ -78,14 +82,19 @@ internal ToolStripTemplateNode ActiveTemplateNode } } - // This property is set on the controlDesigner and used in the ToolStripItemDesigner. There is no way of knowing whether the ContextMenu is show via-keyBoard or Click and we need to know this since we check if the Bounds are within the toolStripItem while showing the ContextMenu. + // This property is set on the controlDesigner and used in the ToolStripItemDesigner. + // There is no way of knowing whether the ContextMenu is show via-keyBoard or Click and + // we need to know this since we check if the Bounds are within the toolStripItem while showing the ContextMenu. internal bool ContextMenuShownByKeyBoard { get => _contextMenuShownByKeyBoard; set => _contextMenuShownByKeyBoard = value; } - // When Copy (Through Control + Drag) this boolean is set to true. Problem is that during copy the DesignerUtils creates new components and as a result the ToolStripMenuItemDesigner and ToolStripDesigners get the "ComponentAdding/ComponentAdded" events where they try to parent the components. We don't need to "parent" in case of control + drag. + // When Copy (Through Control + Drag) this boolean is set to true. + // Problem is that during copy the DesignerUtils creates new components and + // as a result the ToolStripMenuItemDesigner and ToolStripDesigners get the "ComponentAdding/ComponentAdded" events + // where they try to parent the components. We don't need to "parent" in case of control + drag. internal bool CopyInProgress { get => _copyInProgress; @@ -98,7 +107,10 @@ internal bool CopyInProgress } } - // We need to listen to MenuCommands.Delete since we are going to change the selection here instead of OnComponentRemoved The OnComponentRemoved gets called through various different places like Partial Reload, Full Reload and Undo-Redo transactions Changing the selection in "OnComponentRemoved" thus is expensive in terms of flicker and code that gets run causing PERF hit. + // We need to listen to MenuCommands.Delete since we are going to change the selection here instead + // of OnComponentRemoved The OnComponentRemoved gets called through various different places like Partial Reload, + // Full Reload and Undo-Redo transactions Changing the selection in "OnComponentRemoved" + // thus is expensive in terms of flicker and code that gets run causing PERF hit. internal bool CutOrDeleteInProgress { get => _cutOrDeleteInProgress; @@ -138,7 +150,8 @@ private IMenuCommandService MenuService } } - // When the TemplateNode gets selected ... we don't set in the SelectionService.SelectedComponents since we want to blank out the propertygrid ... so we keep the selected cache here. + // When the TemplateNode gets selected ... we don't set in the SelectionService.SelectedComponents + // since we want to blank out the propertygrid ... so we keep the selected cache here. internal object SelectedDesignerControl { get => _currentSelection; @@ -313,7 +326,9 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo bool hitCtl = false; Control found = null; Control p = ctl.Parent; - // Cycle through the controls in z-order looking for the one with the next highest tab index. Because there can be dups, we have to start with the existing tab index and remember to exclude the current control. + // Cycle through the controls in z-order looking for the one with the next highest tab index. + // Because there can be dups, we have to start with the existing tab index and remember + // to exclude the current control. int parentControlCount = 0; Control.ControlCollection parentControls = p.Controls; if (parentControls is not null) @@ -326,13 +341,16 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo // The logic for this is a bit lengthy, so I have broken it into separate clauses: We are not interested in ourself. if (parentControls[c] != ctl) { - // We are interested in controls with >= tab indexes to ctl. We must include those controls with equal indexes to account for duplicate indexes. + // We are interested in controls with >= tab indexes to ctl. + // We must include those controls with equal indexes to account for duplicate indexes. if (parentControls[c].TabIndex >= targetIndex) { // Check to see if this control replaces the "best match" we've already found. if (found is null || found.TabIndex > parentControls[c].TabIndex) { - // Finally, check to make sure that if this tab index is the same as ctl, that we've already encountered ctl in the z-order. If it isn't the same, than we're more than happy with it. + // Finally, check to make sure that if this tab index is the same as ctl, + // that we've already encountered ctl in the z-order. + // If it isn't the same, than we're more than happy with it. if ((parentControls[c].Site is not null && parentControls[c].TabIndex != targetIndex) || hitCtl) { found = parentControls[c]; @@ -342,7 +360,8 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo } else { - // We track when we have encountered "ctl". We never want to select ctl again, but we want to know when we've seen it in case we find another control with the same tab index. + // We track when we have encountered "ctl". We never want to select ctl again, but we want + // to know when we've seen it in case we find another control with the same tab index. hitCtl = true; } } @@ -363,7 +382,8 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo bool hitCtl = false; Control found = null; Control p = ctl.Parent; - // Cycle through the controls in reverse z-order looking for the next lowest tab index. We must start with the same tab index as ctl, because there can be dups. + // Cycle through the controls in reverse z-order looking for the next lowest tab index. + // We must start with the same tab index as ctl, because there can be dups. int parentControlCount = 0; Control.ControlCollection parentControls = p.Controls; if (parentControls is not null) @@ -376,13 +396,16 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo // The logic for this is a bit lengthy, so I have broken it into separate clauses: We are not interested in ourself. if (parentControls[c] != ctl) { - // We are interested in controls with <= tab indexes to ctl. We must include those controls with equal indexes to account for duplicate indexes. + // We are interested in controls with <= tab indexes to ctl. + // We must include those controls with equal indexes to account for duplicate indexes. if (parentControls[c].TabIndex <= targetIndex) { // Check to see if this control replaces the "best match" we've already found. if (found is null || found.TabIndex < parentControls[c].TabIndex) { - // Finally, check to make sure that if this tab index is the same as ctl, that we've already encountered ctl in the z-order. If it isn't the same, than we're more than happy with it. + // Finally, check to make sure that if this tab index is the same as ctl, + // that we've already encountered ctl in the z-order. + // If it isn't the same, than we're more than happy with it. if (parentControls[c].TabIndex != targetIndex || hitCtl) { found = parentControls[c]; @@ -392,7 +415,8 @@ private static Control GetNextControlInTab(Control basectl, Control ctl, bool fo } else { - // We track when we have encountered "ctl". We never want to select ctl again, but we want to know when we've seen it in case we find another control with the same tab index. + // We track when we have encountered "ctl". We never want to select ctl again, but we want + // to know when we've seen it in case we find another control with the same tab index. hitCtl = true; } } @@ -469,7 +493,10 @@ public bool OnContextMenu(int x, int y) y = p.Y; } - // This has to be done since ToolStripTemplateNode is unsited component that supports its own contextMenu. When the Selection is null, templateNode can be selected. So this block of code here checks if ToolStripKeyBoardHandlingService is present if so, tries to check if the templatenode is selected if so, then gets the templateNode and shows the ContextMenu. + // This has to be done since ToolStripTemplateNode is unsited component that supports its own contextMenu. + // When the Selection is null, templateNode can be selected. + // So this block of code here checks if ToolStripKeyBoardHandlingService is present if so, + // tries to check if the templatenode is selected if so, then gets the templateNode and shows the ContextMenu. if (SelectionService.PrimarySelection is not Component) { if (SelectedDesignerControl is DesignerToolStripControlHost controlHost) @@ -575,7 +602,8 @@ private void OnCommandDelete(object sender, EventArgs e) private void OnCommandPaste(object sender, EventArgs e) { // IF TemplateNode is Active DO NOT Support Paste. This is what MainMenu did - // We used to incorrectly paste the item to the parent's collection; so in order to make a simple fix I am being consistent with MainMenu + // We used to incorrectly paste the item to the parent's collection; + // so in order to make a simple fix I am being consistent with MainMenu. if (TemplateNodeActive) { return; @@ -610,7 +638,8 @@ private void OnCommandPaste(object sender, EventArgs e) BehaviorService behaviorService = (BehaviorService)_provider.GetService(typeof(BehaviorService)); behaviorService?.SyncSelection(); - // For ContextMenuStrip; since its not a control .. we don't get called on GetGlyphs directly through the BehaviorService So we need this internal call to push the glyphs on the SelectionManager + // For ContextMenuStrip; since its not a control .. we don't get called on GetGlyphs directly + // through the BehaviorService So we need this internal call to push the glyphs on the SelectionManager if (host.GetDesigner(item) is ToolStripItemDesigner) { ToolStripDropDown dropDown = ToolStripItemDesigner.GetFirstDropDown(item); @@ -662,7 +691,7 @@ private void OnCommandHome(object sender, EventArgs e) item = SelectedDesignerControl as ToolStripItem; } - // Process Keys only if we are a ToolStripItem and the TemplateNode is not in Insitu Mode. + // Process Keys only if we are a ToolStripItem and the TemplateNode is not in InSitu Mode. if (item is not null) { // only select the last item only if there is an Item added in addition to the TemplateNode... @@ -707,7 +736,7 @@ private void OnCommandEnd(object sender, EventArgs e) item = SelectedDesignerControl as ToolStripItem; } - // Process Keys only if we are a ToolStripItem and the TemplateNode is not in Insitu Mode. + // Process Keys only if we are a ToolStripItem and the TemplateNode is not in InSitu Mode. if (item is not null) { // only select the last item only if there is an Item added in addition to the TemplateNode... @@ -983,7 +1012,7 @@ private void OnKeyMove(object sender, EventArgs e) item = SelectedDesignerControl as ToolStripItem; } - // Process Keys only if we are a ToolStripItem and the TemplateNode is not in Insitu Mode. + // Process Keys only if we are a ToolStripItem and the TemplateNode is not in InSitu Mode. if (item is not null) { if (cmd.CommandID.Equals(MenuCommands.KeyMoveRight) || cmd.CommandID.Equals(MenuCommands.KeyNudgeRight) || cmd.CommandID.Equals(MenuCommands.KeySizeWidthIncrease)) @@ -1037,7 +1066,7 @@ private void OnKeyCancel(object sender, EventArgs e) item = SelectedDesignerControl as ToolStripItem; } - // Process Keys only if we are a ToolStripItem and the TemplateNode is not in Insitu Mode. + // Process Keys only if we are a ToolStripItem and the TemplateNode is not in InSitu Mode. if (item is not null) { MenuCommand cmd = (MenuCommand)sender; @@ -1144,7 +1173,7 @@ public void ProcessKeySelect(bool reverse) item = SelectedDesignerControl as ToolStripItem; } - // Process Keys only if we are a ToolStripItem and the TemplateNode is not in Insitu Mode. + // Process Keys only if we are a ToolStripItem and the TemplateNode is not in InSitu Mode. if (item is not null) { if (!ProcessRightLeft(!reverse)) @@ -1400,7 +1429,8 @@ public void ProcessUpDown(bool down) } else { - // We don't want to WRAP around for items on toolStrip Overflow, if the currentSelection is the topMost item on the Overflow, but select the one on the PARENT toolStrip. + // We don't want to WRAP around for items on toolStrip Overflow, if the currentSelection is the + // topMost item on the Overflow, but select the one on the PARENT toolStrip. if (parentToMoveOn is ToolStripOverflow) { ToolStripItem firstItem = GetNextItem(parentToMoveOn, null, ArrowDirection.Down); @@ -1755,7 +1785,10 @@ public void RotateTab(bool backwards) IContainer container = host.Container; baseCtl = (Control)host.RootComponent; - // We must handle two cases of logic here. We are responsible for handling selection within ourself, and also for components on the tray. For our own tabbing around, we want to go by tab-order. When we get to the end of the form, however, we go by selection order into the tray. And, when we're at the end of the tray we start back at the form. We must reverse this logic to go backwards. + // We must handle two cases of logic here. We are responsible for handling selection within ourself, + // and also for components on the tray. For our own tabbing around, we want to go by tab-order. + // When we get to the end of the form, however, we go by selection order into the tray. + // And, when we're at the end of the tray we start back at the form. We must reverse this logic to go backwards. currentSelection = selSvc.PrimarySelection; if (_shiftPressed && ShiftPrimaryItem is not null) { @@ -1783,7 +1816,10 @@ public void RotateTab(bool backwards) if (targetSelection is not null) { ControlDesigner controlDesigner = host.GetDesigner((IComponent)targetSelection) as ControlDesigner; - // In Whidbey controls like ToolStrips have componentTray presence, So don't select them again through component tray since here we select only Components. Hence only components that have ComponentDesigners should be selected via the ComponentTray. + // In Whidbey controls like ToolStrips have componentTray presence, + // so don't select them again through component tray since here we + // select only Components. Hence only components that have ComponentDesigners + // should be selected via the ComponentTray. while (controlDesigner is not null) { // if the targetSelection from the Tray is a control .. try the next one. @@ -1877,7 +1913,10 @@ public void RotateTab(bool backwards) if (targetSelection is not null) { ControlDesigner controlDesigner = host.GetDesigner((IComponent)targetSelection) as ControlDesigner; - // In Whidbey controls like ToolStrips have componentTray presence, So don't select them again through component tray since here we select only Components. Hence only components that have ComponentDesigners should be selected via the ComponentTray. + // In Whidbey controls like ToolStrips have componentTray presence, + // So don't select them again through component tray since here we + // select only Components. Hence only components that have ComponentDesigners + // should be selected via the ComponentTray. while (controlDesigner is not null) { // if the targetSelection from the Tray is a control .. try the next one. @@ -1958,7 +1997,7 @@ public void RotateTab(bool backwards) if (targetSelection is null && ctl is not null && (baseCtl.Contains(ctl) || baseCtl == currentSelection)) { - // Our current selection is a control. Select the next control in the z-order. + // Our current selection is a control. Select the next control in the z-order. while ((ctl = GetNextControlInTab(baseCtl, ctl, !backwards)) is not null) { if (ctl.Site is not null && ctl.Site.Container == container && !(ctl is ToolStripPanel)) diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemCodeDomSerializer.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemCodeDomSerializer.cs index 2f1b178a908..c7775292905 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemCodeDomSerializer.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemCodeDomSerializer.cs @@ -34,7 +34,7 @@ private static CodeDomSerializer GetBaseSerializer(IDesignerSerializationManager public override object? Serialize(IDesignerSerializationManager manager, object value) { // Don't Serialize if we are Dummy Item ... - if (value is ToolStripMenuItem {IsOnDropDown: false} item) + if (value is ToolStripMenuItem { IsOnDropDown: false } item) { ToolStrip? parent = item.GetCurrentParent(); if (parent is not null && parent.Site is null) diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemDesigner.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemDesigner.cs index f34ed970589..a1eb83fa725 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemDesigner.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripMenuItemDesigner.cs @@ -18,12 +18,14 @@ namespace System.Windows.Forms.Design; internal class ToolStripMenuItemDesigner : ToolStripDropDownItemDesigner { private const int GLYPHINSET = 2; - // This is the typeHereNode that appears to the bottom and right of each committed ToolStripDropDownItem + // This is the typeHereNode that appears to the bottom and right of each committed ToolStripDropDownItem private DesignerToolStripControlHost _typeHereNode; private ToolStripTemplateNode _typeHereTemplateNode; - // This is the TemplateNode.EditorToolStrip. The editor ToolStrip is encapsulated in a ToolStripControlHost and then added as a ToolStripDropDownItem on the current ToolStripDropDownItems DropDown. + // This is the TemplateNode.EditorToolStrip. The editor ToolStrip is encapsulated in a ToolStripControlHost and + // then added as a ToolStripDropDownItem on the current ToolStripDropDownItems DropDown. private DesignerToolStripControlHost _commitedEditorNode; - // Actual InSitu Editor. This is created for every selected ToolStripDropDownItem and is DISPOSED immediately after the item comes out of InSitu edit Mode. + // Actual InSitu Editor. This is created for every selected ToolStripDropDownItem and is DISPOSED immediately + // after the item comes out of InSitu edit Mode. private ToolStripTemplateNode _commitedTemplateNode; // DesignerHost for current Component @@ -48,10 +50,11 @@ internal class ToolStripMenuItemDesigner : ToolStripDropDownItemDesigner // only used by DropDownMenu, DropDown or ContextMenuStrip. private DesignerTransaction _insertMenuItemTransaction; - // We want one parent transaction when the item is added by InSitu editing which is now supported only for MenuItems. This parent transaction would include + // We want one parent transaction when the item is added by InSitu editing which is now supported only for MenuItems. + // This parent transaction would include // - Adding the DummyItem // - Swapping the DummyItem with the InsItu - // - Committing the new Item with the text entered in the Insitu. + // - Committing the new Item with the text entered in the InSitu. private DesignerTransaction _newMenuItemTransaction; // DropDownToInvalidate private Rectangle _dropDownSizeToInvalidate = Rectangle.Empty; @@ -313,7 +316,8 @@ private ToolStripKeyboardHandlingService KeyboardHandlingService => _keyboardHandlingService ??= GetService(); /// - /// ParentComponent in case of MenuItems on the DropDown is the OwnerItem of the DropDown and not the ToolStripDropDown (since the DropDowns are not sited) + /// ParentComponent in case of MenuItems on the DropDown is the OwnerItem of the DropDown and + /// not the ToolStripDropDown (since the DropDowns are not sited). /// protected override IComponent ParentComponent { @@ -323,7 +327,9 @@ protected override IComponent ParentComponent { if (!ToolStripItem.IsOnOverflow && ToolStripItem.IsOnDropDown) { - // If the dropDown is NOT AutoGenerated then its a dropdown the user has set or its a contextMenuStrip/ToolStripDropDownMenu/ToolStripDropDown that has been added from the ToolBox. In such a case don't return the ownerItem but the DropDown itself as the ParentComponent. + // If the dropDown is NOT AutoGenerated then its a dropdown the user has set or its a + // contextMenuStrip/ToolStripDropDownMenu/ToolStripDropDown that has been added from the ToolBox. + // In such a case don't return the ownerItem but the DropDown itself as the ParentComponent. if (MenuItem.Owner is ToolStripDropDown dropDown) { if (dropDown.IsAutoGenerated) @@ -412,7 +418,9 @@ private void AddBodyGlyphs(ToolStripDropDownItem item) } /// - /// This is called by the TemplateNode to Commit the Edit. This function creates a NEW ToolStripDropDownItem if we are committing a dummy node or else just replaces the TEXT and IMAGE if we are changing an existing MenuItem. + /// This is called by the TemplateNode to Commit the Edit. This function creates a NEW ToolStripDropDownItem + /// if we are committing a dummy node or else just replaces the TEXT and IMAGE if we are changing + /// an existing MenuItem. /// internal override void CommitEdit(Type type, string text, bool commit, bool enterKeyPressed, bool tabKeyPressed) { @@ -485,7 +493,7 @@ internal override void CommitEdit(Type type, string text, bool commit, bool ente } else { - // We are adding the item through INSITU for the first time + // We are adding the item through InSitu for the first time if (dummyItem) { try @@ -581,7 +589,7 @@ internal override void CommitEdit(Type type, string text, bool commit, bool ente MenuItem.DropDown.PerformLayout(); // Reset the Glyphs after Item addition... ResetGlyphs(MenuItem); - // set the selection to our new item only if item was committed via ENTER KEY in the Insitu Mode. + // set the selection to our new item only if item was committed via ENTER KEY in the InSitu Mode. if (_selectionService is not null) { if (enterKeyPressed) @@ -743,7 +751,9 @@ private void CreatetypeHereNode() } /// - /// This Function is called by EnterInSituEdit where in we Swap the typeHereNode by the TemplateNode (the Insitu Editor). Since the TemplateNode had a EditorToolStrip we can just HOST that ToolStrip as a ToolStripControlHost and add it to the DropDown. + /// This Function is called by EnterInSituEdit where in we Swap the typeHereNode by + /// the TemplateNode (the InSitu Editor). Since the TemplateNode had a EditorToolStrip we can just HOST + /// that ToolStrip as a ToolStripControlHost and add it to the DropDown. /// private void CreateDummyMenuItem(ToolStripItem item, string text) { @@ -760,7 +770,7 @@ private void CreateDummyMenuItem(ToolStripItem item, string text) } /// - /// This helper function creates a dummyItem for Insitu editing. + /// This helper function creates a dummyItem for InSitu editing. /// private ToolStripItem CreateDummyItem(Type t, int dummyIndex) { @@ -801,7 +811,8 @@ private ToolStripItem CreateDummyItem(Type t, int dummyIndex) ToolStripItemDesigner designer = _designerHost.GetDesigner(newItem) as ToolStripItemDesigner; try { - // ToolStripItem designer tries to set the TEXT for the item in the InitializeNewComponent(). But since we are create item thru InSitu .. we shouldn't do this. + // ToolStripItem designer tries to set the TEXT for the item in the InitializeNewComponent(). + // But since we are create item thru InSitu .. we shouldn't do this. designer.InternalCreate = true; if (designer is ComponentDesigner) { @@ -875,7 +886,8 @@ private ToolStripItem CreateNewItem(Type t, int dummyIndex, string newText) ToolStripItemDesigner designer = _designerHost.GetDesigner(newItem) as ToolStripItemDesigner; try { - // ToolStripItem designer tries to set the TEXT for the item in the InitializeNewComponent(). But since we are create item thru InSitu .. we shouldn't do this. + // ToolStripItem designer tries to set the TEXT for the item in the InitializeNewComponent(). + // But since we are create item thru InSitu .. we shouldn't do this. if (!string.IsNullOrEmpty(newText) || _addingDummyItem) { designer.InternalCreate = true; @@ -904,7 +916,8 @@ private ToolStripItem CreateNewItem(Type t, int dummyIndex, string newText) } catch { - // There might be scenarios where the ComponentAdding is fired but the Added doesn't get fired. Is such cases the InsertTransaction might be still active... So we need to cancel that too here. + // There might be scenarios where the ComponentAdding is fired but the Added doesn't get fired. + // Is such cases the InsertTransaction might be still active... So we need to cancel that too here. CommitInsertTransaction(false); if (outerTransaction is not null) { @@ -1051,7 +1064,7 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - // When the dropDown is clicked; Commit any active insitu node. + // When the dropDown is clicked; Commit any active InSitu node. private void DropDownClick(object sender, EventArgs e) { // Commit any InsituEdit Node. @@ -1083,7 +1096,9 @@ private void DropDownPaint(object sender, PaintEventArgs e) } } - // When you alt-tab from VS to any other application and come back and if the dropDown is open; then the templateNode doesn't paint. This happens when you have another control below the dropDown which paints over the controlhost so we need to refresh the TemplateNode in this case. + // When you alt-tab from VS to any other application and come back and if the dropDown is open; + // then the templateNode doesn't paint. This happens when you have another control below the dropDown + // which paints over the controlhost so we need to refresh the TemplateNode in this case. if (item is DesignerToolStripControlHost controlHost) { controlHost.Control.Refresh(); @@ -1095,7 +1110,8 @@ private void DropDownPaint(object sender, PaintEventArgs e) // Invalidate the BehaviorService if the location changed. private void DropDownLocationChanged(object sender, EventArgs e) { - // this shouldn't get fired many times.. only in certain case... but in those cases its needed to REFRESH THE ENTIRE adornerWindow. + // this shouldn't get fired many times.. only in certain case... + // but in those cases its needed to REFRESH THE ENTIRE adornerWindow. ToolStripDropDown dropDown = sender as ToolStripDropDown; if (dropDown.Visible) { @@ -1213,7 +1229,7 @@ private void DropDownResize(object sender, EventArgs e) /// internal void EditTemplateNode(bool clicked) { - // If the parent has a window which is too small, there won't be any space to draw the entry box and typeHereNode will be null + // If the parent has a window which is too small, there won't be any space to draw the entry box and typeHereNode will be null if (_typeHereNode is null) { return; @@ -1228,7 +1244,7 @@ internal void EditTemplateNode(bool clicked) KeyboardHandlingService.ActiveTemplateNode.CommitAndSelect(); } - // commit any existing insitu editor... + // commit any existing InSitu editor... if (clicked) { // We should come here for a valid parent !!! @@ -1313,21 +1329,21 @@ internal void EditTemplateNode(bool clicked) } /// - /// Called from OnDoubleClickTimerTick to Enter in InsituMode + /// Called from OnDoubleClickTimerTick to Enter in InSituMode /// private void EnterInSituMode() { - // we need to tell our parent that we want to enter insitu edit mode + // we need to tell our parent that we want to enter InSitu edit mode if (MenuItem.Owner is ToolStripDropDown dropDown) { ToolStripItem ownerItem = dropDown.OwnerItem; - // need to inform the owner tha we want to enter insitu mode + // need to inform the owner tha we want to enter InSitu mode if (_designerHost is not null) { IDesigner designer = _designerHost.GetDesigner(ownerItem); if (designer is ToolStripMenuItemDesigner menuItemDesigner) { - // Need to Add Dummy Node For Direct Insitu.. + // Need to Add Dummy Node For Direct InSitu.. MenuItem.HideDropDown(); menuItemDesigner.EnterInSituEdit(MenuItem); } @@ -1357,7 +1373,7 @@ internal void EnterInSituEdit(ToolStripItem toolItem) CreateDummyMenuItem(toolItem, toolItem.Text); int index = MenuItem.DropDownItems.IndexOf(toolItem); - // swap in our insitu ToolStrip + // swap in our InSitu ToolStrip MenuItem.DropDownItems.Insert(index, _commitedEditorNode); if (toolItem is ToolStripControlHost host) { @@ -1570,7 +1586,9 @@ internal void InitializeDropDown() if (!_initialized) { _initialized = true; - // When the DropDown is Shared the ownerItem need not be the current MenuItem. In Such a case hide the dropDown for current owner ... this will bring everything to a sane state.. + // When the DropDown is Shared the ownerItem need not be the current MenuItem. + // In Such a case hide the dropDown for current owner ... + // this will bring everything to a sane state.. if (MenuItem.DropDown.OwnerItem is ToolStripDropDownItem currentOwner && currentOwner != MenuItem) { if (_designerHost.GetDesigner(currentOwner) is ToolStripMenuItemDesigner ownerdesigner) @@ -2119,7 +2137,8 @@ private void OnUndoing(object source, EventArgs e) } /// - /// Once a menuItem designer has selection - be sure to expand and collapse all necessary child/parent items Implements the Selection Paint Logic by adding Text to Tag property. Also Hides Unnecessary DropDowns. + /// Once a menuItem designer has selection - be sure to expand and collapse all necessary child/parent items + /// Implements the Selection Paint Logic by adding Text to Tag property. Also Hides Unnecessary DropDowns. /// private void OnSelectionChanged(object sender, EventArgs e) { @@ -2220,7 +2239,9 @@ private void OnSelectionChanged(object sender, EventArgs e) if (MenuItem.DropDown.Visible) { - // CASE : Check if the DropDown Selected is the one assigned to this MenuItem's DropDown property. If MenuItem.DropDown matches the currentSelection or is the First Dropdown of any selection THEN return + // CASE : Check if the DropDown Selected is the one assigned to this MenuItem's DropDown property. + // If MenuItem.DropDown matches the currentSelection or is the First Dropdown + // of any selection THEN return if (selectedObj is ToolStripDropDown selectedDropDown && MenuItem.DropDown == selectedDropDown) { return; @@ -2255,7 +2276,9 @@ private void OnSelectionChanged(object sender, EventArgs e) } /// - /// Allows a designer to filter the set of properties the component it is designing will expose through the TypeDescriptor object. This method is called immediately before its corresponding "Post" method. If you are overriding this method you should call the base implementation before you perform your own filtering. + /// Allows a designer to filter the set of properties the component it is designing will expose through + /// the TypeDescriptor object. This method is called immediately before its corresponding "Post" method. + /// If you are overriding this method you should call the base implementation before you perform your own filtering. /// protected override void PreFilterProperties(IDictionary properties) { @@ -2304,7 +2327,8 @@ protected override void PreFilterProperties(IDictionary properties) /// internal void RemoveTypeHereNode(ToolStripDropDownItem ownerItem) { - // This will cause the DropDown to Relayout so that during the DropDownClosed event we won't have proper Bounds to Invalidate the ToolStripAdorner... So for this case do it here... + // This will cause the DropDown to Relayout so that during the DropDownClosed event we won't have + // proper Bounds to Invalidate the ToolStripAdorner... So for this case do it here... Rectangle bounds = ownerItem.DropDown.Bounds; if (ownerItem.DropDownItems.Count > 0 && ownerItem.DropDownItems[0] is DesignerToolStripControlHost) { @@ -2328,7 +2352,7 @@ internal void RemoveTypeHereNode(ToolStripDropDownItem ownerItem) } /// - /// This private function is called to ROLLBACK the current Insitu editing mode. + /// This private function is called to ROLLBACK the current InSitu editing mode. /// private void RollBack() { @@ -2415,7 +2439,7 @@ internal void ResetGlyphs(ToolStripDropDownItem item) } /// - /// Set the Selection after a insitu edit is complete. + /// Set the Selection after a InSitu edit is complete. /// internal override bool SetSelection(bool enterKeyPressed) { @@ -2475,7 +2499,7 @@ internal override bool SetSelection(bool enterKeyPressed) private bool ShouldSerializeVisible() => !Visible; /// - /// This Function is called thru the ToolStripEditorManager which is listening for the F2 command. + /// This Function is called thru the ToolStripEditorManager which is listening for the F2 command. /// internal override void ShowEditNode(bool clicked) { @@ -2489,7 +2513,7 @@ internal override void ShowEditNode(bool clicked) if (MenuItem.Owner is ToolStripDropDown dropDown) { _parentItem = dropDown.OwnerItem; - // need to inform the owner tha we want to enter insitu mode + // need to inform the owner tha we want to enter InSitu mode if (_designerHost is not null) { IDesigner designer = _designerHost.GetDesigner(_parentItem); @@ -2545,7 +2569,8 @@ private void SelectItems(ToolStripDropDownItem oldSelection, ISelectionService s /// internal void ShowOwnerDropDown(ToolStripDropDownItem currentSelection) { - // We MIGHT HAVE TO START TOP - DOWN Instead of BOTTOM-UP. Sometimes we DON'T get the Owner POPUP and hence all the popup are parented to Wrong guy. + // We MIGHT HAVE TO START TOP - DOWN Instead of BOTTOM-UP. + // Sometimes we DON'T get the Owner POPUP and hence all the popup are parented to Wrong guy. while (currentSelection is not null && currentSelection.Owner is ToolStripDropDown dropDown) { ToolStripDropDown currentDropDown = dropDown; @@ -2594,7 +2619,10 @@ internal ToolStripDropDownGlyph(Rectangle bounds, Behavior.Behavior b) : base(b) } /// - /// Abstract method that forces Glyph implementations to provide hit test logic. Given any point - if the Glyph has decided to be involved with that location, the Glyph will need to return a valid Cursor. Otherwise, returning null will cause the the BehaviorService to simply ignore it. + /// Abstract method that forces Glyph implementations to provide hit test logic. + /// Given any point - if the Glyph has decided to be involved with that location, + /// the Glyph will need to return a valid Cursor. Otherwise, returning null will cause + /// the BehaviorService to simply ignore it. /// public override Cursor GetHitTest(Point p) { diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripTemplateNode.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripTemplateNode.cs index 053158b7a59..94b72833ac2 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripTemplateNode.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ToolStripTemplateNode.cs @@ -12,7 +12,11 @@ namespace System.Windows.Forms.Design; /// -/// This internal class wraps the InSitu Editor. The editor is a runtime ToolStrip control which contains a leftButton (for image), centerLabel (for text) which gets swapped by a centerTextBox (when InSitu is ON). The ToolStripTemplateNode is also responsible for intercepting the Escape and Enter keys and implements the IMenuStatusHandler so that it can commit and rollback as required. Finally this ToolStripTemplateNode has a private class ItemTypeToolStripMenuItem for adding ToolStripItem types to the Dropdown for addItemButton. +/// This internal class wraps the InSitu Editor. The editor is a runtime ToolStrip control which contains a leftButton +/// (for image), centerLabel (for text) which gets swapped by a centerTextBox (when InSitu is ON). +/// The ToolStripTemplateNode is also responsible for intercepting the Escape and Enter keys and implements +/// the IMenuStatusHandler so that it can commit and rollback as required. Finally this ToolStripTemplateNode +/// has a private class ItemTypeToolStripMenuItem for adding ToolStripItem types to the Dropdown for addItemButton. /// internal class ToolStripTemplateNode : IMenuStatusHandler { @@ -60,14 +64,19 @@ internal class ToolStripTemplateNode : IMenuStatusHandler // reqd as rtb does accept Enter.. internal bool _ignoreFirstKeyUp; - // This is the Bounding Rectangle for the ToolStripTemplateNode. This is set by the itemDesigner in terms of the "AdornerWindow" bounds. The ToolStripEditorManager uses this Bounds to actually activate the editor on the AdornerWindow. + // This is the Bounding Rectangle for the ToolStripTemplateNode. + // This is set by the itemDesigner in terms of the "AdornerWindow" bounds. + // The ToolStripEditorManager uses this Bounds to actually activate the editor on the AdornerWindow. private Rectangle _boundingRect; - // Keeps track of Insitu Mode. + // Keeps track of InSitu Mode. private bool _inSituMode; // Tells whether the editorNode is listening to Menu commands. private bool _active; - // Need to keep a track of Last Selection to uncheck it. This is the Checked property on ToolStripItems on the Menu. We check this cached in value to the current Selection on the addItemButton and if different then uncheck the Checked for this lastSelection.. Check for the currentSelection and finally save the currentSelection as the lastSelection for future check. + // Need to keep a track of Last Selection to uncheck it. This is the Checked property on ToolStripItems on the Menu. + // We check this cached in value to the current Selection on the addItemButton and if different then + // uncheck the Checked for this lastSelection.. Check for the currentSelection and finally save the currentSelection + // as the lastSelection for future check. private ItemTypeToolStripMenuItem _lastSelection; // This is the renderer used to Draw the Strips..... @@ -83,7 +92,7 @@ internal class ToolStripTemplateNode : IMenuStatusHandler private BehaviorService _behaviorService; // ControlHost for selection on mouseclicks private DesignerToolStripControlHost _controlHost; - // On DropDowns the component passed in is the parent (ownerItem) and hence we need the reference for actual item + // On DropDowns the component passed in is the parent (ownerItem) and hence we need the reference for actual item private ToolStripItem _activeItem; private EventHandler _onActivated; @@ -99,7 +108,7 @@ internal class ToolStripTemplateNode : IMenuStatusHandler private bool _imeModeSet; // DesignSurface to hook up to the Flushed event private DesignSurface _designSurface; - // Is system context menu displayed for the insitu text box? + // Is system context menu displayed for the InSitu text box? private bool _isSystemContextMenuDisplayed; // delay population of custom menu items until ready to open the drop down private bool _isPopulated; @@ -372,7 +381,7 @@ public Type ToolStripItemType } /// - /// Is system context menu for the insitu edit box displayed?. + /// Is system context menu for the InSitu edit box displayed?. /// internal bool IsSystemContextMenuDisplayed { @@ -527,19 +536,20 @@ private void CenterLabelClick(object sender, MouseEventArgs e) { if (_component is ToolStripItem currentItem) { - // We have clicked the TemplateNode of a visible Item .. so just commit the current Insitu... + // We have clicked the TemplateNode of a visible Item .. so just commit the current InSitu... if (currentItem.Visible) { // If templateNode Active .. commit KeyboardService.ActiveTemplateNode.Commit(false, false); } - else // we have clicked the templateNode of a Invisible Item ... so a dummyItem. In this case select the item. + else // we have clicked the templateNode of a Invisible Item ... + // so a dummyItem. In this case select the item. { // If templateNode Active .. commit and Select KeyboardService.ActiveTemplateNode.Commit(false, true); } } - else // If Component is not a ToolStripItem + else // If Component is not a ToolStripItem { KeyboardService.ActiveTemplateNode.Commit(false, false); } @@ -660,7 +670,9 @@ private void CenterTextBoxMouseLeave(object sender, EventArgs e) } /// - /// This Internal function is called from the ToolStripItemDesigner to relinquish the resources used by the EditorToolStrip. This Function disposes the ToolStrip and its components and also clears the event handlers associated. + /// This Internal function is called from the ToolStripItemDesigner to relinquish the resources used + /// by the EditorToolStrip. This Function disposes the ToolStrip and its components and also + /// clears the event handlers associated. /// internal void CloseEditor() { @@ -731,7 +743,7 @@ internal void CloseEditor() } /// - /// This internal Function is called by item designers to ROLLBACK the current Insitu editing mode. + /// This internal Function is called by item designers to ROLLBACK the current InSitu editing mode. /// internal void Commit(bool enterKeyPressed, bool tabKeyPressed) { @@ -796,13 +808,20 @@ private void CommitTextToDesigner(string text, bool commit, bool enterKeyPressed } /// - /// This private function performs the job of committing the current InSitu Editor. This will call the CommitEdit(...) function for the appropriate designers so that they can actually do their own Specific things for committing (or ROLLING BACK) the Insitu Edit mode. The commit flag is used for commit or rollback. BE SURE TO ALWAYS call ExitInSituEdit from this function to put the EditorToolStrip in a sane "NON EDIT" mode. + /// This private function performs the job of committing the current InSitu Editor. + /// This will call the CommitEdit(...) function for the appropriate designers so that they can actually do + /// their own Specific things for committing (or ROLLING BACK) the InSitu Edit mode. + /// The commit flag is used for commit or rollback. BE SURE TO ALWAYS call ExitInSituEdit + /// from this function to put the EditorToolStrip in a sane "NON EDIT" mode. /// private void CommitEditor(bool commit, bool enterKeyPressed, bool tabKeyPressed) { - // After the node is commited the templateNode gets the selection. But the original selection is not invalidated. consider following case - // FOO -> BAR -> TEMPLATENODE node - // When the TemplateNode is committed "FOO" is selected but after the commit is complete, The TemplateNode gets the selection but "FOO" is never invalidated and hence retains selection. So we get the selection and then invalidate it at the end of this function. Get the currentSelection to invalidate + // After the node is committed the templateNode gets the selection. + // But the original selection is not invalidated. consider following case FOO -> BAR -> TEMPLATENODE node + // When the TemplateNode is committed "FOO" is selected but after the commit is complete. + // The TemplateNode gets the selection but "FOO" is never invalidated and hence retains selection. + // So we get the selection and then invalidate it at the end of this function. + // Get the currentSelection to invalidate. string text = (_centerTextBox is not null) ? ((TextBox)(_centerTextBox.Control)).Text : string.Empty; ExitInSituEdit(); FocusForm(); @@ -829,7 +848,11 @@ private void CommitEditor(bool commit, bool enterKeyPressed, bool tabKeyPressed) } /// - /// The ToolStripTemplateNode enters into InSitu Edit Mode through this Function. This Function is called by FocusEditor( ) which starts the InSitu. The centerLabel is SWAPPED by centerTextBox and the ToolStripTemplateNode is Ready for Text. Setting "Active = true" pushes the IEventHandler which now intercepts the Escape and Enter keys to ROLLBACK or COMMIT the InSitu Editing respectively. + /// The ToolStripTemplateNode enters into InSitu Edit Mode through this Function. + /// This Function is called by FocusEditor( ) which starts the InSitu. + /// The centerLabel is SWAPPED by centerTextBox and the ToolStripTemplateNode is Ready for Text. + /// Setting "Active = true" pushes the IEventHandler which now intercepts the Escape and Enter keys to ROLLBACK or + /// COMMIT the InSitu Editing respectively. /// private void EnterInSituEdit() { @@ -876,7 +899,7 @@ private void EnterInSituEdit() _centerTextBox.MouseEnter += CenterTextBoxMouseEnter; _centerTextBox.MouseLeave += CenterTextBoxMouseLeave; int index = _miniToolStrip.Items.IndexOf(_centerLabel); - // swap in our insitu textbox + // swap in our InSitu textbox if (index != -1) { _miniToolStrip.Items.Insert(index, _centerTextBox); @@ -903,7 +926,10 @@ private void EnterInSituEdit() } /// - /// The ToolStripTemplateNode exits from InSitu Edit Mode through this Function. This Function is called by CommitEditor( ) which stops the InSitu. The centerTextBox is SWAPPED by centerLabel and the ToolStripTemplateNode is exits the InSitu Mode. Settting "Active = false" pops the IEventHandler. + /// The ToolStripTemplateNode exits from InSitu Edit Mode through this Function. + /// This Function is called by CommitEditor( ) which stops the InSitu. + /// The centerTextBox is SWAPPED by centerLabel and the ToolStripTemplateNode is exits the InSitu Mode. + /// Setting "Active = false" pops the IEventHandler. /// private void ExitInSituEdit() { @@ -914,13 +940,13 @@ private void ExitInSituEdit() try { - // if going insitu with a real item, set & select all the text + // if going InSitu with a real item, set & select all the text int index = _miniToolStrip.Items.IndexOf(_centerTextBox); // validate index if (index != -1) { _centerLabel.Text = SR.ToolStripDesignerTemplateNodeEnterText; - // swap in our insitu textbox + // swap in our InSitu textbox _miniToolStrip.Items.Insert(index, _centerLabel); _miniToolStrip.Items.Remove(_centerTextBox); ((TextBox)(_centerTextBox.Control)).KeyUp -= OnKeyUp; @@ -946,7 +972,7 @@ private void ExitInSituEdit() } /// - /// This internal function is called from ToolStripItemDesigner to put the current item into InSitu Edit Mode. + /// This internal function is called from ToolStripItemDesigner to put the current item into InSitu Edit Mode. /// internal void FocusEditor(ToolStripItem currentItem) { @@ -1034,7 +1060,9 @@ private void OnLoaderFlushed(object sender, EventArgs e) } /// - /// This is small HACK. For some reason if the InSituEditor's textbox has focus the escape key is lost and the menu service doesn't get it.... but the textbox gets it. So need to check for the escape key here and call CommitEditor(false) which will ROLLBACK the edit. + /// This is small HACK. For some reason if the InSituEditor's textbox has focus the escape key is lost and + /// the menu service doesn't get it.... but the textbox gets it. So need to check for the escape key here and + /// call CommitEditor(false) which will ROLLBACK the edit. /// private void OnKeyUp(object sender, KeyEventArgs e) { @@ -1088,11 +1116,11 @@ private void OnKeyDown(object sender, KeyEventArgs e) } /// - /// Check for the Enter key here and call CommitEditor(true) which will COMMIT the edit. + /// Check for the Enter key here and call CommitEditor(true) which will COMMIT the edit. /// private void OnKeyDefaultAction(object sender, EventArgs e) { - // exit Insitu with committing.... + // exit InSitu with committing.... Active = false; Debug.Assert(_centerTextBox.Control is not null, "The TextBox is null"); if (_centerTextBox.Control is not null) @@ -1242,7 +1270,7 @@ public bool OverrideStatus(MenuCommand cmd) } /// - /// This internal Function is called by item designers to ROLLBACK the current Insitu editing mode. + /// This internal Function is called by item designers to ROLLBACK the current InSitu editing mode. /// internal void RollBack() { @@ -1484,7 +1512,7 @@ private void SetupNewEditNode(ToolStripTemplateNode owner, string text, ICompone } /// - /// This method does sets the width of the Editor (_miniToolStrip) based on the text passed in. + /// This method does sets the width of the Editor (_miniToolStrip) based on the text passed in. /// internal void SetWidth(string text) { @@ -1560,7 +1588,7 @@ protected override bool ProcessDialogKey(Keys keyData) } /// - /// Process the WNDPROC for WM_KILLFOCUS to commit the Insitu Editor.. + /// Process the WNDPROC for WM_KILLFOCUS to commit the InSitu Editor.. /// protected override void WndProc(ref Message m) { @@ -1579,7 +1607,7 @@ protected override void WndProc(ref Message m) // 1.Slowly click on a menu strip item twice to make it editable, while the item's dropdown menu is visible // 2.Select the text of the item and right click on it // 3.Left click 'Copy' or 'Cut' in the context menu IDE crashed because left click in step3 invoked glyph - // behavior, which committed and destroyed the InSitu edit box and thus the 'copy' or 'cut' action has no + // behavior, which committed and destroyed the InSitu edit box and thus the 'copy' or 'cut' action has no // text to work with. Thus need to block glyph behaviors while the context menu is displayed. case PInvoke.WM_CONTEXTMENU: _owner.IsSystemContextMenuDisplayed = true; @@ -1594,7 +1622,8 @@ protected override void WndProc(ref Message m) } /// - /// Private class to Change the ToolStrip to a TransparentToolStrip. Our EditorToolStrip is a TransparentToolStrip so that it picks up the itemColor. + /// Private class to Change the ToolStrip to a TransparentToolStrip. Our EditorToolStrip is a TransparentToolStrip + /// so that it picks up the itemColor. /// public class TransparentToolStrip : ToolStrip { @@ -1733,7 +1762,6 @@ protected override void WndProc(ref Message m) if (_owner._addItemButton is null) { // only adding patterns to _miniToolStrip associated with MenuStrip or ContextMenu - // m.Result = AutomationInteropProvider.ReturnRawElementProvider(Handle, m.WParam, m.LParam, (IRawElementProviderSimple)(new TransparentToolStripUiaProvider(this))); return; } diff --git a/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponent.cs b/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponent.cs index fbe1c43df6f..63903a10377 100644 --- a/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponent.cs +++ b/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponent.cs @@ -236,7 +236,7 @@ public HWND HwndGetWindow(msocWindow dwWhich, uint dwReserved) /// should be returned from WM_MOUSEACTIVATE, so that the active (or tracking) comp will be able to process the /// resulting mouse message. If one does not want to examine the reg info, no MA_xxxANDEAT value /// should be returned from WM_MOUSEACTIVATE if any comp is active (or tracking). One - /// can query the reg info of the active (or tracking) component at any time via + /// can query the reg info of the active (or tracking) component at any time via /// . /// /// diff --git a/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponentManager.cs b/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponentManager.cs index c4be9d5b8ac..eed2eb60412 100644 --- a/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponentManager.cs +++ b/src/System.Windows.Forms.Primitives/src/Microsoft/Office/IMsoComponentManager.cs @@ -477,7 +477,7 @@ BOOL FPushMessageLoop( void* pvLoopData); /// - /// Cause the component manager to create a "sub" component manager, which will be one of its + /// Cause the component manager to create a "sub" component manager, which will be one of its /// children in the hierarchical tree of component managers used to maintain state contexts /// (see "Comments on State Contexts" in remarks). /// diff --git a/src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs b/src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs index 537207178f7..394794d313e 100644 --- a/src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs +++ b/src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs @@ -9,7 +9,7 @@ namespace System.Windows.Forms.Primitives; // Borrowed from https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs internal static partial class LocalAppContextSwitches { - // Enabling switches in Core is different from Framework. See https://learn.Microsoft.com/dotnet/core/runtime-config/ + // Enabling switches in Core is different from Framework. See https://learn.microsoft.com/dotnet/core/runtime-config/ // for details on how to set switches. // Switch names declared internal below are used in unit/integration tests. Refer to diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/AccessibiltyExtensions.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/AccessibiltyExtensions.cs index bcf5ea55239..5c8fee0ac83 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/AccessibiltyExtensions.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/AccessibiltyExtensions.cs @@ -11,7 +11,7 @@ internal static unsafe class AccessibiltyExtensions /// internal static LRESULT GetLRESULT(this IAccessible accessible, WPARAM wparam) { - // https://learn.Microsoft.com/windows/win32/winauto/how-to-handle-wm-getobject + // https://learn.microsoft.com/windows/win32/winauto/how-to-handle-wm-getobject using var unknown = ComHelpers.TryGetComScope(accessible, out _); diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextProvider.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextProvider.cs index aa1a3bf0385..ac623e3d734 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextProvider.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextProvider.cs @@ -99,8 +99,8 @@ public static SafeArrayScope RectListToDoubleArray(List rectA /// /// Bounding rectangles are represented by a VT_ARRAY of doubles in a native VARIANT /// in accessibility interfaces. This method does the conversion. Accessibility will then convert it to an UiaRect. - /// https://learn.Microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-get_boundingrectangle - /// https://learn.Microsoft.com/windows/win32/api/uiautomationcore/ns-uiautomationcore-uiarect + /// https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-get_boundingrectangle + /// https://learn.microsoft.com/windows/win32/api/uiautomationcore/ns-uiautomationcore-uiarect /// internal static SafeArrayScope BoundingRectangleAsArray(Rectangle bounds) { diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextRange.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextRange.cs index aa8cc8ee9dd..b615f7c5f07 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextRange.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextRange.cs @@ -675,7 +675,8 @@ private static bool AtWordBoundary(string text, int index) private static bool IsApostrophe(char ch) => ch is '\'' or ((char)0x2019); // Unicode Right Single Quote Mark /// - /// Attribute values and their types are defined here - https://learn.Microsoft.com/windows/win32/winauto/uiauto-textattribute-ids + /// Attribute values and their types are defined here - + /// https://learn.microsoft.com/windows/win32/winauto/uiauto-textattribute-ids /// private VARIANT GetAttributeValue(UIA_TEXTATTRIBUTE_ID textAttributeIdentifier) { diff --git a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.DpiAwarenessScope.cs b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.DpiAwarenessScope.cs index 70798f6c2b9..ad4b9dd61a9 100644 --- a/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.DpiAwarenessScope.cs +++ b/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/ScaleHelper.DpiAwarenessScope.cs @@ -26,7 +26,8 @@ private class DpiAwarenessScope : IDisposable /// to be set on the thread. public DpiAwarenessScope(DPI_AWARENESS_CONTEXT context, DPI_HOSTING_BEHAVIOR behavior) { - // Full support for DPI_AWARENESS_CONTEXT and mixed mode DPI_HOSTING_BEHAVIOR on the thread is only available after the RS4 OS release. + // Full support for DPI_AWARENESS_CONTEXT and mixed mode DPI_HOSTING_BEHAVIOR on the thread + // is only available after the RS4 OS release. if (!OsVersion.IsWindows10_18030rGreater()) { Debug.Fail("Full support for DPI_AWARENESS_CONTEXT and mixed mode DPI_HOSTING_BEHAVIOR on the thread is only available after the RS4 OS release"); diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/Foundation/COLORREF.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/Foundation/COLORREF.cs index f72f658a45c..2bbc7601b26 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/Foundation/COLORREF.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/Foundation/COLORREF.cs @@ -11,7 +11,7 @@ namespace Windows.Win32.Foundation; /// any conversion in , , etc. as they can change the value. /// is a DWORD- passing constants in native code would just pass the value as is. /// -/// Read more on learn.Microsoft.com. +/// Read more on learn.microsoft.com. /// internal readonly partial struct COLORREF { diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.MaxClassName.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.MaxClassName.cs index b212f275a6c..7d729d0e345 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.MaxClassName.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.MaxClassName.cs @@ -11,7 +11,7 @@ internal static partial class PInvoke /// the RegisterClassEx function will fail. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/System/Com/ComSafeArrayScopeExtensions.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/System/Com/ComSafeArrayScopeExtensions.cs index 99239ec9b14..e4649ef0813 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/System/Com/ComSafeArrayScopeExtensions.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/System/Com/ComSafeArrayScopeExtensions.cs @@ -11,7 +11,8 @@ internal static class ComSafeArrayScopeExtensions /// /// /// - /// must implement where T is . + /// + /// must implement where T is . /// /// public static unsafe ComSafeArrayScope CreateComSafeArrayScope(this TComInterface[] interfaces) diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIAHelper.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIAHelper.cs index cea3ea9258c..650bf66daf1 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIAHelper.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIAHelper.cs @@ -30,7 +30,7 @@ public static VARIANT WindowHandleToVariant(nint handle) { vt = VARENUM.VT_I4, // Only the lower 32 bits in window handles contain significant information - - // https://learn.Microsoft.com/windows/win32/winprog64/interprocess-communication + // https://learn.microsoft.com/windows/win32/winprog64/interprocess-communication data = new() { intVal = (int)(handle & 0xFFFF_FFFF) } }; } diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSECOLORW.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSECOLORW.cs index 08a59b20ebc..058eaa5ba0d 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSECOLORW.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSECOLORW.cs @@ -25,7 +25,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -38,7 +38,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com + /// Read more on learn.microsoft.com /// /// /// @@ -54,7 +54,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -73,7 +73,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -92,7 +92,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -107,7 +107,7 @@ internal unsafe partial struct CHOOSECOLORW /// This doc was truncated. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -124,7 +124,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -139,7 +139,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -156,7 +156,7 @@ internal unsafe partial struct CHOOSECOLORW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSEFONTW.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSEFONTW.cs index afda307c713..75bef25e614 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSEFONTW.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/CHOOSEFONTW.cs @@ -9,7 +9,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Read more on learn.Microsoft.com +/// Read more on learn.microsoft.com /// /// /// @@ -19,7 +19,7 @@ internal partial struct CHOOSEFONTW /// Type: DWORD The length of the structure, in bytes. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -32,7 +32,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -49,7 +49,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -68,7 +68,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -82,7 +82,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -102,7 +102,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -120,7 +120,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -135,7 +135,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -152,7 +152,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -168,7 +168,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -183,7 +183,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -201,7 +201,7 @@ internal partial struct CHOOSEFONTW /// ChooseFont recognizes this member only if the CF_LIMITSIZE flag is specified. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -215,7 +215,7 @@ internal partial struct CHOOSEFONTW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PAGESETUPDLGW.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PAGESETUPDLGW.cs index 98ada7b2c48..e517a95c6d9 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PAGESETUPDLGW.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PAGESETUPDLGW.cs @@ -12,7 +12,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Read more on learn.Microsoft.com. +/// Read more on learn.microsoft.com. /// /// /// @@ -32,7 +32,7 @@ internal partial struct PAGESETUPDLGW /// Type: DWORD The size, in bytes, of this structure. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -45,7 +45,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -62,7 +62,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -81,7 +81,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -93,10 +93,13 @@ internal partial struct PAGESETUPDLGW /// /// /// Type: - /// POINT The dimensions of the paper selected by the user. The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates the units of measurement. + /// POINT The dimensions of the paper selected by the user. + /// The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates + /// the units of measurement. + /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -113,7 +116,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -131,7 +134,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -145,18 +148,26 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// public HINSTANCE hInstance; /// - /// - /// Type: LPARAM Application-defined data that the system passes to the hook procedure identified by the - /// lpfnPageSetupHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the PAGESETUPDLG structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. - /// - /// Read more on learn.Microsoft.com. + /// + /// Type: LPARAM Application-defined data that the system passes to the hook procedure identified by the + /// lpfnPageSetupHook member. When the system sends the + /// WM_INITDIALOG + /// message to the hook procedure, the message's lParam parameter is a pointer to the PAGESETUPDLG + /// structure specified when the dialog was created. The hook procedure can use this pointer to get the + /// lCustData value. + /// + /// + /// + /// Read more on learn.microsoft.com. + /// + /// /// public LPARAM lCustData; @@ -169,7 +180,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// public unsafe delegate* unmanaged[Stdcall] lpfnPageSetupHook; @@ -184,7 +195,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// public unsafe delegate* unmanaged[Stdcall] lpfnPagePaintHook; @@ -200,7 +211,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// public PCWSTR lpPageSetupTemplateName; @@ -212,7 +223,7 @@ internal partial struct PAGESETUPDLGW /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// public HGLOBAL hPageSetupTemplate; diff --git a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGW_64.cs b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGW_64.cs index a8aa1d917da..de2817e25a9 100644 --- a/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGW_64.cs +++ b/src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/Dialogs/PRINTDLGW_64.cs @@ -10,7 +10,7 @@ namespace Windows.Win32.UI.Controls.Dialogs; /// /// /// -/// Read more on learn.Microsoft.com. +/// Read more on learn.microsoft.com. /// /// /// @@ -27,7 +27,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -40,7 +40,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -72,7 +72,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -98,7 +98,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -113,7 +113,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -137,7 +137,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -154,7 +154,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -168,7 +168,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -179,7 +179,7 @@ internal partial struct PRINTDLGW_64 /// Type: WORD The maximum value for the page range specified in the From and To page edit controls. /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -201,7 +201,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -215,7 +215,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -232,7 +232,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -247,7 +247,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -262,7 +262,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -276,7 +276,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -290,7 +290,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -304,7 +304,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// @@ -318,7 +318,7 @@ internal partial struct PRINTDLGW_64 /// /// /// - /// Read more on learn.Microsoft.com. + /// Read more on learn.microsoft.com. /// /// /// diff --git a/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs b/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs index 9633d886442..f6644c09111 100644 --- a/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs +++ b/src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs @@ -21,7 +21,7 @@ public void RepoPathsLeaveRoomForRoot() const int MaxRootLength = 40; - // Workaround for MAX_PATH limitation - https://learn.Microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry + // Workaround for MAX_PATH limitation - https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry // Leave a char for the trailing null (MAX_PATH is 260) int maxLength = 260 - 1 - (currentRootLength > MaxRootLength ? 0 diff --git a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs index a5f2c0870bc..08fbc7a1240 100644 --- a/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs +++ b/src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs @@ -42,7 +42,8 @@ public sealed class ResXDataNode : ISerializable // Callback function to get type name for multitargeting. // No public property to force using constructors for the following reasons: - // 1. one of the constructors needs this field (if used) to initialize the object, make it consistent with the other constructors to avoid errors. + // 1. one of the constructors needs this field (if used) to initialize the object, make it consistent with the + // other constructors to avoid errors. // 2. once the object is constructed the delegate should not be changed to avoid getting inconsistent results. private Func? _typeNameConverter; diff --git a/src/System.Windows.Forms/src/System/Resources/ResXResourceReader.cs b/src/System.Windows.Forms/src/System/Resources/ResXResourceReader.cs index 003ba07bb32..db0c682ed29 100644 --- a/src/System.Windows.Forms/src/System/Resources/ResXResourceReader.cs +++ b/src/System.Windows.Forms/src/System/Resources/ResXResourceReader.cs @@ -585,7 +585,7 @@ private void ParseDataNode(XmlTextReader reader, bool isMetaData) WhitespaceHandling oldValue = reader.WhitespaceHandling; try { - // Based on the documentation at https://learn.Microsoft.com/dotnet/api/system.xml.xmltextreader.whitespacehandling + // Based on the documentation at https://learn.microsoft.com/dotnet/api/system.xml.xmltextreader.whitespacehandling // this is ok because: // // "Because the XmlTextReader does not have DTD information available to it, diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObject.cs index 16455eb53c1..93660373796 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObject.cs @@ -2653,7 +2653,7 @@ public virtual void Select(AccessibleSelection flags) private VARIANT AsChildIdVariant(AccessibleObject? obj) { - // https://learn.Microsoft.com/windows/win32/winauto/how-child-ids-are-used-in-parameters + // https://learn.microsoft.com/windows/win32/winauto/how-child-ids-are-used-in-parameters if (obj == this) { return (VARIANT)(int)PInvoke.CHILDID_SELF; @@ -2776,7 +2776,8 @@ protected unsafe void UseStdAccessibleObjects(IntPtr handle, int objid) /// /// /// This is basically just a wrapper for - /// that does some of the dirty work. Usage is similar to . + /// that does some of the dirty work. Usage is similar to + /// . /// Called prior to calling on the 'inner' system /// accessible object. /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObjectExtensions.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObjectExtensions.cs index f0b53e06a29..efbd536b6bf 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObjectExtensions.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Accessibility/AccessibleObjectExtensions.cs @@ -160,7 +160,7 @@ public static BSTR TryGetName(this AgileComPointer? agile, VARIANT public static void TrySetName(this AgileComPointer? agile, VARIANT child, BSTR name) { // This is not technically supported any more, unclear if this ever actually does anything. - // https://learn.Microsoft.com/windows/win32/api/oleacc/nf-oleacc-iaccessible-put_accname + // https://learn.microsoft.com/windows/win32/api/oleacc/nf-oleacc-iaccessible-put_accname if (name.IsNull) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs index 7ad1a73b4ca..0f8a09f9889 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs @@ -1643,7 +1643,7 @@ internal void SetClientSite(IOleClientSite* value) // Callers don't increment the ref count when they pass IOleClientSite, it is up to us to do so as we're // maintaining a reference to the pointer. Validated this behavior with the ATL/MFC sources. // - // https://learn.Microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-setclientsite#notes-to-implementers + // https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-setclientsite#notes-to-implementers value->AddRef(); _clientSite = new(value, takeOwnership: true); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs index f4e3237eee7..ce186d18c5a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ContextMenuStrip.cs @@ -120,12 +120,17 @@ protected override void SetVisibleCore(bool visible) base.SetVisibleCore(visible); // There are two problems we're facing when trying to scale ContextMenuStrip: - // 1. ContextMenuStrip is a top level window and thus only receive "WM_DPICHANGED" message but not WM_DPICHANGED_BEFOREPARENT/WM_DPICHANGED_AFTERPARENT. - // Unfortunately, we do not handle scaling of controls in "WM_DPICHANGED" message. In WinForms, "WM_DPICHANGED" message is intended for Top-level Forms/ContainerControls. - // As a result, the ContextMenuStrip window doesn't scale itself when moved from one monitor to another on the "PerMonitorV2" process. - // 2. When ContextMenuStrip changes to invisible(with "visible" set to false), owner of the window is changed to a ParkingWindow that may possibly parked on primary monitor. + // 1. ContextMenuStrip is a top level window and thus only receive "WM_DPICHANGED" message + // but not WM_DPICHANGED_BEFOREPARENT/WM_DPICHANGED_AFTERPARENT. + // Unfortunately, we do not handle scaling of controls in "WM_DPICHANGED" message. + // In WinForms, "WM_DPICHANGED" message is intended for Top-level Forms/ContainerControls. + // As a result, the ContextMenuStrip window doesn't scale itself when moved from one monitor + // to another on the "PerMonitorV2" process. + // 2. When ContextMenuStrip changes to invisible(with "visible" set to false), owner of the window + // is changed to a ParkingWindow that may possibly parked on primary monitor. // The "GetDpiForWindow()" API on ContextMenuStrip thus returns the DPI of the primary monitor. - // Because of this inconsistency, we intentionally recreate the handle that triggers scaling according to the new DPI, after setting the "visible" property. + // Because of this inconsistency, we intentionally recreate the handle that triggers scaling according + // to the new DPI, after setting the "visible" property. if (visible && IsHandleCreated && ScaleHelper.IsThreadPerMonitorV2Aware 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 b554bea199a..75ffc8bc949 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -286,10 +286,12 @@ public unsafe partial class Control : // Contains a collection of calculated fonts for various Dpi values of the control in the PerMonV2 mode. private Dictionary? _dpiFonts; - // Flag to signify whether any child controls necessitate the calculation of AnchorsInfo, particularly in cases involving nested containers. + // Flag to signify whether any child controls necessitate the calculation of AnchorsInfo, + // particularly in cases involving nested containers. internal bool _childControlsNeedAnchorLayout; - // Inform whether the AnchorsInfo needs to be reevaluated, especially when the control's bounds have been altered explicitly. + // Inform whether the AnchorsInfo needs to be reevaluated, + // especially when the control's bounds have been altered explicitly. internal bool _forceAnchorCalculations; internal byte LayoutSuspendCount { get; private set; } @@ -2280,7 +2282,7 @@ internal unsafe bool HostedInWin32DialogManager } // #32770 is the standard windows dialog class name - // https://learn.Microsoft.com/windows/win32/winmsg/about-window-classes#system-classes + // https://learn.microsoft.com/windows/win32/winmsg/about-window-classes#system-classes ReadOnlySpan className = "#32770"; if (className.Equals(buffer[..length], StringComparison.Ordinal)) { @@ -3377,14 +3379,15 @@ protected internal virtual bool ShowKeyboardCues // Why? Well the way the API seems to work is that it stores in a bit flag for the hidden // state. - // Details from the Menu keydown to changed value of _uiCuesState. + // Details from the Menu keyDown to changed value of _uiCuesState. // When someone does press the ALT (Menu)/F10 key we will // Call ProcessUICues on the control that had focus at the time // ProcessUICues will check the current state of the control using WM_QUERYUISTATE // If WM_QUERYUISTATE indicates that the accelerators are hidden we will // either call WM_UPDATEUISTATE or WM_CHANGEUISTATE depending on whether we're hosted or not. - // All controls in the heirarchy will be individually called back on WM_UPDATEUISTATE, which will go into WmUpdateUIState. + // All controls in the hierarchy will be individually called back on WM_UPDATEUISTATE, + // which will go into WmUpdateUIState. // In WmUpdateUIState, we will update our uiCuesState cached value, which // changes the public value of what we return here for ShowKeyboardCues/ShowFocusCues. @@ -3603,7 +3606,8 @@ private unsafe void WaitForWaitHandle(WaitHandle waitHandle) HANDLE threadHandle = ctx.Handle; bool processed = false; - // setting default exitcode to 0, though it won't be accessed in current code below due to short-circuit logic in condition (returnValue will be false when exitCode is undefined) + // setting default exitcode to 0, though it won't be accessed in current code below due to short-circuit logic + // in condition (returnValue will be false when exitCode is undefined) uint exitCode = 0; bool returnValue = false; while (!processed) @@ -11162,10 +11166,10 @@ private void UpdateReflectParent() // // See: // - // https://learn.Microsoft.com/cpp/mfc/tn061-on-notify-and-wm-notify-messages - // https://learn.Microsoft.com/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170 - // https://learn.Microsoft.com/windows/win32/controls/wm-notify - // https://learn.Microsoft.com/windows/win32/controls/wm-drawitem + // https://learn.microsoft.com/cpp/mfc/tn061-on-notify-and-wm-notify-messages + // https://learn.microsoft.com/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170 + // https://learn.microsoft.com/windows/win32/controls/wm-notify + // https://learn.microsoft.com/windows/win32/controls/wm-drawitem if (!Disposing && IsHandleCreated) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.DataConnection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.DataConnection.cs index 1e4ff90ef74..2b6fc8b16cd 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.DataConnection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridView.DataConnection.cs @@ -51,9 +51,11 @@ internal class DataGridViewDataConnection // 1. DGV deletes the row from Master // 2. The Child currency manager finds out that there are no rows in the Master table // 3. The Child currency manager adds a row in the Master table - which tracks removal of this feature was POSTPONED. - // 4. The DGV bound to the Master table receives the ItemAdded event. At this point, no rows have been deleted from the DGV. - // 5. The DGV bound to the Master table should not add a new DataGridViewRow to its Rows collection because it will be deleted later on. - // So the DGV marks _itemAddedInDeleteOperation to TRUE to know that the next event it expects is an ItemDeleted + // 4. The DGV bound to the Master table receives the ItemAdded event. At this point, no rows have been deleted + // from the DGV. + // 5. The DGV bound to the Master table should not add a new DataGridViewRow to its Rows collection because + // it will be deleted later on. So the DGV marks _itemAddedInDeleteOperation to TRUE to know that the next + // event it expects is an ItemDeleted // 6. The DGV bound to the Master table receives the ItemDeleted event. // It goes ahead and deletes the item and resets _itemAddedInDeleteOperation // @@ -126,7 +128,8 @@ public bool PositionChangingOutsideDataGridView { // DATACONNECTIONSTATE_doNotChangePositionInTheDataGridViewControl means that the data grid view control // manages the position change - // so if DATACONNECTIONSTATE_doNotChangePositionInTheDataGridViewControl is true then the data grid view knows about the position change + // so if DATACONNECTIONSTATE_doNotChangePositionInTheDataGridViewControl is true then the + // data grid view knows about the position change return !_dataConnectionState[DATACONNECTIONSTATE_doNotChangePositionInTheDataGridViewControl] && _dataConnectionState[DATACONNECTIONSTATE_positionChangingInCurrencyManager]; } @@ -1295,7 +1298,8 @@ public void CancelRowEdit(bool restoreRow, bool addNewFinished) // CurrencyManager no longer starts a new transaction automatically // when we call CurrencyManager::CancelCurrentEdit. // So, if the current item inside the currency manager did not change, we have to start a new transaction. - // (If the current item inside the currency manager changed, then the currency manager would have already started a new transaction). + // (If the current item inside the currency manager changed, then the currency manager would have + // already started a new transaction). IEditableObject? editableObject = null; if (CurrencyManager.Position >= 0 && CurrencyManager.Position < CurrencyManager.List!.Count) { 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 d6d4479a996..a19e6b23c92 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 @@ -393,7 +393,6 @@ or DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders or DataGridViewAutoSizeRowsMode.DisplayedCells); // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. int width = 0; DataGridViewCell dataGridViewCell; if (columnIndex > -1 && (((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.AllColumns) != 0) @@ -984,7 +983,8 @@ private bool AdjustFillingColumns() if (availableWidth <= requiredWidthSum) { - // All auto filled columns need to take their minimum width. If (availableWidth < requiredWidthSum) a horizontal scrollbar appears. + // All auto filled columns need to take their minimum width. If (availableWidth < requiredWidthSum) + // a horizontal scrollbar appears. availableWidth = 0; for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) { @@ -1785,7 +1785,8 @@ protected void AutoResizeColumnHeadersHeight(bool fixedRowHeadersWidth, bool fix { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns/rows. int preferredHeight = 0; if (_layout.TopLeftHeader.Width > 0) { @@ -1859,7 +1860,8 @@ protected void AutoResizeColumnHeadersHeight(int columnIndex, bool fixedRowHeade { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns/rows. int preferredHeight = 0; if (_layout.TopLeftHeader.Width > 0) { @@ -1933,7 +1935,8 @@ or DataGridViewAutoSizeColumnCriteriaInternal.DisplayedRows { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns. // Note: Even none-resizable column can programmatically be resized. DataGridViewColumn dataGridViewColumn = Columns[columnIndex]; int preferredColumnWidth = dataGridViewColumn.GetPreferredWidth((DataGridViewAutoSizeColumnMode)autoSizeColumnCriteriaInternal, fixedHeight); @@ -2060,7 +2063,8 @@ protected void AutoResizeRowHeadersWidth( { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns/rows. int preferredWidth = 0, rowIndex; if (_layout.TopLeftHeader.Width > 0) { @@ -2246,7 +2250,8 @@ protected void AutoResizeRowHeadersWidth( { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns/rows. int preferredWidth = 0, rowIndexTmp; if (_layout.TopLeftHeader.Width > 0) { @@ -2386,7 +2391,8 @@ private void AutoResizeRowInternal(int rowIndex, DataGridViewAutoSizeRowMode aut { _noAutoSizeCount++; // Use of WindowsFormsUtils.CreateMeasurementGraphics() avoid use of this.Handle - // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, handle creation wipes out and recreates the columns/rows. + // IntPtr handle = this.Handle; // Force creation of control's handle because for databound grids, + // handle creation wipes out and recreates the columns/rows. // Note: Even none-resizable row can programmatically be resized. DataGridViewRow dataGridViewRow = Rows.SharedRow(rowIndex); dataGridViewRow.GetHeightInfo(rowIndex, out int height, out int minimumHeight); @@ -3402,8 +3408,8 @@ internal bool CancelToolTipPopup(ToolTip toolTip) else { // This is an external tool tip control which wants to show a tool tip over the DataGridView. - // ToolTips from the data Grid view ( the error text, or the formatted text that does not fit in, or the tool tip text from the cell) - // and the ShowCellToolTips take precedence over the external tool tip. + // ToolTips from the data Grid view ( the error text, or the formatted text that does not fit in, + // or the tool tip text from the cell) and the ShowCellToolTips take precedence over the external tool tip. return string.IsNullOrEmpty(ToolTipPrivate) && ShowCellToolTips; } } @@ -15119,7 +15125,8 @@ internal void OnDataGridViewElementStateChanging(DataGridViewElement element, in && dataGridViewColumn.InheritedAutoSizeMode == DataGridViewAutoSizeColumnMode.Fill) { // alternative: throw new InvalidOperationException(SR.DataGridView_CannotMakeAutoFillColumnVisible); - // DataGridView_CannotMakeAutoFillColumnVisible=The column cannot be made visible because its autosizing mode is Fill and it is frozen. + // DataGridView_CannotMakeAutoFillColumnVisible=The column cannot be made visible + // because its autosizing mode is Fill and it is frozen. // Removing the Fill auto size mode when frozen column becomes visible (instead of throwing an exception) dataGridViewColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.None; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewBand.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewBand.cs index c02c5b8e1fe..18f8c698d7a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewBand.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewBand.cs @@ -32,7 +32,8 @@ internal DataGridViewBand() } // NOTE: currently this finalizer is unneeded (empty). See https://github.com/dotnet/winforms/issues/6858. - // All classes that are not need to be finalized must be checked in DataGridViewElement() constructor. Consider to modify it if needed. + // All classes that are not need to be finalized must be checked in DataGridViewElement() constructor. + // Consider to modify it if needed. ~DataGridViewBand() => Dispose(false); internal int CachedThickness { get; set; } @@ -772,8 +773,9 @@ protected virtual void Dispose(bool disposing) } } - // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this class type - // (and all of its subclasses) from check in DataGridViewElement() constructor and DataGridViewElement_Subclasses_SuppressFinalizeCall test! + // If you are adding releasing unmanaged resources code here (disposing == false), + // you need to remove this class type (and all of its subclasses) from check in DataGridViewElement() constructor + // and DataGridViewElement_Subclasses_SuppressFinalizeCall test! // Also consider to modify ~DataGridViewBand() description. } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewCell.cs index 36618135314..0836b23341c 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewCell.cs @@ -77,7 +77,8 @@ protected DataGridViewCell() } // NOTE: currently this finalizer is unneeded (empty). See https://github.com/dotnet/winforms/issues/6858. - // All classes that are not need to be finalized must be checked in DataGridViewElement() constructor. Consider to modify it if needed. + // All classes that are not need to be finalized must be checked in DataGridViewElement() constructor. + // Consider to modify it if needed. ~DataGridViewCell() => Dispose(disposing: false); [Browsable(false)] @@ -1121,7 +1122,9 @@ public virtual void DetachEditingControl() /// custom editing controls and for derived classes as inherited accessibility may differ or /// may be not inherited at all. /// - /// True if accessible hierarchy should be manually recreated for the cell and editing control, otherwise False. + /// + /// True if accessible hierarchy should be manually recreated for the cell and editing control, otherwise False. + /// private bool AccessibleRestructuringNeeded { get @@ -1154,8 +1157,9 @@ protected virtual void Dispose(bool disposing) } } - // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this class type - // (and all of its subclasses) from check in DataGridViewElement() constructor and DataGridViewElement_Subclasses_SuppressFinalizeCall test! + // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this + // class type(and all of its subclasses) from check in DataGridViewElement() constructor and + // DataGridViewElement_Subclasses_SuppressFinalizeCall test! // Also consider to modify ~DataGridViewCell() description. } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumn.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumn.cs index 8c86d2767e0..44c6619dcb7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumn.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumn.cs @@ -630,8 +630,8 @@ public string Name // So while the Control can fall back to Site.Name if the user did not explicitly set Control::Name, // the DataGridViewColumn should always go first to the Site.Name to retrieve the name. // - // NOTE: one side effect of bringing together the design time and the run time "Name" properties is that DataGridViewColumn::Name changes. - // However, DataGridView does not fire ColumnNameChanged event. + // NOTE: one side effect of bringing together the design time and the run time "Name" properties is that + // DataGridViewColumn::Name changes. However, DataGridView does not fire ColumnNameChanged event. // We can't fix this because ISite does not provide Name change notification. So in effect // DataGridViewColumn does not know when its name changed. // I talked w/ MarkRi and he is perfectly fine w/ DataGridViewColumn::Name changing w/o ColumnNameChanged @@ -856,8 +856,9 @@ protected override void Dispose(bool disposing) } } - // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this class type - // (and all of its subclasses) from check in DataGridViewElement() constructor and DataGridViewElement_Subclasses_SuppressFinalizeCall test! + // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this + // class type (and all of its subclasses) from check in DataGridViewElement() + // constructor and DataGridViewElement_Subclasses_SuppressFinalizeCall test! // Also consider to modify ~DataGridViewBand() description. } finally diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumnCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumnCollection.cs index 6700fe63dff..4698f893bc2 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumnCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewColumnCollection.cs @@ -151,7 +151,8 @@ public virtual int Add(DataGridViewColumn dataGridViewColumn) if (DataGridView.InDisplayIndexAdjustments) { - // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. + // We are within columns display indexes adjustments. + // We do not allow changing the column collection while adjusting display indexes. throw new InvalidOperationException(SR.DataGridView_CannotAlterDisplayIndexWithinAdjustments); } @@ -183,7 +184,8 @@ public virtual void AddRange(params DataGridViewColumn[] dataGridViewColumns) if (DataGridView.InDisplayIndexAdjustments) { - // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. + // We are within columns display indexes adjustments. + // We do not allow changing the column collection while adjusting display indexes. throw new InvalidOperationException(SR.DataGridView_CannotAlterDisplayIndexWithinAdjustments); } @@ -272,7 +274,8 @@ public virtual void Clear() if (DataGridView.InDisplayIndexAdjustments) { - // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. + // We are within columns display indexes adjustments. + // We do not allow changing the column collection while adjusting display indexes. throw new InvalidOperationException(SR.DataGridView_CannotAlterDisplayIndexWithinAdjustments); } @@ -869,7 +872,8 @@ public virtual void Insert(int columnIndex, DataGridViewColumn dataGridViewColum if (DataGridView.InDisplayIndexAdjustments) { - // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. + // We are within columns display indexes adjustments. + // We do not allow changing the column collection while adjusting display indexes. throw new InvalidOperationException(SR.DataGridView_CannotAlterDisplayIndexWithinAdjustments); } @@ -1037,7 +1041,8 @@ public virtual void RemoveAt(int index) if (DataGridView.InDisplayIndexAdjustments) { - // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. + // We are within columns display indexes adjustments. + // We do not allow changing the column collection while adjusting display indexes. throw new InvalidOperationException(SR.DataGridView_CannotAlterDisplayIndexWithinAdjustments); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewHeaderCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewHeaderCell.cs index fedc115615a..46c06ca2359 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewHeaderCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewHeaderCell.cs @@ -50,8 +50,9 @@ protected override void Dispose(bool disposing) FlipXPThemesBitmap.Dispose(); } - // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this class type - // (and all of its subclasses) from check in DataGridViewElement() constructor and DataGridViewElement_Subclasses_SuppressFinalizeCall test! + // If you are adding releasing unmanaged resources code here (disposing == false), you need to remove this + // class type(and all of its subclasses) from check in DataGridViewElement() constructor and + // DataGridViewElement_Subclasses_SuppressFinalizeCall test! // Also consider to modify ~DataGridViewCell() description. base.Dispose(disposing); @@ -401,7 +402,8 @@ internal static Rectangle GetThemeMargins(Graphics g) s_rectThemeMargins.Y = rectContent.Y; s_rectThemeMargins.Width = ThemeMargin - rectContent.Right; s_rectThemeMargins.Height = ThemeMargin - rectContent.Bottom; - // On older platforms, the theming margins for a header are unexpectedly (3, 0, 0, 0) when you'd expect something like (0, 0, 2, 3) + // On older platforms, the theming margins for a header are unexpectedly (3, 0, 0, 0) when you'd + // expect something like (0, 0, 2, 3) if (s_rectThemeMargins.X == 3 && s_rectThemeMargins.Y + s_rectThemeMargins.Width + s_rectThemeMargins.Height == 0) { @@ -409,9 +411,11 @@ internal static Rectangle GetThemeMargins(Graphics g) } else { - // On some platforms, the theming margins for a header are unexpectedly (0, 0, 0, 0) when you'd expect something like (2, 1, 0, 2) - // Padding themePadding = DataGridViewHeaderCellRenderer.VisualStyleRenderer.GetMargins(g, MarginProperty.ContentMargins); /* or MarginProperty.SizingMargins */ - // does not work either at this time. It AVs -So we hard code the margins for now. + // On some platforms, the theming margins for a header are unexpectedly (0, 0, 0, 0) when you'd expect + // something like (2, 1, 0, 2) Padding + // themePadding = DataGridViewHeaderCellRenderer.VisualStyleRenderer.GetMargins(g, MarginProperty.ContentMargins); + // /* or MarginProperty.SizingMargins */ does not work either at this time. It AVs -So we hard code + // the margins for now. try { string themeFilename = Path.GetFileName(VisualStyles.VisualStyleInformation.ThemeFilename); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRowHeaderCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRowHeaderCell.cs index 0cb86c1a563..761e85955f8 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRowHeaderCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewRowHeaderCell.cs @@ -1033,10 +1033,12 @@ private void PaintIcon( attr.SetRemapTable(ColorAdjustType.Bitmap, new ReadOnlySpan<(Color OldColor, Color NewColor)>(ref map)); if (SystemInformation.HighContrast && - // We can't replace black with white and vice versa as in other cases due to the colors of images are not exactly black and white. - // Also, we can't make a decision of inverting every pixel by comparing it with a background because it causes artifacts in the image. - // Because the primary color of all images provided to this method is similar to black (brightness almost zero), - // the decision to invert color may be made by checking the background color's brightness. + // We can't replace black with white and vice versa as in other cases due to the colors of images are + // not exactly black and white. Also, we can't make a decision of inverting every pixel by comparing + // it with a background because it causes artifacts in the image. + // Because the primary color of all images provided to this method is similar to + // black (brightness almost zero), the decision to invert color may be made by checking + // the background color's brightness. ControlPaint.IsDark(backColor)) { using Bitmap invertedBitmap = ControlPaint.CreateBitmapWithInvertedForeColor(bmp, backColor); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ImageList/ImageList.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ImageList/ImageList.cs index 08796950bed..44e1c2ad330 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ImageList/ImageList.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ImageList/ImageList.cs @@ -39,7 +39,8 @@ public sealed partial class ImageList : Component, IHandle // The usual handle virtualization problem, with a new twist: image // lists are lossy. At runtime, we delay handle creation as long as possible, and store - // away the original images until handle creation (and hope no one disposes of the images!). At design time, we keep the originals around indefinitely. + // away the original images until handle creation (and hope no one disposes of the images!). + // At design time, we keep the originals around indefinitely. // This variable will become null when the original images are lost. private List? _originals = []; private EventHandler? _recreateHandler; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListControl/ListControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListControl/ListControl.cs index 5d477a25285..a4874f67eb4 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListControl/ListControl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListControl/ListControl.cs @@ -69,10 +69,13 @@ public object? DataSource { // There are several possibilities why setting the data source throws an exception: // 1. the app throws an exception in the events that fire when we change the data source: DataSourceChanged, - // 2. we get an exception when we set the data source and populate the list controls (say,something went wrong while formatting the data) - // 3. the DisplayMember does not fit w/ the new data source (this could happen if the user resets the data source but did not reset the DisplayMember) + // 2. we get an exception when we set the data source and populate the list controls + // (say,something went wrong while formatting the data) + // 3. the DisplayMember does not fit w/ the new data source (this could happen if the user resets the + // data source but did not reset the DisplayMember) // in all cases ListControl should reset the DisplayMember to String.Empty - // the ListControl should also eat the exception - this is the RTM behavior and doing anything else is a breaking change + // the ListControl should also eat the exception - this is the RTM behavior and doing anything + // else is a breaking change DisplayMember = string.Empty; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs index cb463712d97..4fac1fe28b4 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs @@ -3291,7 +3291,8 @@ public void EnsureVisible(int index) Rectangle itemBounds = lvi.Bounds; // LVM_FINDITEM is a nightmare // LVM_FINDITEM will use the top left corner of icon rectangle to determine the closest item - // What happens if there is no icon for this item? then the top left corner of the icon rectangle falls INSIDE the item label (???) + // What happens if there is no icon for this item? then the top left corner of the icon rectangle + // falls INSIDE the item label (???) Rectangle iconBounds = GetItemRect(lvi.Index, ItemBoundsPortion.Icon); @@ -4451,8 +4452,9 @@ protected override void OnMouseHover(EventArgs e) if (Items.Count > 0) { // APPCOMPAT - // V1.* users implement virtualization by communicating directly to the native ListView and by passing our virtualization implementation. - // In that case, the native list view may have an item under the mouse even if our wrapper thinks the item count is 0. + // V1.* users implement virtualization by communicating directly to the native ListView + // and by passing our virtualization implementation. In that case, the native list view may + // have an item under the mouse even if our wrapper thinks the item count is 0. // And that may cause GetItemAt to throw an out of bounds exception. Point pos = Cursor.Position; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewGroup.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewGroup.cs index 871e499b451..92a95792a42 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewGroup.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewGroup.cs @@ -425,7 +425,8 @@ internal void ReleaseUiaProvider() } // Should be used for the cases when sending the message `PInvoke.LVM_SETGROUPINFO` isn't required - // (for example, collapsing/expanding groups with keyboard is performed inside the native control already, so this message isn't needed) + // (for example, collapsing/expanding groups with keyboard is performed inside the native control already, + // so this message isn't needed) internal void SetCollapsedStateInternal(ListViewGroupCollapsedState state) { SourceGenerated.EnumValidator.Validate(state); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemDetailsAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemDetailsAccessibleObject.cs index 6ea3049c165..6f353b2ea1e 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemDetailsAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemDetailsAccessibleObject.cs @@ -157,8 +157,10 @@ internal override int GetChildIndex(AccessibleObject? child) return fakeAccessibleObject; } - // This method is required to get the accessibleChildIndex of the fake accessibility object. Since the fake accessibility object - // has no ListViewSubItem from which we could get an accessibleChildIndex, we have to get its accessibleChildIndex from the dictionary + // This method is required to get the accessibleChildIndex of the fake accessibility object. + // Since the fake accessibility object + // has no ListViewSubItem from which we could get an accessibleChildIndex, + // we have to get its accessibleChildIndex from the dictionary private int GetFakeSubItemIndex(ListViewSubItem.ListViewSubItemAccessibleObject fakeAccessibleObject) { foreach (KeyValuePair keyValuePair in _listViewSubItemAccessibleObjects) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/MaskedTextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/MaskedTextBox.cs index 4464844882e..5630a1f5119 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/MaskedTextBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/MaskedTextBox.cs @@ -642,7 +642,8 @@ public string Mask // // We don't do anything if: // 1. IsNullOrEmpty( value )->[Reset control] && _flagState[IS_NULL_MASK]==>Already Reset. - // 2. !IsNullOrEmpty( value )->[Set control] && !_flagState[IS_NULL_MASK][control is set] && [value is the same]==>No need to update. + // 2. !IsNullOrEmpty( value )->[Set control] && !_flagState[IS_NULL_MASK][control is set] && + // [value is the same]==>No need to update. // if (_flagState[s_isNullMask] == string.IsNullOrEmpty(value) && (_flagState[s_isNullMask] || value == _maskedTextProvider.Mask)) { @@ -912,7 +913,8 @@ public char PromptChar throw new InvalidOperationException(SR.MaskedTextBoxPasswordAndPromptCharError); } - // Recreate masked text provider to be consistent with AllowPromptAsInput - current text may have chars with same value as new prompt. + // Recreate masked text provider to be consistent with AllowPromptAsInput + // - current text may have chars with same value as new prompt. MaskedTextProvider newProvider = new( _maskedTextProvider.Mask, _maskedTextProvider.Culture, diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStrip.ToolStripAccessibleObject.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStrip.ToolStripAccessibleObject.cs index 3c858167a71..18c757157cb 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStrip.ToolStripAccessibleObject.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStrip.ToolStripAccessibleObject.cs @@ -197,11 +197,13 @@ bool ShouldItemBeSkipped(Control hostedControl) || !hostedControl.SupportsUiaProviders || (hostedControl is Label label && string.IsNullOrEmpty(label.Text)); - // Returns the next or the previous ToolStrip item, that is considered a valid navigation fragment (e.g. a control, - // that supports UIA providers and not a ToolStripControlHost). This method removes hosted ToolStrip - // items that are native controls (their accessible objects are provided by Windows), - // from the accessibility tree. It's necessary, because hosted native controls internally add accessible objects - // to the accessibility tree, and thus create duplicated. To avoid duplicates, remove hosted items with native accessibility objects from the tree. + // Returns the next or the previous ToolStrip item, that is considered a valid navigation fragment + // (e.g. a control, that supports UIA providers and not a ToolStripControlHost). + // This method removes hosted ToolStrip items that are native controls + // (their accessible objects are provided by Windows), from the accessibility tree. + // It's necessary, because hosted native controls internally add accessible objects + // to the accessibility tree, and thus create duplicated. To avoid duplicates, + // remove hosted items with native accessibility objects from the tree. AccessibleObject? GetFollowingChildFragment(int index, ToolStripItemCollection items, NavigateDirection direction) { switch (direction) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripDropDown.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripDropDown.cs index e4b33239b38..c1427d2e01e 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripDropDown.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripDropDown.cs @@ -236,11 +236,13 @@ protected override CreateParams CreateParams } else if (topLevel) { - // From MSDN: Menus, dialog boxes, and combo list boxes have the CS_SAVEBITS style. When you use this style for a window, - // Windows saves a bitmap copy of the screen image that the window obscures. First, Windows asks the display driver to save the bits. - // If the display driver has enough memory, it saves the bits for Windows. If the display driver does not have enough memory, Window - // saves the bits itself as a bitmap in global memory and also uses some of User's local heap for housekeeping structures for each window. - // When the application removes the window, Windows can restore the screen image quickly by using the stored bits. + // From MSDN: Menus, dialog boxes, and combo list boxes have the CS_SAVEBITS style. + // When you use this style for a window,Windows saves a bitmap copy of the screen image that the + // window obscures. First, Windows asks the display driver to save the bits. If the display driver + // has enough memory, it saves the bits for Windows. If the display driver does not have enough memory, + // Window saves the bits itself as a bitmap in global memory and also uses some of User's local heap + // for housekeeping structures for each window. When the application removes the window, + // Windows can restore the screen image quickly by using the stored bits. cp.ClassStyle |= (int)WNDCLASS_STYLES.CS_SAVEBITS; } else if (!topLevel) 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 b67fa731aa9..dea808b50e4 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 @@ -372,7 +372,8 @@ private void ApplyCachedBounds() { ToolStripPanelCell cell = (ToolStripPanelCell)element; element.SetBounds(cell.CachedBounds, BoundsSpecified.None); - // Debug.Assert( cell.Control is null || cell.CachedBounds.Location == cell.Control.Bounds.Location, "CachedBounds out of sync with bounds!"); + // Debug.Assert( cell.Control is null || cell.CachedBounds.Location == cell.Control.Bounds.Location, + // "CachedBounds out of sync with bounds!"); } } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSeparator.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSeparator.cs index 5154d450ef0..54d5b12bb48 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSeparator.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSeparator.cs @@ -269,7 +269,8 @@ public override Size GetPreferredSize(Size constrainingSize) } // This is always true! - // parent.LayoutStyle != ToolStripLayoutStyle.HorizontalStackWithOverflow || parent.LayoutStyle != ToolStripLayoutStyle.VerticalStackWithOverflow + // parent.LayoutStyle != ToolStripLayoutStyle.HorizontalStackWithOverflow || + // parent.LayoutStyle != ToolStripLayoutStyle.VerticalStackWithOverflow { // we don't actually know what size to make it, so just keep it a stock size. constrainingSize.Width = SeparatorHeight; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs index 4c1b7b5f9cf..248cf1b57a4 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs @@ -37,7 +37,8 @@ internal ToolStripRenderer HighContrastRenderer { get { - // If system in high contrast mode 'false' flag should be passed to render filled selected button background. This is in consistence with ToolStripProfessionalRenderer. + // If system in high contrast mode 'false' flag should be passed to render filled selected button background. + // This is in consistence with ToolStripProfessionalRenderer. _toolStripHighContrastRenderer ??= new ToolStripHighContrastRenderer(systemRenderMode: false); return _toolStripHighContrastRenderer; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolstripProfessionalRenderer.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolstripProfessionalRenderer.cs index 0f038434c9d..3e765fd325e 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolstripProfessionalRenderer.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolstripProfessionalRenderer.cs @@ -189,7 +189,8 @@ protected override void OnRenderOverflowButtonBackground(ToolStripItemRenderEven if (horizontal) { rightToLeftShift = rightToLeft ? -2 : 0; - // width of the both lines is 1 pixel and lines are drawn next to each other, this the highlight line is 1 pixel below the black line + // width of the both lines is 1 pixel and lines are drawn next to each other, + // this the highlight line is 1 pixel below the black line. g.DrawLine(SystemPens.ControlText, middle.X - Offset2X, overflowArrowRect.Y - Offset2Y, @@ -817,7 +818,11 @@ protected override void OnRenderToolStripContentPanelBackground(ToolStripContent e.Graphics.Clear(ColorTable.ToolStripContentPanelGradientEnd); - // RenderBackgroundGradient(e.Graphics, toolStripContentPanel, ColorTable.ToolStripContentPanelGradientBegin, ColorTable.ToolStripContentPanelGradientEnd); + // RenderBackgroundGradient( + // e.Graphics, + // toolStripContentPanel, + // ColorTable.ToolStripContentPanelGradientBegin, + // ColorTable.ToolStripContentPanelGradientEnd); } #region PrivatePaintHelpers diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs index 372fec5e612..68b98625860 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TreeView/TreeView.cs @@ -3119,7 +3119,8 @@ private void ShowContextMenu(TreeNode treeNode) } } - // Need to send TVM_SELECTITEM to reset the node-highlighting while the contextMenuStrip is being closed so that the treeView reselects the SelectedNode. + // Need to send TVM_SELECTITEM to reset the node-highlighting while the contextMenuStrip is being closed so that the + // treeView reselects the SelectedNode. private void ContextMenuStripClosing(object? sender, ToolStripDropDownClosingEventArgs e) { ContextMenuStrip strip = (ContextMenuStrip)sender!; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/CurrencyManager.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/CurrencyManager.cs index 4f3f9510258..ca55380fdeb 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/CurrencyManager.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/CurrencyManager.cs @@ -854,8 +854,10 @@ protected internal override void OnCurrentChanged(EventArgs e) // if currencyManager changed position then we have two cases: // 1. the previous lastGoodKnownRow was valid: in that case we fell back so do not fire onCurrentChanged // 2. the previous lastGoodKnownRow was invalid: we have two cases: - // a. FindGoodRow actually found a good row, so it can't be the one before the user changed the position: fire the onCurrentChanged - // b. FindGoodRow did not find a good row: we should have gotten an exception so we should not even execute this code + // a. FindGoodRow actually found a good row, so it can't be the one before the user changed + // the position: fire the onCurrentChanged + // b. FindGoodRow did not find a good row: we should have gotten an exception so we should + // not even execute this code if (!positionChanged || (positionChanged && curLastGoodKnownRow != -1)) { onCurrentChangedHandler?.Invoke(this, e); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingConverter.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingConverter.cs index 65520b1ff60..5412cafb4ec 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingConverter.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingConverter.cs @@ -114,9 +114,10 @@ public override bool GetCreateInstanceSupported(ITypeDescriptorContext? context) private static InstanceDescriptor GetInstanceDescriptorFromValues(Binding b) { // The BindingFormattingDialog turns on Binding::FormattingEnabled property. - // however, when the user data binds a property using the PropertyBrowser, Binding::FormattingEnabled is set to false - // The Binding class is not a component class, so we don't have the ComponentInitialize method where we can set FormattingEnabled to true - // so we set it here. + // however, when the user data binds a property using the PropertyBrowser, + // Binding::FormattingEnabled is set to false. + // The Binding class is not a component class, so we don't have the ComponentInitialize + // method where we can set FormattingEnabled to true so we set it here. b.FormattingEnabled = true; bool isComplete = true; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/CommonDialogs/FileDialog.Vista.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/CommonDialogs/FileDialog.Vista.cs index d3be54eaa30..2d7a2b98a76 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/CommonDialogs/FileDialog.Vista.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/CommonDialogs/FileDialog.Vista.cs @@ -52,7 +52,7 @@ private unsafe void OnBeforeVistaDialog(IFileDialog* dialog) if (ClientGuid is { } clientGuid) { // IFileDialog::SetClientGuid should be called immediately after creation of the dialog object. - // https://learn.Microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setclientguid#remarks + // https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setclientguid#remarks dialog->SetClientGuid(in clientGuid); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ErrorProvider/ErrorProvider.IconRegion.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ErrorProvider/ErrorProvider.IconRegion.cs index 116b36cbdbc..2836566c6bb 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ErrorProvider/ErrorProvider.IconRegion.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ErrorProvider/ErrorProvider.IconRegion.cs @@ -44,8 +44,9 @@ public unsafe Region Region using HBITMAP mask = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap); bitmap.Dispose(); - // It is been observed that users can use non standard size icons (not a 16 bit multiples for width and height) - // and GetBitmapBits method allocate bytes in multiple of 16 bits for each row. Following calculation is to get right width in bytes. + // It is been observed that users can use non standard size icons + // (not a 16 bit multiples for width and height) and GetBitmapBits method allocate bytes in multiple + // of 16 bits for each row. Following calculation is to get right width in bytes. int bitmapBitsAllocationSize = 16; // If width is not multiple of 16, we need to allocate BitmapBitsAllocationSize for remaining bits. 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 98c57e4bdeb..5cb22ebc834 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs @@ -5993,7 +5993,8 @@ public DialogResult ShowDialog(IWin32Window? owner) /// Shows the form as a modal dialog box with the specified owner asynchronously. /// /// - /// Any object that implements that represents the top-level window that will own the modal dialog box. + /// Any object that implements + /// that represents the top-level window that will own the modal dialog box. /// /// /// A representing the outcome of the dialog. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Input/InputLanguage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Input/InputLanguage.cs index bc0eb2729d9..da29a0a276b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Input/InputLanguage.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Input/InputLanguage.cs @@ -102,7 +102,7 @@ public string LayoutName { get { - // https://learn.Microsoft.com/windows/win32/intl/using-registry-string-redirection#create-resources-for-keyboard-layout-strings + // https://learn.microsoft.com/windows/win32/intl/using-registry-string-redirection#create-resources-for-keyboard-layout-strings using RegistryKey? key = Registry.LocalMachine.OpenSubKey($@"{KeyboardLayoutsRegistryPath}\{LayoutId}"); return key.GetMUIString("Layout Display Name", "Layout Text") ?? SR.UnknownInputLanguageLayout; } @@ -185,8 +185,8 @@ private string LanguageTag // We need to convert the language identifier to a language tag, because they are deprecated and may have a // transient value. - // https://learn.Microsoft.com/globalization/locale/other-locale-names#lcid - // https://learn.Microsoft.com/windows/win32/winmsg/wm-inputlangchange#remarks + // https://learn.microsoft.com/globalization/locale/other-locale-names#lcid + // https://learn.microsoft.com/windows/win32/winmsg/wm-inputlangchange#remarks // // It turns out that the LCIDToLocaleName API, which is used inside CultureInfo, may return incorrect // language tags for transient language identifiers. For example, it returns "nqo-GN" and "jv-Java-ID" diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.AnchorInfo.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.AnchorInfo.cs index 3ce6cd8c7eb..7a8078842ba 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.AnchorInfo.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.AnchorInfo.cs @@ -14,11 +14,13 @@ internal sealed class AnchorInfo public int Right; public int Bottom; - // In PerMonitorV2 mode applications, when moved from one monitor to the other, Form/Container bounds are scaled with scale - // factor computed with respect to new DPI on the monitor. However, scaling ratio between non-client and client area is not linear. - // Window chrome (adorners) are scaled by Windows following their heuristics, leaving non client area fit to rest of the bounds. - // This is causing few pixels variance when anchors are also scaled with same scale factor but are relative to display rectangle. - // Hence, making change to computing anchor scale factor with respect to change in display rectangle instead of change in the + // In PerMonitorV2 mode applications, when moved from one monitor to the other, Form/Container bounds + // are scaled with scale factor computed with respect to new DPI on the monitor. + // However, scaling ratio between non-client and client area is not linear. + // Window chrome (adorners) are scaled by Windows following their heuristics, + // leaving non client area fit to rest of the bounds. This is causing few pixels variance when anchors + // are also scaled with same scale factor but are relative to display rectangle. Hence, making change to + // computing anchor scale factor with respect to change in display rectangle instead of change in the // bounds (a.k.a: scale factor computed with respect to new DPI). public Rectangle DisplayRectangle; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.cs index feb1eb53a18..e840c5ea1d7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/DefaultLayout.cs @@ -789,7 +789,8 @@ private static void UpdateAnchorInfo(IArrangedElement element) { if (ScaleHelper.IsScalingRequirementMet && (anchorInfo.Bottom - parentHeight > 0) && (oldAnchorInfo.Bottom < 0)) { - // The parent was resized to fit its parent or the screen, we need to reuse the old anchors info to prevent positioning the control beyond the bottom edge. + // The parent was resized to fit its parent or the screen, we need to reuse the old anchors info + // to prevent positioning the control beyond the bottom edge. anchorInfo.Bottom = oldAnchorInfo.Bottom; if (!IsAnchored(anchor, AnchorStyles.Top)) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs index d647a57d00e..bfe06db7dff 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs @@ -517,7 +517,8 @@ private static bool IsCursorPastInsertionPoint(LayoutInfo fixedLayoutInfo, int i return true; } - // if the element is bumped to a column after its specified column position, it also means that the element overlaps with previous controls + // if the element is bumped to a column after its specified column position, it also means that the element + // overlaps with previous controls if (fixedLayoutInfo.RowPosition == insertionRow && fixedLayoutInfo.ColumnPosition < insertionCol) { return true; @@ -532,7 +533,8 @@ private static bool IsCursorPastInsertionPoint(LayoutInfo fixedLayoutInfo, int i /// private static bool IsOverlappingWithReservationGrid(LayoutInfo fixedLayoutInfo, ReservationGrid reservationGrid, int currentRow) { - // since we shall not put anything above our current row, this means that the fixedLayoutInfo overlaps with something already placed on the table + // since we shall not put anything above our current row, this means that the fixedLayoutInfo overlaps + // with something already placed on the table if (fixedLayoutInfo.RowPosition < currentRow) { return true; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs index 06d665dc82b..1121aacd05b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs @@ -475,8 +475,10 @@ public virtual unsafe void CreateHandle(CreateParams cp) #if DEBUG if (OsVersion.IsWindows10_18030rGreater()) { - // In a mixed DPI hosting environment, the DPI settings for child windows can be determined by either the parent window or the thread hosting it, - // based on the window properties and the behavior of the thread. For additional information, please refer to + // In a mixed DPI hosting environment, the DPI settings for child windows can be determined by + // either the parent window or the thread hosting it, + // based on the window properties and the behavior of the thread. For additional information, + // please refer to // https://microsoft.visualstudio.com/OS/_git/os.2020?path=/clientcore/windows/Core/ntuser/kernel/windows/createw.cxx&version=GBofficial/main&line=881&lineEnd=882&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents DPI_AWARENESS_CONTEXT controlHandleDpiContext = PInvoke.GetWindowDpiAwarenessContext(HWND); Debug.Assert(DpiAwarenessContext.IsEquivalent(controlHandleDpiContext), diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.cs index 8b1af3fd674..95441e38688 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DataObject.Composition.cs @@ -34,8 +34,9 @@ internal unsafe partial class Composition : IDataObject, Com.IDataObject.Interfa private readonly ComTypes.IDataObject _runtimeDataObject; // Feature switch, when set to false, BinaryFormatter is not supported in trimmed applications. - // This field, using the default BinaryFormatter switch, is used to control trim warnings related to using BinaryFormatter in WinForms trimming. - // The trimmer will generate a warning when set to true and will not generate a warning when set to false. + // This field, using the default BinaryFormatter switch, is used to control trim warnings related + // to using BinaryFormatter in WinForms trimming. The trimmer will generate a warning when set + // to true and will not generate a warning when set to false. [FeatureSwitchDefinition("System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization")] internal static bool EnableUnsafeBinaryFormatterInNativeObjectSerialization => !AppContext.TryGetSwitch("System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization", out bool isEnabled) || isEnabled; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragEventArgs.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragEventArgs.cs index 36bf0af7eee..2d4ec50f3b5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragEventArgs.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragEventArgs.cs @@ -90,7 +90,8 @@ public DragEventArgs( /// /// /// - /// UI coloring is applied to the text in if used by specifying %1 in . + /// UI coloring is applied to the text in + /// if used by specifying %1 in . /// /// public string? Message { get; set; } @@ -100,7 +101,8 @@ public DragEventArgs( /// /// /// - /// UI coloring is applied to the text in if used by specifying %1 in . + /// UI coloring is applied to the text in + /// if used by specifying %1 in . /// /// public string? MessageReplacementToken { get; set; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolTip/ToolTip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolTip/ToolTip.cs index 162a31432be..498033a45ac 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolTip/ToolTip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolTip/ToolTip.cs @@ -818,8 +818,9 @@ private void SetToolInfo(Control control, string? caption) // 1. TabControl already relays all mouse events to its tooltip: // https://docs.microsoft.com/windows/win32/controls/tab-controls#default-tab-control-message-processing // 2. Hit-testing against TabControl detects only TabPages which are separate tools added by TabControl. - // This prevents a bug when a TabPage tool is placed before the TabControl tool after reordering caused by a tool deletion. - // Also prevents double handling of mouse messages which is caused by subclassing altogether with the message relaying from the TabControl internals. + // This prevents a bug when a TabPage tool is placed before the TabControl tool after reordering caused + // by a tool deletion.Also prevents double handling of mouse messages which is caused by subclassing + // altogether with the message relaying from the TabControl internals. if (control is TabControl) { return; @@ -1504,7 +1505,8 @@ internal void ShowKeyboardToolTip(string? text, IKeyboardToolTip tool, int durat tipInfo.Position = new Point(pointX, pointY); } - // Ensure that the tooltip bubble is moved to the optimal position even when a mouse tooltip is being replaced with a keyboard tooltip. + // Ensure that the tooltip bubble is moved to the optimal position even when a mouse tooltip is being + // replaced with a keyboard tooltip. Reposition(optimalPoint, bubbleSize); } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormatUtilitiesTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormatUtilitiesTests.cs index c80e5c96724..9ef72690926 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormatUtilitiesTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/BinaryFormatUtilitiesTests.cs @@ -33,7 +33,7 @@ private void WriteObjectToStream(object value) => } // Primitive types as defined by the NRBF spec. - // https://learn.Microsoft.com/dotnet/api/system.formats.nrbf.primitivetyperecord + // https://learn.microsoft.com/dotnet/api/system.formats.nrbf.primitivetyperecord public static TheoryData PrimitiveObjects_TheoryData => new() { (byte)1, diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/InputLanguageTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/InputLanguageTests.cs index 4821a9530d6..6dda88231f5 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/InputLanguageTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/InputLanguageTests.cs @@ -147,7 +147,7 @@ public void InputLanguage_FromCulture_SupplementalInputLanguages_Expected(string } // Also installs default keyboard layout for this language - // https://learn.Microsoft.com/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs + // https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs InstallUserLanguage(languageTag); try