Add version label

This commit is contained in:
Lohikar 2017-11-23 16:57:31 -06:00
parent 736035ff32
commit 32454bd123
5 changed files with 12 additions and 7 deletions

View file

@ -16,7 +16,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
@ -24,15 +24,17 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Humanizer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL"> <Reference Include="Humanizer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL">

View file

@ -1,6 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
@ -12,7 +10,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AuroraRecordGenerator")] [assembly: AssemblyProduct("AuroraRecordGenerator")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -51,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -378,6 +378,7 @@
Width="75" d:LayoutOverrides="Height" Click="SaveContentAs" /> Width="75" d:LayoutOverrides="Height" Click="SaveContentAs" />
<Button Content="Generate" HorizontalAlignment="Right" Margin="0,10.3,10,9.66" <Button Content="Generate" HorizontalAlignment="Right" Margin="0,10.3,10,9.66"
Width="75" d:LayoutOverrides="Height" Click="GenerateRecord" /> Width="75" d:LayoutOverrides="Height" Click="GenerateRecord" />
<Label x:Name="VersionLabel" Content="Version" HorizontalAlignment="Left" Margin="250,9,0,0" VerticalAlignment="Top" Foreground="Gray"/>
</Grid> </Grid>
</Grid> </Grid>
</controls:MetroWindow> </controls:MetroWindow>

View file

@ -25,6 +25,7 @@ namespace AuroraRecordGenerator
ProtoBuf.Serializer.PrepareSerializer<Record>(); ProtoBuf.Serializer.PrepareSerializer<Record>();
InitializeComponent(); InitializeComponent();
SubSpeciesCombo.ItemsSource = GetSpeciesOptions(); SubSpeciesCombo.ItemsSource = GetSpeciesOptions();
VersionLabel.Content = $"v{Utility.GetVersion()}";
} }
private Record Data { get; set; } private Record Data { get; set; }

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
namespace AuroraRecordGenerator namespace AuroraRecordGenerator
@ -67,6 +68,8 @@ namespace AuroraRecordGenerator
where attr != null && attr.NiceName == nicename where attr != null && attr.NiceName == nicename
select item).FirstOrDefault(); select item).FirstOrDefault();
} }
public static Version GetVersion() => Assembly.GetExecutingAssembly().GetName().Version;
} }
// From https://stackoverflow.com/questions/1799370/getting-attributes-of-enums-value // From https://stackoverflow.com/questions/1799370/getting-attributes-of-enums-value