Skip to content

Commit 8c6cf10

Browse files
committed
doc: Install DocumentationAnalyzers and address warnings
As discussed in #1489 (comment)
1 parent b3850ab commit 8c6cf10

File tree

64 files changed

+123
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+123
-151
lines changed

eng/CodeStyle.targets

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" Visible="false" />
1313
</ItemGroup>
1414

15+
<ItemGroup>
16+
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
17+
</ItemGroup>
18+
1519
</Project>

src/System.Windows.Forms.Design.Editors/src/System/ComponentModel/Design/CollectionEditor.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,8 @@ public SelectionWrapper(Type collectionType, Type collectionItemType, Control co
18911891
public override Type PropertyType { get; }
18921892

18931893
/// <summary>
1894-
/// When overridden in a derived class, indicates whether resetting the <paramref name="component "/>will change the value of the <paramref name="component"/>.
1894+
/// When overridden in a derived class, indicates whether resetting the <paramref name="component"/>
1895+
/// will change the value of the <paramref name="component"/>.
18951896
/// </summary>
18961897
public override bool CanResetValue(object component) => false;
18971898

src/System.Windows.Forms.Design/src/System/ComponentModel/Design/LoadedEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.ComponentModel.Design
66
{
77
/// <summary>
8-
/// Represents the method that will handle a Loaded event.
8+
/// Represents a method that will handle a <see cref="DesignSurface.Loaded"/> event.
99
/// </summary>
1010
public delegate void LoadedEventHandler(object sender, LoadedEventArgs e);
1111
}

src/System.Windows.Forms.Design/src/System/Drawing/Design/ToolboxComponentsCreatedEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Drawing.Design
66
{
77
/// <summary>
8-
/// Represents the method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreated'/> event.
8+
/// Represents a method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreated'/> event.
99
/// </summary>
1010
public delegate void ToolboxComponentsCreatedEventHandler(object sender, ToolboxComponentsCreatedEventArgs e);
1111
}

src/System.Windows.Forms.Design/src/System/Drawing/Design/ToolboxComponentsCreatingEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Drawing.Design
66
{
77
/// <summary>
8-
/// Represents the method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreating'/> event.
8+
/// Represents a method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreating'/> event.
99
/// </summary>
1010
public delegate void ToolboxComponentsCreatingEventHandler(object sender, ToolboxComponentsCreatingEventArgs e);
1111
}

src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ContainerSelectorActiveEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Windows.Forms.Design
66
{
77
/// <summary>
8-
/// Represents the method that will handle a ContainerSelectorActive event.
8+
/// Represents a method that will handle a <see cref="ISelectionUIService.ContainerSelectorActive"/> event.
99
/// </summary>
1010
internal delegate void ContainerSelectorActiveEventHandler(object sender, ContainerSelectorActiveEventArgs e);
1111
}

src/System.Windows.Forms/src/System/Drawing/Design/PropertyValueUIItemInvokeHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace System.Drawing.Design
88
{
99
/// <summary>
10-
/// Represents the method that will handle the event raised when an icon in the properties window associated with a <see cref='PropertyValueUIItem'/> is double-clicked.
10+
/// Represents a method that will handle the event raised when an icon in the properties window associated with a <see cref='PropertyValueUIItem'/> is double-clicked.
1111
/// </summary>
1212
/// <param name="context">The <see cref="ITypeDescriptorContext" /> for the property associated with the icon that was double-clicked. </param>
1313
/// <param name="descriptor">The property associated with the icon that was double-clicked. </param>

src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs

+5-12
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,21 @@ public class AccessibleObject : StandardOleMarshalObject,
4444
UnsafeNativeMethods.IScrollItemProvider
4545
{
4646
/// <summary>
47-
/// Specifies the <see langword='IAccessible '/>interface used by this
48-
/// <see cref='AccessibleObject'/>.
47+
/// Specifies the <see cref='IAccessible'/> interface used by this <see cref='AccessibleObject'/>.
4948
/// </summary>
5049
private IAccessible systemIAccessible = null;
5150

5251
/// <summary>
53-
/// Specifies the <see cref='NativeMethods.IEnumVariant'/> used by this
54-
/// <see cref='AccessibleObject'/> .
52+
/// Specifies the <see cref='NativeMethods.IEnumVariant'/> used by this <see cref='AccessibleObject'/>.
5553
/// </summary>
5654
private UnsafeNativeMethods.IEnumVariant systemIEnumVariant = null;
5755
private UnsafeNativeMethods.IEnumVariant enumVariant = null;
5856

5957
// IOleWindow interface of the 'inner' system IAccessible object that we are wrapping
6058
private UnsafeNativeMethods.IOleWindow systemIOleWindow = null;
6159

62-
private readonly bool systemWrapper = false; // Indicates this object is being used ONLY to wrap a system IAccessible
63-
64-
private int accObjId = NativeMethods.OBJID_CLIENT; // Indicates what kind of 'inner' system accessible object we are using
60+
// Indicates this object is being used ONLY to wrap a system IAccessible
61+
private readonly bool systemWrapper = false;
6562

6663
// The support for the UIA Notification event begins in RS3.
6764
// Assume the UIA Notification event is available until we learn otherwise.
@@ -2061,11 +2058,7 @@ private IAccessible AsIAccessible(AccessibleObject obj)
20612058
/// for a *user-defined* accessible object, that has NO inner object, its important that the id is
20622059
/// left as OBJID_CLIENT, otherwise the object will be short-circuited into a total NOP!
20632060
/// </summary>
2064-
internal int AccessibleObjectId
2065-
{
2066-
get => accObjId;
2067-
set => accObjId = value;
2068-
}
2061+
internal int AccessibleObjectId { get; set; } = NativeMethods.OBJID_CLIENT;
20692062

20702063
/// <summary>
20712064
/// Indicates whether this accessible object represents the client area of

src/System.Windows.Forms/src/System/Windows/Forms/AccessibleStates.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ public enum AccessibleStates
168168
/// selected, the objects are removed from the selection. If the anchor
169169
/// object is selected, the selection is extended to include this object
170170
/// and all the objects in between. You can set the selection state by
171-
/// combining this flag with <see cref='AccessibleSelection.AddSelection '/>
171+
/// combining this flag with <see cref='AccessibleSelection.AddSelection'/>
172172
/// or <see cref='AccessibleSelection.RemoveSelection'/>. This flag does
173173
/// not change the focus or the selection anchor unless it is combined with
174174
/// <see cref='AccessibleSelection.TakeFocus'/>. The behavior of
175-
/// <see cref='AccessibleStates.ExtendSelection'/>|<see cref='AccessibleSelection.TakeFocus '/>
175+
/// <see cref='AccessibleStates.ExtendSelection'/>|<see cref='AccessibleSelection.TakeFocus'/>
176176
/// is equivalent to adding an item to a selection manually by holding down
177177
/// the SHIFT key and clicking an unselected object.
178178
/// This flag may not be combined with <see cref='AccessibleSelection.TakeSelection'/>.

src/System.Windows.Forms/src/System/Windows/Forms/Application.cs

+9-12
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
namespace System.Windows.Forms
2323
{
2424
/// <summary>
25-
/// Provides <see langword='static '/>
26-
/// methods and properties
27-
/// to manage an application, such as methods to run and quit an application,
28-
/// to process Windows messages, and properties to get information about an application. This
29-
/// class cannot be inherited.
25+
/// Provides <see langword='static'/> methods and properties to manage an application, such as methods to run and quit an application,
26+
/// to process Windows messages, and properties to get information about an application.
27+
/// This class cannot be inherited.
3028
/// </summary>
3129
public sealed class Application
3230
{
@@ -42,7 +40,6 @@ public sealed class Application
4240
static string productName;
4341
static string productVersion;
4442
static string safeTopLevelCaptionSuffix;
45-
private static bool s_useVisualStyles = false;
4643
static bool comCtlSupportsVisualStylesInitialized = false;
4744
static bool comCtlSupportsVisualStyles = false;
4845
private static FormCollection s_forms = null;
@@ -118,7 +115,7 @@ internal static bool ComCtlSupportsVisualStyles
118115

119116
private static bool InitializeComCtlSupportsVisualStyles()
120117
{
121-
if (s_useVisualStyles)
118+
if (UseVisualStyles)
122119
{
123120
// At this point, we may not have loaded ComCtl6 yet, but it will eventually be loaded,
124121
// so we return true here. This works because UseVisualStyles, once set, cannot be
@@ -672,7 +669,7 @@ public static RegistryKey UserAppDataRegistry
672669
}
673670
}
674671

675-
public static bool UseVisualStyles => s_useVisualStyles;
672+
public static bool UseVisualStyles { get; private set; } = false;
676673

677674
/// <remarks>
678675
/// Don't never ever change this name, since the window class and partner teams
@@ -960,7 +957,7 @@ internal static void DoEventsModal()
960957
}
961958

962959
/// <summary>
963-
/// Enables visual styles for all subsequent Application.Run() and CreateHandle() calls.
960+
/// Enables visual styles for all subsequent <see cref="Application.Run"/> and <see cref="CreateHandle"/> calls.
964961
/// Uses the default theming manifest file shipped with the redist.
965962
/// </summary>
966963
public static void EnableVisualStyles()
@@ -970,8 +967,8 @@ public static void EnableVisualStyles()
970967
if (assemblyLoc != null)
971968
{
972969
// CSC embeds DLL manifests as resource ID 2
973-
s_useVisualStyles = UnsafeNativeMethods.ThemingScope.CreateActivationContext(assemblyLoc, nativeResourceManifestID: 2);
974-
Debug.Assert(s_useVisualStyles, "Enable Visual Styles failed");
970+
UseVisualStyles = UnsafeNativeMethods.ThemingScope.CreateActivationContext(assemblyLoc, nativeResourceManifestID: 2);
971+
Debug.Assert(UseVisualStyles, "Enable Visual Styles failed");
975972
}
976973
}
977974

@@ -3217,7 +3214,7 @@ internal void RunMessageLoop(int reason, ApplicationContext context)
32173214
// that might create a window.
32183215

32193216
IntPtr userCookie = IntPtr.Zero;
3220-
if (s_useVisualStyles)
3217+
if (UseVisualStyles)
32213218
{
32223219
userCookie = UnsafeNativeMethods.ThemingScope.Activate();
32233220
}

src/System.Windows.Forms/src/System/Windows/Forms/BoundsSpecified.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public enum BoundsSpecified
3232
Height = 0x8,
3333

3434
/// <summary>
35-
/// Both <see langword='X'/> and <see langword='Y'/> coordinates of the
35+
/// Both <see cref='X'/> and <see cref='Y'/> coordinates of the
3636
/// control are defined.
3737
/// </summary>
3838
Location = X | Y,

src/System.Windows.Forms/src/System/Windows/Forms/CacheVirtualItemsEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Windows.Forms
66
{
77
/// <summary>
8-
/// Represents the method that will handle the CacheVirtualItems event of a ListView.
8+
/// Represents a method that will handle the <see cref="ListView.CacheVirtualItems"/> event of a <see cref="ListView"/>.
99
/// </summary>
1010
public delegate void CacheVirtualItemsEventHandler(object sender, CacheVirtualItemsEventArgs e);
1111
}

src/System.Windows.Forms/src/System/Windows/Forms/ColumnClickEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Windows.Forms
66
{
77
/// <summary>
8-
/// Represents the method that will handle the the <see cref='ListView.OnColumnClick'/>
8+
/// Represents a method that will handle the the <see cref='ListView.OnColumnClick'/>
99
/// event of a <see cref='ListView'/>
1010
/// </summary>
1111
public delegate void ColumnClickEventHandler(object sender, ColumnClickEventArgs e);

src/System.Windows.Forms/src/System/Windows/Forms/ContentsResizedEventHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Windows.Forms
66
{
77
/// <summary>
8-
/// Represents the method that will handle the <see cref='RichTextBox.ContentsResized'/>
8+
/// Represents a method that will handle the <see cref='RichTextBox.ContentsResized'/>
99
/// event of a <see cref='RichTextBox'/>.
1010
/// </summary>
1111
public delegate void ContentsResizedEventHandler(object sender, ContentsResizedEventArgs e);

src/System.Windows.Forms/src/System/Windows/Forms/DataFormats.cs

+24-24
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,38 @@ namespace System.Windows.Forms
1010
{
1111
/// <summary>
1212
/// Translates between WinForms text-based <see cref='Clipboard'/>
13-
/// formats and <see langword='Microsoft.Win32'/> 32-bit signed integer-based clipboard
14-
/// formats. Provides <see langword='static '/> methods to create new
13+
/// formats and Win32 32-bit signed integer-based clipboard
14+
/// formats. Provides <see langword='static'/> methods to create new
1515
/// <see cref='Clipboard'/> formats and add them to the Windows Registry.
1616
/// </summary>
1717
public static class DataFormats
1818
{
1919
/// <summary>
20-
/// Specifies the standard ANSI text format. This <see langword='static '/>
20+
/// Specifies the standard ANSI text format. This <see langword='static'/>
2121
/// field is read-only.
2222
/// </summary>
2323
public static readonly string Text = "Text";
2424

2525
/// <summary>
2626
/// Specifies the standard Windows Unicode text format.
27-
/// This <see langword='static '/> field is read-only.
27+
/// This <see langword='static'/> field is read-only.
2828
/// </summary>
2929
public static readonly string UnicodeText = "UnicodeText";
3030

3131
/// <summary>
3232
/// Specifies the Windows Device Independent Bitmap (DIB) format.
33-
/// This <see langword='static '/> field is read-only.
33+
/// This <see langword='static'/> field is read-only.
3434
/// </summary>
3535
public static readonly string Dib = "DeviceIndependentBitmap";
3636

3737
/// <summary>
3838
/// Specifies a Windows bitmap format.
39-
/// This <see langword='static '/> field is read-only. </summary>
39+
/// This <see langword='static'/> field is read-only. </summary>
4040
public static readonly string Bitmap = "Bitmap";
4141

4242
/// <summary>
4343
/// Specifies the Windows enhanced metafile format.
44-
/// This <see langword='static '/> field is read-only.
44+
/// This <see langword='static'/> field is read-only.
4545
/// </summary>
4646
public static readonly string EnhancedMetafile = "EnhancedMetafile";
4747

@@ -53,95 +53,95 @@ public static class DataFormats
5353

5454
/// <summary>
5555
/// Specifies the Windows symbolic link format, which WinForms does not directly use.
56-
/// This <see langword='static '/> field is read-only.
56+
/// This <see langword='static'/> field is read-only.
5757
/// </summary>
5858
public static readonly string SymbolicLink = "SymbolicLink";
5959

6060
/// <summary>
6161
/// Specifies the Windows data interchange format, which WinForms does not directly use.
62-
/// This <see langword='static '/> field is read-only.
62+
/// This <see langword='static'/> field is read-only.
6363
/// </summary>
6464
public static readonly string Dif = "DataInterchangeFormat";
6565

6666
/// <summary>
6767
/// Specifies the Tagged Image File Format (TIFF), which WinForms does not directly use.
68-
/// This <see langword='static '/> field is read-only.
68+
/// This <see langword='static'/> field is read-only.
6969
/// </summary>
7070
public static readonly string Tiff = "TaggedImageFileFormat";
7171

7272
/// <summary>
7373
/// Specifies the standard Windows original equipment manufacturer (OEM) text format.
74-
/// This <see langword='static '/> field is read-only.
74+
/// This <see langword='static'/> field is read-only.
7575
/// </summary>
7676
public static readonly string OemText = "OEMText";
7777

7878
/// <summary>
7979
/// Specifies the Windows palette format.
80-
/// This <see langword='static '/> field is read-only.
80+
/// This <see langword='static'/> field is read-only.
8181
/// </summary>
8282
public static readonly string Palette = "Palette";
8383

8484
/// <summary>
8585
/// Specifies the Windows pen data format, which consists of pen strokes for handwriting
8686
/// software; Win Formsdoes not use this format.
87-
/// This <see langword='static '/> field is read-only.
87+
/// This <see langword='static'/> field is read-only.
8888
/// </summary>
8989
public static readonly string PenData = "PenData";
9090

9191
/// <summary>
9292
/// Specifies the Resource Interchange File Format (RIFF) audio format, which WinForms
9393
/// does not directly use.
94-
/// This <see langword='static '/> field is read-only.
94+
/// This <see langword='static'/> field is read-only.
9595
/// </summary>
9696
public static readonly string Riff = "RiffAudio";
9797

9898
/// <summary>
9999
/// Specifies the wave audio format, which Win Forms does not
100-
/// directly use. This <see langword='static '/> field is read-only.
100+
/// directly use. This <see langword='static'/> field is read-only.
101101
/// </summary>
102102
public static readonly string WaveAudio = "WaveAudio";
103103

104104
/// <summary>
105105
/// Specifies the Windows file drop format, which WinForms does not directly use.
106-
/// This <see langword='static '/> field is read-only.
106+
/// This <see langword='static'/> field is read-only.
107107
/// </summary>
108108
public static readonly string FileDrop = "FileDrop";
109109

110110
/// <summary>
111111
/// Specifies the Windows culture format, which WinForms does not directly use.
112-
/// This <see langword='static '/> field is read-only.
112+
/// This <see langword='static'/> field is read-only.
113113
/// </summary>
114114
public static readonly string Locale = "Locale";
115115

116116
/// <summary>
117117
/// Specifies text consisting of HTML data.
118-
/// This <see langword='static '/> field is read-only.
118+
/// This <see langword='static'/> field is read-only.
119119
/// </summary>
120120
public static readonly string Html = "HTML Format";
121121

122122
/// <summary>
123123
/// Specifies text consisting of Rich Text Format (RTF) data.
124-
/// This <see langword='static '/> field is read-only.
124+
/// This <see langword='static'/> field is read-only.
125125
/// </summary>
126126
public static readonly string Rtf = "Rich Text Format";
127127

128128
/// <summary>
129129
/// Specifies a comma-separated value (CSV) format, which is a common interchange format
130130
/// used by spreadsheets. This format is not used directly by WinForms.
131-
/// This <see langword='static '/> field is read-only.
131+
/// This <see langword='static'/> field is read-only.
132132
/// </summary>
133133
public static readonly string CommaSeparatedValue = "Csv";
134134

135135
/// <summary>
136136
/// Specifies the Win Forms string class format, which WinForms uses to store string
137137
/// objects.
138-
/// This <see langword='static '/> field is read-only.
138+
/// This <see langword='static'/> field is read-only.
139139
/// </summary>
140140
public static readonly string StringFormat = typeof(string).FullName;
141141

142142
/// <summary>
143143
/// Specifies a format that encapsulates any type of WinForms object.
144-
/// This <see langword='static '/> field is read-only.
144+
/// This <see langword='static'/> field is read-only.
145145
/// </summary>
146146
public static readonly string Serializable = Application.WindowsFormsVersion + "PersistentObject";
147147

@@ -292,8 +292,8 @@ private static void EnsurePredefined()
292292
public class Format
293293
{
294294
/// <summary>
295-
/// Initializes a new instance of the <see cref='Format'/>
296-
/// class and specifies whether a <see langword='Win32 '/> handle is expected with this format.
295+
/// Initializes a new instance of the <see cref='Format'/> class and
296+
/// specifies whether a Win32 handle is expected with this format.
297297
/// </summary>
298298
public Format(string name, int id)
299299
{

0 commit comments

Comments
 (0)