Skip to content

Commit

Permalink
Downgrade launcher framework to .NET 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SadPencil committed Feb 25, 2024
1 parent d8d31da commit d9d9ad6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
uses: gittools/actions/gitversion/execute@v0

- name: Publish
run: dotnet publish --configuration Release -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
run: dotnet publish --framework net40 --configuration Release -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion

- name: Zip
run: 7z a -r ${{ format('CnCNet.LauncherStub-v{0}-net471.zip', env.GitVersion_SemVer) }} ./bin/Release/net471/publish/*.*
run: 7z a -r ${{ format('CnCNet.LauncherStub-v{0}-net40.zip', env.GitVersion_SemVer) }} ./bin/Release/net40/publish/*.*

- name: Prerelease
if: ${{ env.GitVersion_PreReleaseTag != '' }}
Expand Down
6 changes: 3 additions & 3 deletions AdvancedMessageBoxViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ObservableCollection<CommandViewModel> Commands
set
{
commands = value;
NotifyPropertyChanged();
NotifyPropertyChanged("Commands");
}
}

Expand All @@ -24,7 +24,7 @@ public string Title
set
{
title = value;
NotifyPropertyChanged();
NotifyPropertyChanged("Title");
}
}

Expand All @@ -36,7 +36,7 @@ public string Message
set
{
message = value;
NotifyPropertyChanged();
NotifyPropertyChanged("Message");
}
}
}
5 changes: 1 addition & 4 deletions CnCNet.LauncherStub.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<TargetFrameworks>net40; net471</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
Expand All @@ -25,7 +25,4 @@
<ItemGroup>
<Content Include="mainclienticon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion CnCNet.LauncherStub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{31CF936D-B0E9-4B0B-9D87-255E3514164A}"
ProjectSection(SolutionItems) = preProject
.github\workflows\publish.yml = .github\workflows\publish.yml
.github\workflows\publishcustomicon.yml = .github\workflows\publishcustomicon.yml
EndProjectSection
EndProject
Global
Expand Down
4 changes: 2 additions & 2 deletions CommandViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public string Text
set
{
text = value;
NotifyPropertyChanged();
NotifyPropertyChanged("Text");
}
}

Expand All @@ -24,7 +24,7 @@ public ICommand Command
set
{
command = value;
NotifyPropertyChanged();
NotifyPropertyChanged("Command");
}
}
}
7 changes: 5 additions & 2 deletions NotifyPropertyChangedBase.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
namespace CnCNet.LauncherStub;

using System.ComponentModel;
using System.Runtime.CompilerServices;

public abstract class NotifyPropertyChangedBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;

#if NET45_OR_GREATER || NETSTANDARD || NET
/// <summary>
/// This method is called by the Set accessor of each property. <br/>
/// The CallerMemberName attribute that is applied to the optional propertyName parameter causes the property name of the caller to be substituted as an argument.
/// </summary>
/// <param name="propertyName">The property name. Default to the caller.</param>
internal void NotifyPropertyChanged([CallerMemberName] string propertyName = "") => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
internal void NotifyPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = "") => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
#else
internal void NotifyPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
#endif
}

0 comments on commit d9d9ad6

Please sign in to comment.