Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Feb 26, 2021
2 parents 3d188a2 + 63ec63a commit 448dff7
Show file tree
Hide file tree
Showing 63 changed files with 1,710 additions and 3,581 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -257,7 +257,8 @@ paket-files/
*.sln.iml

# cake
tools/
tools/*
!tools/packages.config

# XamlStyler
!XamlStyler/
Expand All @@ -266,4 +267,4 @@ tools/
src/ControlzEx.Showcase/Themes/Themes/*.xaml
!src/ControlzEx.Showcase/Themes/Themes/Theme.Template.xaml
src/ControlzEx.Tests/Themes/Themes/*.xaml
!src/ControlzEx.Tests/Themes/Themes/Theme.Template.xaml
!src/ControlzEx.Tests/Themes/Themes/Theme.Template.xaml
2 changes: 1 addition & 1 deletion GitVersion.yml
@@ -1,6 +1,6 @@
assembly-versioning-scheme: Major
assembly-file-versioning-scheme: MajorMinorPatchTag
next-version: 4.4.0
next-version: 5.0.0
mode: ContinuousDeployment
branches:
master:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@
Shared Controlz for WPF
</p>
<p>
Supporting .NET Framework (4.5 and 4.6.2) and .NET Core (3.0 and 3.1)
Supporting .NET Framework (4.5.2, 4.6.2 and greater), .NET Core (3.1) and .NET 5 (on Windows)
</p>
<a href="https://github.com/ControlzEx/ControlzEx">
<img alt="ControlzEx" with="200" height="200" src="logo-mini.png">
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Expand Up @@ -17,16 +17,18 @@ environment:
secure: BSPdW2TgnQtoQXXbeDECug==

skip_tags: true
image: Visual Studio 2019
image: Visual Studio 2019 Preview
test: off

install:
#- cinst dotnetcore-sdk --version=3.1.100
- ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
- ps: ./dotnet-install.ps1 -Version 5.0.103 -InstallDir "C:\Program Files\dotnet"

pull_requests:
do_not_increment_build_number: false

build_script:
- ps: dotnet --list-sdks
- ps: .\build.ps1 -target CI

artifacts:
Expand Down
10 changes: 6 additions & 4 deletions build.cake
Expand Up @@ -2,13 +2,13 @@
// TOOLS / ADDINS
///////////////////////////////////////////////////////////////////////////////

#module nuget:?package=Cake.DotNetTool.Module
#tool "dotnet:?package=NuGetKeyVaultSignTool&version=1.2.18"
#module nuget:?package=Cake.DotNetTool.Module&version=0.5.0
#tool "dotnet:?package=NuGetKeyVaultSignTool&version=1.2.28"
#tool "dotnet:?package=AzureSignTool&version=2.0.17"

#tool GitVersion.CommandLine&version=5.3.7
#tool GitVersion.CommandLine&version=5.6.6
#tool gitreleasemanager
#addin Cake.Figlet
#addin nuget:?package=Cake.Figlet&version=1.4.0

///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand Down Expand Up @@ -198,6 +198,7 @@ void SignFiles(IEnumerable<FilePath> files, string description)
}

Task("Sign")
.WithCriteria(() => !isPullRequest)
.ContinueOnError()
.Does(() =>
{
Expand All @@ -209,6 +210,7 @@ Task("Sign")
});

Task("SignNuGet")
.WithCriteria(() => !isPullRequest)
.ContinueOnError()
.Does(() =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/ControlzEx.Showcase/ControlzEx.Showcase.csproj
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="XamlColorSchemeGenerator" version="4-*" privateAssets="All" includeAssets="build" />
<PackageReference Include="XamlColorSchemeGenerator" privateAssets="All" includeAssets="build" />
</ItemGroup>

<Target Name="GenerateXamlFiles" BeforeTargets="DispatchToInnerBuilds">
Expand Down
1 change: 0 additions & 1 deletion src/ControlzEx.Showcase/MainWindow.xaml.cs
Expand Up @@ -90,7 +90,6 @@ private void ButtonOpenPseudoModalChildWindowOnClick(object sender, RoutedEventA
Owner = this // for this to work we always have to set the owner
};


// We have to use closing, otherwise the owner window won't be activated.
window.Closing += this.PseudoModalWindow_Closing;

Expand Down
6 changes: 3 additions & 3 deletions src/ControlzEx.Showcase/Views/ThemingView.xaml.cs
Expand Up @@ -30,7 +30,7 @@ protected override void OnInitialized(EventArgs e)

var currentTheme = this.CurrentTheme;

if (currentTheme is null == false
if (currentTheme is not null
&& this.CurrentThemeCollection.Contains(currentTheme) == false)
{
this.CurrentThemeCollection.Clear();
Expand All @@ -44,7 +44,7 @@ protected override void OnInitialized(EventArgs e)
private void ThemeManager_ThemeChanged(object sender, ThemeChangedEventArgs e)
{
// Add the new theme first, if it's generated
if (e.NewTheme is null == false
if (e.NewTheme is not null
&& e.NewTheme.IsRuntimeGenerated)
{
this.CurrentThemeCollection.Add(e.NewTheme);
Expand All @@ -61,7 +61,7 @@ private void ThemeManager_ThemeChanged(object sender, ThemeChangedEventArgs e)

// Remove the old theme, if it's generated
// We have to do this after the notification to ensure the selection does not get reset by the removal
if (e.OldTheme is null == false
if (e.OldTheme is not null
&& e.OldTheme.IsRuntimeGenerated)
{
this.CurrentThemeCollection.Remove(e.OldTheme);
Expand Down
9 changes: 5 additions & 4 deletions src/ControlzEx.Tests/ControlzEx.Tests.csproj
Expand Up @@ -4,6 +4,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

<NoWarn>$(NoWarn);SA0001</NoWarn>
Expand All @@ -23,14 +24,14 @@
<ProjectReference Include="..\ControlzEx\ControlzEx.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
<PackageReference Include="NUnit3TestAdapter" Version="3.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit3TestAdapter" />

<PackageReference Include="NUnit" version="3.*" />
<PackageReference Include="NUnit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="XamlColorSchemeGenerator" version="4-*" privateAssets="All" includeAssets="build" />
<PackageReference Include="XamlColorSchemeGenerator" privateAssets="All" includeAssets="build" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 9 additions & 10 deletions src/ControlzEx.Tests/Theming/HSLTests.cs
@@ -1,14 +1,14 @@
using ControlzEx.Theming;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace ControlzEx.Tests.Theming
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using ControlzEx.Theming;
using NUnit.Framework;

[TestFixture]
public class HSLTests
{
Expand Down Expand Up @@ -83,7 +83,6 @@ public void TestHslFromColor_BuildInColors()
}
}


[Test]
public void TestHslFromInput()
{
Expand Down
46 changes: 46 additions & 0 deletions src/ControlzEx.ruleset
Expand Up @@ -116,6 +116,52 @@
<Rule Id="IDE0001" Action="None" />
<Rule Id="IDE0003" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA0001" Action="None" />
<Rule Id="SA1004" Action="None" />
<Rule Id="SA1005" Action="None" />
<Rule Id="SA1028" Action="Info" />
<Rule Id="SA1108" Action="None" />
<Rule Id="SA1116" Action="None" />
<Rule Id="SA1117" Action="None" />
<Rule Id="SA1118" Action="None" />
<Rule Id="SA1123" Action="None" />
<Rule Id="SA1124" Action="None" />
<Rule Id="SA1137" Action="None" />
<Rule Id="SA1201" Action="None" />
<Rule Id="SA1202" Action="None" />
<Rule Id="SA1203" Action="None" />
<Rule Id="SA1204" Action="None" />
<Rule Id="SA1207" Action="None" />
<Rule Id="SA1214" Action="None" />
<Rule Id="SA1311" Action="None" />
<Rule Id="SA1402" Action="None" />
<Rule Id="SA1413" Action="None" />
<Rule Id="SA1504" Action="None" />
<Rule Id="SA1509" Action="None" />
<Rule Id="SA1512" Action="None" />
<Rule Id="SA1515" Action="None" />
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1601" Action="None" />
<Rule Id="SA1611" Action="None" />
<Rule Id="SA1615" Action="None" />
<Rule Id="SA1616" Action="None" />
<Rule Id="SA1618" Action="None" />
<Rule Id="SA1623" Action="None" />
<Rule Id="SA1624" Action="None" />
<Rule Id="SA1625" Action="None" />
<Rule Id="SA1629" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1634" Action="None" />
<Rule Id="SA1635" Action="None" />
<Rule Id="SA1636" Action="None" />
<Rule Id="SA1637" Action="None" />
<Rule Id="SA1638" Action="None" />
<Rule Id="SA1640" Action="None" />
<Rule Id="SA1641" Action="None" />
<Rule Id="SA1642" Action="None" />
<Rule Id="SA1649" Action="None" />
</Rules>
<Rules AnalyzerId="WpfAnalyzers" RuleNamespace="WpfAnalyzers.Analyzers">
<Rule Id="WPF0041" Action="Info" />
</Rules>
Expand Down
1 change: 1 addition & 0 deletions src/ControlzEx.sln
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\build.cake = ..\build.cake
Directory.build.props = Directory.build.props
Directory.build.targets = Directory.build.targets
Directory.packages.props = Directory.packages.props
global.json = global.json
GlobalAssemblyInfo.cs = GlobalAssemblyInfo.cs
..\NuGet.Config = ..\NuGet.Config
Expand Down
12 changes: 6 additions & 6 deletions src/ControlzEx/Automation/Peers/TabItemExAutomationPeer.cs
Expand Up @@ -39,14 +39,14 @@ protected override List<AutomationPeer> GetChildrenCore()

var contentHost = parentTabControl.FindChildContentPresenter(tabItem.Content, tabItem);

if (contentHost != null)
if (contentHost is not null)
{
var contentHostPeer = new FrameworkElementAutomationPeer(contentHost);
var contentChildren = contentHostPeer.GetChildren();

if (contentChildren != null)
if (contentChildren is not null)
{
if (headerChildren == null)
if (headerChildren is null)
{
headerChildren = contentChildren;
}
Expand All @@ -63,13 +63,13 @@ protected override List<AutomationPeer> GetChildrenCore()
/// <summary>
/// Gets the real tab item.
/// </summary>
private UIElement GetWrapper()
private UIElement? GetWrapper()
{
var itemsControlAutomationPeer = this.ItemsControlAutomationPeer;

var owner = (TabControlEx)itemsControlAutomationPeer?.Owner;
var owner = (TabControlEx?)itemsControlAutomationPeer?.Owner;

if (owner == null)
if (owner is null)
{
return null;
}
Expand Down

0 comments on commit 448dff7

Please sign in to comment.