Skip to content

Commit

Permalink
doc: Install DocumentationAnalyzers and address warnings
Browse files Browse the repository at this point in the history
As discussed in #1489 (comment)
  • Loading branch information
RussKie committed Aug 15, 2019
1 parent d989476 commit 24a6e80
Show file tree
Hide file tree
Showing 64 changed files with 123 additions and 151 deletions.
4 changes: 4 additions & 0 deletions eng/CodeStyle.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,8 @@ public SelectionWrapper(Type collectionType, Type collectionItemType, Control co
public override Type PropertyType { get; }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.ComponentModel.Design
{
/// <summary>
/// Represents the method that will handle a Loaded event.
/// Represents a method that will handle a <see cref="DesignSurface.Loaded"/> event.
/// </summary>
public delegate void LoadedEventHandler(object sender, LoadedEventArgs e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Drawing.Design
{
/// <summary>
/// Represents the method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreated'/> event.
/// Represents a method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreated'/> event.
/// </summary>
public delegate void ToolboxComponentsCreatedEventHandler(object sender, ToolboxComponentsCreatedEventArgs e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Drawing.Design
{
/// <summary>
/// Represents the method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreating'/> event.
/// Represents a method that will handle the <see cref='System.Drawing.Design.ToolboxItem.ComponentsCreating'/> event.
/// </summary>
public delegate void ToolboxComponentsCreatingEventHandler(object sender, ToolboxComponentsCreatingEventArgs e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Windows.Forms.Design
{
/// <summary>
/// Represents the method that will handle a ContainerSelectorActive event.
/// Represents a method that will handle a <see cref="ISelectionUIService.ContainerSelectorActive"/> event.
/// </summary>
internal delegate void ContainerSelectorActiveEventHandler(object sender, ContainerSelectorActiveEventArgs e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace System.Drawing.Design
{
/// <summary>
/// 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.
/// 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.
/// </summary>
/// <param name="context">The <see cref="ITypeDescriptorContext" /> for the property associated with the icon that was double-clicked. </param>
/// <param name="descriptor">The property associated with the icon that was double-clicked. </param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,21 @@ public class AccessibleObject : StandardOleMarshalObject,
UnsafeNativeMethods.IScrollItemProvider
{
/// <summary>
/// Specifies the <see langword='IAccessible '/>interface used by this
/// <see cref='AccessibleObject'/>.
/// Specifies the <see cref='IAccessible'/> interface used by this <see cref='AccessibleObject'/>.
/// </summary>
private IAccessible systemIAccessible = null;

/// <summary>
/// Specifies the <see cref='NativeMethods.IEnumVariant'/> used by this
/// <see cref='AccessibleObject'/> .
/// Specifies the <see cref='NativeMethods.IEnumVariant'/> used by this <see cref='AccessibleObject'/>.
/// </summary>
private UnsafeNativeMethods.IEnumVariant systemIEnumVariant = null;
private UnsafeNativeMethods.IEnumVariant enumVariant = null;

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

private readonly bool systemWrapper = false; // Indicates this object is being used ONLY to wrap a system IAccessible

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

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

/// <summary>
/// Indicates whether this accessible object represents the client area of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ public enum AccessibleStates
/// selected, the objects are removed from the selection. If the anchor
/// object is selected, the selection is extended to include this object
/// and all the objects in between. You can set the selection state by
/// combining this flag with <see cref='AccessibleSelection.AddSelection '/>
/// combining this flag with <see cref='AccessibleSelection.AddSelection'/>
/// or <see cref='AccessibleSelection.RemoveSelection'/>. This flag does
/// not change the focus or the selection anchor unless it is combined with
/// <see cref='AccessibleSelection.TakeFocus'/>. The behavior of
/// <see cref='AccessibleStates.ExtendSelection'/>|<see cref='AccessibleSelection.TakeFocus '/>
/// <see cref='AccessibleStates.ExtendSelection'/>|<see cref='AccessibleSelection.TakeFocus'/>
/// is equivalent to adding an item to a selection manually by holding down
/// the SHIFT key and clicking an unselected object.
/// This flag may not be combined with <see cref='AccessibleSelection.TakeSelection'/>.
Expand Down
21 changes: 9 additions & 12 deletions src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
namespace System.Windows.Forms
{
/// <summary>
/// Provides <see langword='static '/>
/// methods and properties
/// to manage an application, such as methods to run and quit an application,
/// to process Windows messages, and properties to get information about an application. This
/// class cannot be inherited.
/// Provides <see langword='static'/> methods and properties to manage an application, such as methods to run and quit an application,
/// to process Windows messages, and properties to get information about an application.
/// This class cannot be inherited.
/// </summary>
public sealed class Application
{
Expand All @@ -42,7 +40,6 @@ public sealed class Application
static string productName;
static string productVersion;
static string safeTopLevelCaptionSuffix;
private static bool s_useVisualStyles = false;
static bool comCtlSupportsVisualStylesInitialized = false;
static bool comCtlSupportsVisualStyles = false;
private static FormCollection s_forms = null;
Expand Down Expand Up @@ -118,7 +115,7 @@ internal static bool ComCtlSupportsVisualStyles

private static bool InitializeComCtlSupportsVisualStyles()
{
if (s_useVisualStyles)
if (UseVisualStyles)
{
// At this point, we may not have loaded ComCtl6 yet, but it will eventually be loaded,
// so we return true here. This works because UseVisualStyles, once set, cannot be
Expand Down Expand Up @@ -672,7 +669,7 @@ public static RegistryKey UserAppDataRegistry
}
}

public static bool UseVisualStyles => s_useVisualStyles;
public static bool UseVisualStyles { get; private set; } = false;

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

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

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

IntPtr userCookie = IntPtr.Zero;
if (s_useVisualStyles)
if (UseVisualStyles)
{
userCookie = UnsafeNativeMethods.ThemingScope.Activate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum BoundsSpecified
Height = 0x8,

/// <summary>
/// Both <see langword='X'/> and <see langword='Y'/> coordinates of the
/// Both <see cref='X'/> and <see cref='Y'/> coordinates of the
/// control are defined.
/// </summary>
Location = X | Y,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Windows.Forms
{
/// <summary>
/// Represents the method that will handle the CacheVirtualItems event of a ListView.
/// Represents a method that will handle the <see cref="ListView.CacheVirtualItems"/> event of a <see cref="ListView"/>.
/// </summary>
public delegate void CacheVirtualItemsEventHandler(object sender, CacheVirtualItemsEventArgs e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Windows.Forms
{
/// <summary>
/// Represents the method that will handle the the <see cref='ListView.OnColumnClick'/>
/// Represents a method that will handle the the <see cref='ListView.OnColumnClick'/>
/// event of a <see cref='ListView'/>
/// </summary>
public delegate void ColumnClickEventHandler(object sender, ColumnClickEventArgs e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.Windows.Forms
{
/// <summary>
/// Represents the method that will handle the <see cref='RichTextBox.ContentsResized'/>
/// Represents a method that will handle the <see cref='RichTextBox.ContentsResized'/>
/// event of a <see cref='RichTextBox'/>.
/// </summary>
public delegate void ContentsResizedEventHandler(object sender, ContentsResizedEventArgs e);
Expand Down
48 changes: 24 additions & 24 deletions src/System.Windows.Forms/src/System/Windows/Forms/DataFormats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,38 @@ namespace System.Windows.Forms
{
/// <summary>
/// Translates between WinForms text-based <see cref='Clipboard'/>
/// formats and <see langword='Microsoft.Win32'/> 32-bit signed integer-based clipboard
/// formats. Provides <see langword='static '/> methods to create new
/// formats and Win32 32-bit signed integer-based clipboard
/// formats. Provides <see langword='static'/> methods to create new
/// <see cref='Clipboard'/> formats and add them to the Windows Registry.
/// </summary>
public static class DataFormats
{
/// <summary>
/// Specifies the standard ANSI text format. This <see langword='static '/>
/// Specifies the standard ANSI text format. This <see langword='static'/>
/// field is read-only.
/// </summary>
public static readonly string Text = "Text";

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

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

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

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

Expand All @@ -53,95 +53,95 @@ public static class DataFormats

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

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

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

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

/// <summary>
/// Specifies the Windows palette format.
/// This <see langword='static '/> field is read-only.
/// This <see langword='static'/> field is read-only.
/// </summary>
public static readonly string Palette = "Palette";

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

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -292,8 +292,8 @@ private static void EnsurePredefined()
public class Format
{
/// <summary>
/// Initializes a new instance of the <see cref='Format'/>
/// class and specifies whether a <see langword='Win32 '/> handle is expected with this format.
/// Initializes a new instance of the <see cref='Format'/> class and
/// specifies whether a Win32 handle is expected with this format.
/// </summary>
public Format(string name, int id)
{
Expand Down
Loading

0 comments on commit 24a6e80

Please sign in to comment.