Skip to content

Commit

Permalink
Migrate to .NET 5 (#6)
Browse files Browse the repository at this point in the history
* migrate to .net 5

* remove missing assembly

* update README

* fix merge issues in README

* fix inconsistent line endings; add editorconfig to avoid in the future

* update assembly version

* additional cleanup, visibility changes

* fix ci

* ci

* publish; this won't actually publish anything, but will ensure the profiles are working in ci

* fix additional build warnings; ci comments/strings

* remove bootstrapper packages which i don't believe are necessary
  • Loading branch information
fardog authored Nov 13, 2021
1 parent 68d6c67 commit 066b1ea
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 270 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_style = space
indent_size = 4

[*.yaml]
end_of_line = lf
indent_style = space
indent_size = 2
32 changes: 17 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
name: Debug Build
name: Build Smoke Test

on:
push:
branches:
- master
- master
pull_request:

jobs:
build:
strategy:
matrix:
targetplatform: [x86, x64]

runs-on: windows-latest

env:
Solution_Path: Swapper.sln

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1

- name: Build solution
run: msbuild $env:Solution_Path /p:DeployOnBuild=true /p:PublishProfile=FolderProfile
run: dotnet build
env:
Configuration: Release

# these do not actually publish anything; they are just ensuring the publish
# profiles are working
- name: Publish (x64)
run: dotnet publish
env:
Configuration: Release
PublishProfile: folder-x64
- name: Publish (x86)
run: dotnet publish
env:
Configuration: Debug
RuntimeIdentifier: win-${{ matrix.targetplatform }}
Configuration: Release
PublishProfile: folder-x86
62 changes: 31 additions & 31 deletions AboutBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 13 additions & 16 deletions AboutBox.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Swapper
{
partial class AboutBox : Form
{
private static readonly string UNKNOWN_VALUE_STRING = "UNKNOWN";

public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.Text = $"About {AssemblyTitle}";
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelVersion.Text = $"Version {AssemblyVersion}";
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
}

#region Assembly Attribute Accessors

public string AssemblyTitle
public static string AssemblyTitle
{
get
{
Expand All @@ -37,19 +34,19 @@ public string AssemblyTitle
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
return UNKNOWN_VALUE_STRING;
}
}

public string AssemblyVersion
public static string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
return Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? UNKNOWN_VALUE_STRING;
}
}

public string AssemblyDescription
public static string AssemblyDescription
{
get
{
Expand All @@ -62,7 +59,7 @@ public string AssemblyDescription
}
}

public string AssemblyProduct
public static string AssemblyProduct
{
get
{
Expand All @@ -75,7 +72,7 @@ public string AssemblyProduct
}
}

public string AssemblyCopyright
public static string AssemblyCopyright
{
get
{
Expand All @@ -88,7 +85,7 @@ public string AssemblyCopyright
}
}

public string AssemblyCompany
public static string AssemblyCompany
{
get
{
Expand All @@ -102,7 +99,7 @@ public string AssemblyCompany
}
#endregion

private void okButton_Click(object sender, EventArgs e)
private void OkButton_Click(object sender, EventArgs e)
{
Close();
}
Expand Down
62 changes: 1 addition & 61 deletions AboutBox.resx
Original file line number Diff line number Diff line change
@@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down
Loading

0 comments on commit 066b1ea

Please sign in to comment.