Skip to content

Commit a13d0ac

Browse files
Merge branch 'master' into mhawker/InfiniteCanvas-TemplatedParts
2 parents 8272585 + 3a9b082 commit a13d0ac

File tree

65 files changed

+844
-1777
lines changed

Some content is hidden

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

65 files changed

+844
-1777
lines changed

.editorconfig

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,87 @@ dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style
236236
dotnet_naming_style.prefix_private_field_with_underscore.capitalization = camel_case
237237
dotnet_naming_style.prefix_private_field_with_underscore.required_prefix = _
238238

239+
# Code files
240+
[*.{cs,vb}]
241+
242+
# Migrate back from old Toolkit.ruleset
243+
dotnet_diagnostic.CA1001.severity = warning
244+
dotnet_diagnostic.CA1009.severity = warning
245+
dotnet_diagnostic.CA1016.severity = warning
246+
dotnet_diagnostic.CA1033.severity = warning
247+
dotnet_diagnostic.CA1049.severity = warning
248+
dotnet_diagnostic.CA1060.severity = warning
249+
dotnet_diagnostic.CA1061.severity = warning
250+
dotnet_diagnostic.CA1063.severity = warning
251+
dotnet_diagnostic.CA1065.severity = warning
252+
dotnet_diagnostic.CA1301.severity = warning
253+
dotnet_diagnostic.CA1400.severity = warning
254+
dotnet_diagnostic.CA1401.severity = warning
255+
dotnet_diagnostic.CA1403.severity = warning
256+
dotnet_diagnostic.CA1404.severity = warning
257+
dotnet_diagnostic.CA1405.severity = warning
258+
dotnet_diagnostic.CA1410.severity = warning
259+
dotnet_diagnostic.CA1415.severity = warning
260+
dotnet_diagnostic.CA1821.severity = warning
261+
dotnet_diagnostic.CA1900.severity = warning
262+
dotnet_diagnostic.CA1901.severity = warning
263+
dotnet_diagnostic.CA2002.severity = warning
264+
dotnet_diagnostic.CA2100.severity = warning
265+
dotnet_diagnostic.CA2101.severity = warning
266+
dotnet_diagnostic.CA2108.severity = warning
267+
dotnet_diagnostic.CA2111.severity = warning
268+
dotnet_diagnostic.CA2112.severity = warning
269+
dotnet_diagnostic.CA2114.severity = warning
270+
dotnet_diagnostic.CA2116.severity = warning
271+
dotnet_diagnostic.CA2117.severity = warning
272+
dotnet_diagnostic.CA2122.severity = warning
273+
dotnet_diagnostic.CA2123.severity = warning
274+
dotnet_diagnostic.CA2124.severity = warning
275+
dotnet_diagnostic.CA2126.severity = warning
276+
dotnet_diagnostic.CA2131.severity = warning
277+
dotnet_diagnostic.CA2132.severity = warning
278+
dotnet_diagnostic.CA2133.severity = warning
279+
dotnet_diagnostic.CA2134.severity = warning
280+
dotnet_diagnostic.CA2137.severity = warning
281+
dotnet_diagnostic.CA2138.severity = warning
282+
dotnet_diagnostic.CA2140.severity = warning
283+
dotnet_diagnostic.CA2141.severity = warning
284+
dotnet_diagnostic.CA2146.severity = warning
285+
dotnet_diagnostic.CA2147.severity = warning
286+
dotnet_diagnostic.CA2149.severity = warning
287+
dotnet_diagnostic.CA2200.severity = warning
288+
dotnet_diagnostic.CA2202.severity = warning
289+
dotnet_diagnostic.CA2207.severity = warning
290+
dotnet_diagnostic.CA2212.severity = warning
291+
dotnet_diagnostic.CA2213.severity = warning
292+
dotnet_diagnostic.CA2214.severity = warning
293+
dotnet_diagnostic.CA2216.severity = warning
294+
dotnet_diagnostic.CA2220.severity = warning
295+
dotnet_diagnostic.CA2229.severity = warning
296+
dotnet_diagnostic.CA2231.severity = warning
297+
dotnet_diagnostic.CA2232.severity = warning
298+
dotnet_diagnostic.CA2235.severity = warning
299+
dotnet_diagnostic.CA2236.severity = warning
300+
dotnet_diagnostic.CA2237.severity = warning
301+
dotnet_diagnostic.CA2238.severity = warning
302+
dotnet_diagnostic.CA2240.severity = warning
303+
dotnet_diagnostic.CA2241.severity = warning
304+
dotnet_diagnostic.CA2242.severity = warning
305+
dotnet_diagnostic.SA1011.severity = none
306+
dotnet_diagnostic.SA1101.severity = none
307+
dotnet_diagnostic.SA1118.severity = none
308+
dotnet_diagnostic.SA1200.severity = none
309+
dotnet_diagnostic.SA1201.severity = none
310+
dotnet_diagnostic.SA1202.severity = none
311+
dotnet_diagnostic.SA1309.severity = none
312+
dotnet_diagnostic.SA1310.severity = none
313+
dotnet_diagnostic.SA1600.severity = none
314+
dotnet_diagnostic.SA1602.severity = none
315+
dotnet_diagnostic.SA1611.severity = none
316+
dotnet_diagnostic.SA1633.severity = none
317+
dotnet_diagnostic.SA1634.severity = none
318+
dotnet_diagnostic.SA1652.severity = none
319+
320+
dotnet_diagnostic.SA1629.severity = none # DocumentationTextMustEndWithAPeriod: Let's enable this rule back when we shift to WinUI3 (v8.x). If we do it now, it would mean more than 400 file changes.
321+
dotnet_diagnostic.SA1413.severity = none # UseTrailingCommasInMultiLineInitializers: This would also mean a lot of changes at the end of all multiline intializers. It's also debatable if we want this or not.
322+
dotnet_diagnostic.SA1314.severity = none # TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this.

Directory.Build.props

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<PackageLicenseUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/license.md</PackageLicenseUrl>
1010
<PackageReleaseNotes>v3.0 release https://github.com/windows-toolkit/WindowsCommunityToolkit/releases</PackageReleaseNotes>
1111
<Copyright>(c) .NET Foundation and Contributors. All rights reserved.</Copyright>
12-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Toolkit.ruleset</CodeAnalysisRuleSet>
1312
<DefaultLanguage>en-US</DefaultLanguage>
1413
<IsDesignProject>$(MSBuildProjectName.Contains('.Design'))</IsDesignProject>
1514
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
@@ -59,11 +58,16 @@
5958
</Choose>
6059

6160
<Choose>
62-
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
61+
<When Condition="'$(IsDesignProject)' != 'true'">
6362
<ItemGroup>
64-
<!--<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.3.83" PrivateAssets="all" />-->
65-
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" />
63+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"/>
64+
</ItemGroup>
65+
</When>
66+
</Choose>
6667

68+
<Choose>
69+
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
70+
<ItemGroup>
6771
<EmbeddedResource Include="**\*.rd.xml" />
6872
<Page Include="**\*.xaml" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
6973
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />

Microsoft.Toolkit.Services/Services/LinkedIn/LinkedInDataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public async Task LogoutAsync()
176176
if (crendential != null)
177177
{
178178
_passwordManager.Remove(LinkedInConstants.STORAGEKEYACCESSTOKEN);
179-
await _storageManager.SetAsync(LinkedInConstants.STORAGEKEYUSER, null);
179+
await _storageManager.SetAsync(LinkedInConstants.STORAGEKEYUSER, null);
180180
}
181181

182182
LoggedIn = false;

Microsoft.Toolkit.Services/Services/Weibo/WeiboDataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public async Task LogoutAsync()
185185
if (credential != null)
186186
{
187187
_passwordManager.Remove(PasswordKey);
188-
await _storageManager.SetAsync(StorageKey, null);
188+
await _storageManager.SetAsync(StorageKey, null);
189189
}
190190

191191
Uid = null;

Microsoft.Toolkit.Uwp.Notifications/Toasts/Builder/ToastContentBuilder.Visuals.cs

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -82,50 +82,50 @@ private IList<IToastBindingGenericChild> VisualChildren
8282

8383
#if WINDOWS_UWP
8484

85-
/// <summary>
86-
/// Create an instance of NotificationData that can be used to update toast that has a progress bar.
87-
/// </summary>
88-
/// <param name="toast">Instance of ToastContent that contain progress bars that need to be updated</param>
89-
/// <param name="index">Index of the progress bar (0-based) that this notification data is updating in the case that toast has multiple progress bars. Default to 0.</param>
90-
/// <param name="title">Title of the progress bar.</param>
91-
/// <param name="value">Value of the progress bar.</param>
92-
/// <param name="valueStringOverride">An optional string to be displayed instead of the default percentage string. If this isn't provided, something like "70%" will be displayed.</param>
93-
/// <param name="status"> A status string, which is displayed underneath the progress bar on the left. Default to empty.</param>
94-
/// <param name="sequence">A sequence number to prevent out-of-order updates, or assign 0 to indicate "always update".</param>
95-
/// <returns>An instance of NotificationData that can be used to update the toast.</returns>
96-
public static NotificationData CreateProgressBarData(ToastContent toast, int index = 0, string title = default(string), double? value = null, string valueStringOverride = default(string), string status = default(string), uint sequence = 0)
97-
{
98-
var progressBar = toast.Visual.BindingGeneric.Children.Where(c => c is AdaptiveProgressBar).ElementAt(index) as AdaptiveProgressBar;
99-
if (progressBar == null)
100-
{
101-
throw new ArgumentException(nameof(toast), "Given toast does not have any progress bar");
102-
}
103-
104-
NotificationData data = new NotificationData();
105-
data.SequenceNumber = sequence;
106-
107-
if (progressBar.Title is BindableString bindableTitle && title != default(string))
108-
{
109-
data.Values[bindableTitle.BindingName] = title;
110-
}
111-
112-
if (progressBar.Value is BindableProgressBarValue bindableProgressValue && value != null)
113-
{
114-
data.Values[bindableProgressValue.BindingName] = value.ToString();
115-
}
116-
117-
if (progressBar.ValueStringOverride is BindableString bindableValueStringOverride && valueStringOverride != default(string))
118-
{
119-
data.Values[bindableValueStringOverride.BindingName] = valueStringOverride;
120-
}
121-
122-
if (progressBar.Status is BindableString bindableStatus && status != default(string))
123-
{
124-
data.Values[bindableStatus.BindingName] = status;
125-
}
126-
127-
return data;
128-
}
85+
/// <summary>
86+
/// Create an instance of NotificationData that can be used to update toast that has a progress bar.
87+
/// </summary>
88+
/// <param name="toast">Instance of ToastContent that contain progress bars that need to be updated</param>
89+
/// <param name="index">Index of the progress bar (0-based) that this notification data is updating in the case that toast has multiple progress bars. Default to 0.</param>
90+
/// <param name="title">Title of the progress bar.</param>
91+
/// <param name="value">Value of the progress bar.</param>
92+
/// <param name="valueStringOverride">An optional string to be displayed instead of the default percentage string. If this isn't provided, something like "70%" will be displayed.</param>
93+
/// <param name="status"> A status string, which is displayed underneath the progress bar on the left. Default to empty.</param>
94+
/// <param name="sequence">A sequence number to prevent out-of-order updates, or assign 0 to indicate "always update".</param>
95+
/// <returns>An instance of NotificationData that can be used to update the toast.</returns>
96+
public static NotificationData CreateProgressBarData(ToastContent toast, int index = 0, string title = default(string), double? value = null, string valueStringOverride = default(string), string status = default(string), uint sequence = 0)
97+
{
98+
var progressBar = toast.Visual.BindingGeneric.Children.Where(c => c is AdaptiveProgressBar).ElementAt(index) as AdaptiveProgressBar;
99+
if (progressBar == null)
100+
{
101+
throw new ArgumentException(nameof(toast), "Given toast does not have any progress bar");
102+
}
103+
104+
NotificationData data = new NotificationData();
105+
data.SequenceNumber = sequence;
106+
107+
if (progressBar.Title is BindableString bindableTitle && title != default(string))
108+
{
109+
data.Values[bindableTitle.BindingName] = title;
110+
}
111+
112+
if (progressBar.Value is BindableProgressBarValue bindableProgressValue && value != null)
113+
{
114+
data.Values[bindableProgressValue.BindingName] = value.ToString();
115+
}
116+
117+
if (progressBar.ValueStringOverride is BindableString bindableValueStringOverride && valueStringOverride != default(string))
118+
{
119+
data.Values[bindableValueStringOverride.BindingName] = valueStringOverride;
120+
}
121+
122+
if (progressBar.Status is BindableString bindableStatus && status != default(string))
123+
{
124+
data.Values[bindableStatus.BindingName] = status;
125+
}
126+
127+
return data;
128+
}
129129

130130
#endif
131131

Microsoft.Toolkit.Uwp.PlatformDifferencesGen/DifferencesGen.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
<DefineConstants>TRACE</DefineConstants>
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
33+
<DocumentationFile>bin\Release\DifferencesGen.xml</DocumentationFile>
34+
<NoWarn>1591</NoWarn>
3335
</PropertyGroup>
3436
<ItemGroup>
3537
<Reference Include="System" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.{cs,vb}]
2+
3+
# SA1601: Partial elements should be documented
4+
dotnet_diagnostic.SA1601.severity = none
5+
dotnet_diagnostic.CS1573.severity = none
6+
dotnet_diagnostic.CS1591.severity = none
7+
dotnet_diagnostic.CS1712.severity = none

Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
<UseVSHostingProcess>false</UseVSHostingProcess>
3333
<ErrorReport>prompt</ErrorReport>
3434
<Prefer32Bit>true</Prefer32Bit>
35-
<DocumentationFile>
36-
</DocumentationFile>
37-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
35+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
3836
</PropertyGroup>
3937
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
4038
<OutputPath>bin\x86\Release\</OutputPath>
@@ -49,9 +47,7 @@
4947
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
5048
<RunCodeAnalysis>false</RunCodeAnalysis>
5149
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
52-
<DocumentationFile>
53-
</DocumentationFile>
54-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
50+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
5551
</PropertyGroup>
5652
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
5753
<DebugSymbols>true</DebugSymbols>
@@ -63,7 +59,6 @@
6359
<UseVSHostingProcess>false</UseVSHostingProcess>
6460
<ErrorReport>prompt</ErrorReport>
6561
<Prefer32Bit>true</Prefer32Bit>
66-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
6762
</PropertyGroup>
6863
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
6964
<OutputPath>bin\ARM\Release\</OutputPath>
@@ -78,9 +73,7 @@
7873
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
7974
<RunCodeAnalysis>false</RunCodeAnalysis>
8075
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
81-
<DocumentationFile>
82-
</DocumentationFile>
83-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
76+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
8477
</PropertyGroup>
8578
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
8679
<DebugSymbols>true</DebugSymbols>
@@ -92,7 +85,6 @@
9285
<UseVSHostingProcess>false</UseVSHostingProcess>
9386
<ErrorReport>prompt</ErrorReport>
9487
<Prefer32Bit>true</Prefer32Bit>
95-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
9688
</PropertyGroup>
9789
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
9890
<OutputPath>bin\x64\Release\</OutputPath>
@@ -107,9 +99,7 @@
10799
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
108100
<RunCodeAnalysis>false</RunCodeAnalysis>
109101
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
110-
<DocumentationFile>
111-
</DocumentationFile>
112-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
102+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
113103
</PropertyGroup>
114104
<PropertyGroup>
115105
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
@@ -130,9 +120,6 @@
130120
<PackageReference Include="Monaco.Editor">
131121
<Version>0.7.0-alpha</Version>
132122
</PackageReference>
133-
<PackageReference Include="StyleCop.Analyzers">
134-
<Version>1.0.2</Version>
135-
</PackageReference>
136123
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
137124
<Version>1.1.0</Version>
138125
</PackageReference>
@@ -385,7 +372,7 @@
385372
<Content Include="Assets\mtns.csv">
386373
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
387374
</Content>
388-
<None Include="Microsoft.Toolkit.Uwp.SampleApp.ruleset" />
375+
<None Include=".editorconfig" />
389376
<Content Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToast.png" />
390377
<Content Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastCode.bind" />
391378
<Content Include="SamplePages\ImageEx\ImageExCode.bind" />
@@ -1449,7 +1436,6 @@
14491436
<PlatformTarget>ARM64</PlatformTarget>
14501437
<UseVSHostingProcess>false</UseVSHostingProcess>
14511438
<ErrorReport>prompt</ErrorReport>
1452-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
14531439
<Prefer32Bit>true</Prefer32Bit>
14541440
</PropertyGroup>
14551441
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
@@ -1463,7 +1449,6 @@
14631449
<PlatformTarget>ARM64</PlatformTarget>
14641450
<UseVSHostingProcess>false</UseVSHostingProcess>
14651451
<ErrorReport>prompt</ErrorReport>
1466-
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.sampleapp.ruleset</CodeAnalysisRuleSet>
14671452
<Prefer32Bit>true</Prefer32Bit>
14681453
</PropertyGroup>
14691454
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />

0 commit comments

Comments
 (0)