diff --git a/Application/FileConverter/Application.xaml.cs b/Application/FileConverter/Application.xaml.cs index be07460..ff8062d 100644 --- a/Application/FileConverter/Application.xaml.cs +++ b/Application/FileConverter/Application.xaml.cs @@ -18,10 +18,17 @@ namespace FileConverter using System; using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Diagnostics.CodeAnalysis; using System.Threading; public partial class Application : System.Windows.Application { + public static readonly Version Version = new Version() + { + Major = 0, + Minor = 1, + }; + private readonly List conversionJobs = new List(); private bool debugMode; @@ -215,10 +222,7 @@ namespace FileConverter { System.Threading.Thread.Sleep(3000); - Dispatcher.BeginInvoke((Action)delegate - { - Application.Current.Shutdown(); - }); + Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown())); } #endif } diff --git a/Application/FileConverter/FileConverter.csproj b/Application/FileConverter/FileConverter.csproj index 9ea5dc1..1308c09 100644 --- a/Application/FileConverter/FileConverter.csproj +++ b/Application/FileConverter/FileConverter.csproj @@ -68,6 +68,7 @@ MSBuild:Compile Designer + MSBuild:Compile Designer diff --git a/Application/FileConverter/MainWindow.xaml b/Application/FileConverter/MainWindow.xaml index 0a3508f..3f087df 100644 --- a/Application/FileConverter/MainWindow.xaml +++ b/Application/FileConverter/MainWindow.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="FileConverter.MainWindow" xmlns:local="clr-namespace:FileConverter" - x:Name="FileConverterMainWindow" Title="File Converter" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen"> + x:Name="FileConverterMainWindow" Title="{Binding ApplicationName, ElementName=FileConverterMainWindow, Mode=OneWay}" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen"> diff --git a/Application/FileConverter/MainWindow.xaml.cs b/Application/FileConverter/MainWindow.xaml.cs index a52356e..5c45d5a 100644 --- a/Application/FileConverter/MainWindow.xaml.cs +++ b/Application/FileConverter/MainWindow.xaml.cs @@ -12,10 +12,14 @@ namespace FileConverter { private bool verboseMode; + private string applicationName; + public MainWindow() { this.InitializeComponent(); + this.ApplicationName = string.Format("File Converter v{0}", Application.Version.ToString()); + Application application = Application.Current as Application; this.ConverterJobsList.ItemsSource = application.ConvertionJobs; @@ -24,6 +28,20 @@ namespace FileConverter public event PropertyChangedEventHandler PropertyChanged; + public string ApplicationName + { + get + { + return this.applicationName; + } + + private set + { + this.applicationName = value; + this.OnPropertyChanged(); + } + } + public bool VerboseMode { get diff --git a/Application/FileConverter/Version.cs b/Application/FileConverter/Version.cs new file mode 100644 index 0000000..95f2a0c --- /dev/null +++ b/Application/FileConverter/Version.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FileConverter +{ + public struct Version + { + public int Major; + public int Minor; + + public override string ToString() + { + return string.Format("{0}.{1}", this.Major, this.Minor); + } + } +}