Skip to content

Commit 8d205a1

Browse files
committed
Fix-up comments across project files
Format comments to be legible. - Place comment start and end tags on a new line for multi-line comments. - Have space between start and end tags in a single line comment. Place comments where appropriate. - If an entire block is common to the comment then place it above the block. - Only place a comment near or after the block, if it refers exclusively. Sources are not formatted!
1 parent 7e37935 commit 8d205a1

File tree

8 files changed

+45
-61
lines changed

8 files changed

+45
-61
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
<Choose>
5555
<When Condition="'$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true'">
5656
<PropertyGroup>
57-
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
57+
<!-- Declare that the Repository URL can be published to NuSpec -->
5858
<PublishRepositoryUrl>true</PublishRepositoryUrl>
59-
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
59+
<!-- Embed source files that are not tracked by the source control manager to the PDB -->
6060
<EmbedUntrackedSources>true</EmbedUntrackedSources>
61-
<!-- Optional: Include PDB in the built .nupkg -->
61+
<!-- Include PDB in the built .nupkg -->
6262
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
6363
</PropertyGroup>
6464
<ItemGroup>

Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
<Choose>
1818
<When Condition="'$(TargetFramework)' == 'netstandard1.4'">
19+
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
1920
<ItemGroup>
20-
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
2121
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
2222
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
2323
<PackageReference Include="System.Memory" Version="4.5.4" />
2424
</ItemGroup>
2525
</When>
2626

2727
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
28+
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
2829
<ItemGroup>
29-
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
3030
<PackageReference Include="System.Memory" Version="4.5.4" />
3131
</ItemGroup>
3232
</When>
@@ -35,8 +35,8 @@
3535
<PropertyGroup>
3636
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
3737
</PropertyGroup>
38+
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
3839
<ItemGroup>
39-
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
4040
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
4141
</ItemGroup>
4242
</When>

Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@
2727

2828
<Choose>
2929
<When Condition="'$(TargetFramework)' == 'netstandard1.4'">
30+
<!--
31+
.NET Standard 1.4 lacks the [Pure] attribute, the Rectangle primitive,
32+
the Span<T> and Memory<T> types, the Vector<T> primitive and related APIs,
33+
ValueTask and ValueTask<T>, the Parallel class and the Unsafe class.
34+
We also need to reference the System.Runtime.CompilerServices.Unsafe package directly,
35+
even though System.Memory references it already, as we need a more recent version than
36+
the one bundled with it. This is so that we can use the Unsafe.Unbox<T> method,
37+
which is used by the Box<T> type in the package.
38+
-->
3039
<ItemGroup>
31-
<!-- .NET Standard 1.4 lacks the [Pure] attribute, the Rectangle primitive,
32-
the Span<T> and Memory<T> types, the Vector<T> primitive and related APIs,
33-
ValueTask and ValueTask<T>, the Parallel class and the Unsafe class.
34-
We also need to reference the System.Runtime.CompilerServices.Unsafe package directly,
35-
even though System.Memory references it already, as we need a more recent version than
36-
the one bundled with it. This is so that we can use the Unsafe.Unbox<T> method,
37-
which is used by the Box<T> type in the package. -->
3840
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
3941
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
4042
<PackageReference Include="System.Memory" Version="4.5.4" />
@@ -46,8 +48,8 @@
4648
</When>
4749

4850
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
51+
<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->
4952
<ItemGroup>
50-
<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->
5153
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
5254
<PackageReference Include="System.Memory" Version="4.5.4" />
5355
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
@@ -56,21 +58,23 @@
5658
</When>
5759

5860
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
61+
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
5962
<ItemGroup>
60-
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
6163
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
6264
</ItemGroup>
6365
<PropertyGroup>
64-
<!-- NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET Core 3.1.
65-
This is needed because .NET Core 3.1 will be a separate package than .NET Standard 2.1. -->
66+
<!--
67+
NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET Core 3.1.
68+
This is needed because .NET Core 3.1 will be a separate package than .NET Standard 2.1.
6669
67-
<!-- SPAN_RUNTIME_SUPPORT: define a constant to indicate runtimes with runtime support for
68-
the fast Span<T> type, as well as some overloads with Span<T> parameters (eg. Stream.Write).
69-
In particular, these are runtimes which are able to create Span<T> instances from just
70-
a managed reference, which can be used to slice arbitrary objects not technically supported.
71-
This API (MemoryMarshal.CreateSpan) is not part of .NET Standard 2.0, but it is still
72-
available on .NET Core 2.1. So by using this constant, we can make sure to expose those
73-
APIs relying on that method on all target frameworks that are able to support them. -->
70+
SPAN_RUNTIME_SUPPORT: define a constant to indicate runtimes with runtime support for
71+
the fast Span<T> type, as well as some overloads with Span<T> parameters (eg. Stream.Write).
72+
In particular, these are runtimes which are able to create Span<T> instances from just
73+
a managed reference, which can be used to slice arbitrary objects not technically supported.
74+
This API (MemoryMarshal.CreateSpan) is not part of .NET Standard 2.0, but it is still
75+
available on .NET Core 2.1. So by using this constant, we can make sure to expose those
76+
APIs relying on that method on all target frameworks that are able to support them.
77+
-->
7478
<DefineConstants>NETSTANDARD2_1_OR_GREATER;SPAN_RUNTIME_SUPPORT</DefineConstants>
7579
</PropertyGroup>
7680
</When>
@@ -85,14 +89,16 @@
8589
<ItemGroup>
8690
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
8791
</ItemGroup>
92+
<!--
93+
NETCORE_RUNTIME: to avoid issues with APIs that assume a specific memory layout, we define a
94+
.NET Core runtime constant to indicate either .NET Core 2.1 or .NET Core 3.1. These are
95+
runtimes with the same overall memory layout for objects (in particular: strings, SZ arrays,
96+
and ND arrays). We can use this constant to make sure that APIs that are exclusively available
97+
for .NET Standard targets do not make any assumtpion of any internals of the runtime being
98+
actually used by the consumers. .NET 5.0 would fall into this category as well, but we don't
99+
need to include that target as it offers APIs that don't require runtime-based workarounds.
100+
-->
88101
<PropertyGroup>
89-
<!-- NETCORE_RUNTIME: to avoid issues with APIs that assume a specific memory layout, we define a
90-
.NET Core runtime constant to indicate either .NET Core 2.1 or .NET Core 3.1. These are
91-
runtimes with the same overall memory layout for objects (in particular: strings, SZ arrays,
92-
and ND arrays). We can use this constant to make sure that APIs that are exclusively available
93-
for .NET Standard targets do not make any assumtpion of any internals of the runtime being
94-
actually used by the consumers. .NET 5.0 would fall into this category as well, but we don't
95-
need to include that target as it offers APIs that don't require runtime-based workarounds.-->
96102
<DefineConstants>NETSTANDARD2_1_OR_GREATER;SPAN_RUNTIME_SUPPORT;NETCORE_RUNTIME</DefineConstants>
97103
</PropertyGroup>
98104
</When>

Microsoft.Toolkit.Uwp.Connectivity/Properties/Microsoft.Toolkit.Uwp.Connectivity.rd.xml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
<!--
2-
This file contains Runtime Directives, specifications about types your application accesses
3-
through reflection and other dynamic code patterns. Runtime Directives are used to control the
4-
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
5-
library does not do any reflection, then you generally do not need to edit this file. However,
6-
if your library reflects over types, especially types passed to it or derived from its types,
7-
then you should write Runtime Directives.
8-
9-
The most common use of reflection in libraries is to discover information about types passed
10-
to the library. Runtime Directives have three ways to express requirements on types passed to
11-
your library.
12-
13-
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
14-
Use these directives to reflect over types passed as a parameter.
15-
16-
2. SubTypes
17-
Use a SubTypes directive to reflect over types derived from another type.
18-
19-
3. AttributeImplies
20-
Use an AttributeImplies directive to indicate that your library needs to reflect over
21-
types or methods decorated with an attribute.
22-
23-
For more information on writing Runtime Directives for libraries, please visit
24-
https://go.microsoft.com/fwlink/?LinkID=391919
25-
-->
261
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
272
<Library Name="Microsoft.Toolkit.Uwp.Connectivity">
283
<!-- add directives for your library here -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
22
<Library Name="Microsoft.Toolkit.Uwp.DeveloperTools">
3+
<!-- add directives for your library here -->
34
</Library>
45
</Directives>

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@
7070
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
7171
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
7272

73-
<!-- Need to override the built-in implicit defines for UAP or it'll be NETCORE5_0 -->
74-
<!-- this makes it UAP10_0_10240_0 to match the rest -->
73+
<!-- Need to override the built-in implicit defines for UAP or it'll be NETCORE5_0. This makes it UAP10_0_10240_0 to match the rest -->
7574
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>
7675
<DisableImplicitFrameworkDefines Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">true</DisableImplicitFrameworkDefines>
7776
</PropertyGroup>
7877

79-
<!--Set the nuspec properties. Dependent on version which isn't updated till after GetBuildVersion. Condition ensures we only set once since this runs multiple times for each target.-->
78+
<!-- Set the nuspec properties. Dependent on version which isn't updated till after 'GetBuildVersion'. Condition ensures we only set once since this runs multiple times for each target. -->
8079
<Target Name="SetNuspecProperties" AfterTargets="GetBuildVersion">
8180
<PropertyGroup Condition="'$(NuspecProperties)' == ''">
8281
<NuspecProperties>buildOutput=bin\$(Configuration);version=$(Version)</NuspecProperties>

Microsoft.Toolkit.Uwp.Notifications/Properties/Microsoft.Toolkit.Uwp.Notifications.rd.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
-->
66
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
77
<Library Name="Microsoft.Toolkit.Uwp.Notifications">
8-
<!-- TODO: We can potentially minimize the metadata needed, but further
9-
investigation is needed to fill this in and adequately test this -->
8+
<!--
9+
TODO: We can potentially minimize the metadata needed,
10+
but further investigation is needed to fill this in and adequately test this.
11+
-->
1012
<Assembly Name="Microsoft.Toolkit.Uwp.Notifications" Dynamic="Required All" />
1113
</Library>
1214
</Directives>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
22
<Library Name="Microsoft.Toolkit.Uwp.UI.Behaviors">
3+
<!-- add directives for your library here -->
34
</Library>
45
</Directives>

0 commit comments

Comments
 (0)