Skip to content

Commit adb18ca

Browse files
committed
Version changed to yyyy.MM.dd, link to documentation added
1 parent d1802de commit adb18ca

12 files changed

Lines changed: 70 additions & 35 deletions

File tree

Source/NETworkManager/MainWindow.xaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
88
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
99
xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
10+
xmlns:Settings="clr-namespace:NETworkManager.Models.Settings"
11+
xmlns:Resources="clr-namespace:NETworkManager.Properties"
1012
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
1113
mc:Ignorable="d"
1214
Title="{DynamicResource String_ProductName}" Style="{DynamicResource DefaultWindow}" MinWidth="650" MinHeight="500" Height="650" Width="1000" SaveWindowPosition="True" TitleAlignment="Left" Closing="MetroWindowMain_Closing" StateChanged="MetroWindowMain_StateChanged">
@@ -24,14 +26,24 @@
2426
</Controls:MetroWindow.IconTemplate>
2527
<Controls:MetroWindow.RightWindowCommands>
2628
<Controls:WindowCommands>
27-
<Button Command="{Binding OpenGithubProjectCommand}">
29+
<Button Command="{Binding OpenWebsiteCommand}" CommandParameter="{x:Static Resources:Resources.NETworkManager_DocumentationUrl}">
30+
<StackPanel Orientation="Horizontal">
31+
<Rectangle Width="20" Height="20" Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
32+
<Rectangle.OpacityMask>
33+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconOcticons Kind=Repo}" />
34+
</Rectangle.OpacityMask>
35+
</Rectangle>
36+
<TextBlock Text="{DynamicResource String_Documentation}" VerticalAlignment="Center" Margin="5,0,0,0" />
37+
</StackPanel>
38+
</Button>
39+
<Button Command="{Binding OpenWebsiteCommand}" CommandParameter="{x:Static Resources:Resources.NETworkManager_ProjectUrl}">
2840
<StackPanel Orientation="Horizontal">
2941
<Rectangle Width="20" Height="20" Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
3042
<Rectangle.OpacityMask>
3143
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconModern Kind=SocialGithubOctocat}" />
3244
</Rectangle.OpacityMask>
3345
</Rectangle>
34-
<TextBlock Text="Fork me on GitHub!" VerticalAlignment="Center" Margin="5,0,0,0" />
46+
<TextBlock Text="{DynamicResource String_ForkMeOnGitHub}" VerticalAlignment="Center" Margin="5,0,0,0" />
3547
</StackPanel>
3648
</Button>
3749
</Controls:WindowCommands>
@@ -594,7 +606,7 @@
594606
<Border Grid.Row="1" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource GrayBrush8}">
595607
<StatusBar Foreground="{DynamicResource GrayBrush3}">
596608
<StatusBarItem>
597-
<TextBlock Text="{Binding Version}" Style="{StaticResource DefaultTextBlock}" Foreground="{DynamicResource GrayBrush3}" FontWeight="Bold" />
609+
<TextBlock Text="{Binding Source={x:Static Settings:AssemblyManager.Current}, Path=Version}" Style="{StaticResource DefaultTextBlock}" Foreground="{DynamicResource GrayBrush3}" FontWeight="Bold" />
598610
</StatusBarItem>
599611
</StatusBar>
600612
</Border>

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -212,30 +212,14 @@ public bool ShowSettingsView
212212
OnPropertyChanged();
213213
}
214214
}
215-
216-
private string _version;
217-
public string Version
218-
{
219-
get { return _version; }
220-
set
221-
{
222-
if (value == _version)
223-
return;
224-
225-
_version = value;
226-
OnPropertyChanged();
227-
}
228-
}
229215
#endregion
230216

231217
#region Constructor, window load and close events
232218
public MainWindow()
233219
{
234220
InitializeComponent();
235221
DataContext = this;
236-
237-
Version = AssemblyManager.Current.AssemblyVersion.ToString();
238-
222+
239223
LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(LocalizationManager.Culture.IetfLanguageTag)));
240224

241225
// Load appearance
@@ -608,16 +592,36 @@ private void BringWindowToFront()
608592
#endregion
609593

610594
#region ICommands & Actions
611-
public ICommand OpenGithubProjectCommand
595+
public ICommand OpenWebsiteCommand
612596
{
613-
get { return new RelayCommand(p => OpenGithubProjectAction()); }
597+
get { return new RelayCommand(p => OpenWebsiteAction(p)); }
614598
}
615599

616-
private void OpenGithubProjectAction()
600+
private void OpenWebsiteAction(object url)
617601
{
618-
Process.Start(Properties.Resources.NETworkManager_ProjectUrl);
602+
Process.Start((string)url);
619603
}
620604

605+
//public ICommand OpenGithubProjectCommand
606+
//{
607+
// get { return new RelayCommand(p => OpenGithubProjectAction()); }
608+
//}
609+
610+
//private void OpenGithubProjectAction()
611+
//{
612+
// Process.Start(Properties.Resources.NETworkManager_ProjectUrl);
613+
//}
614+
615+
//public ICommand OpenDocumentationCommand
616+
//{
617+
// get { return new RelayCommand(p => OpenDocumentationAction()); }
618+
//}
619+
620+
//private void OpenDocumentationAction()
621+
//{
622+
// Process.Start(Properties.Resources.NETworkManager_DocumentationUrl);
623+
//}
624+
621625
public ICommand OpenApplicationListCommand
622626
{
623627
get { return new RelayCommand(p => OpenApplicationListAction()); }

Source/NETworkManager/Models/Settings/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class AssemblyInfo
77
public string Title { get; set; }
88
public string Company { get; set; }
99
public string Copyright { get; set; }
10-
public Version AssemblyVersion { get; set; }
10+
public string Version { get; set; }
1111

1212
public AssemblyInfo()
1313
{

Source/NETworkManager/Models/Settings/AssemblyManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void Load()
2020
Title = title.Title,
2121
Company = company.Company,
2222
Copyright = copyright.Copyright,
23-
AssemblyVersion = name.Version
23+
Version = string.Format("{0}.{1}.{2}", name.Version.Major, name.Version.Minor, name.Version.Build)
2424
};
2525
}
2626
}

Source/NETworkManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
5050
// übernehmen, indem Sie "*" eingeben:
5151
// [assembly: AssemblyVersion("1.0.*")]
52-
[assembly: AssemblyVersion("1.4.0.0")]
53-
[assembly: AssemblyFileVersion("1.4.0.0")]
52+
[assembly: AssemblyVersion("2017.11.21.0")]
53+
[assembly: AssemblyFileVersion("2017.11.21.0")]

Source/NETworkManager/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
<data name="License_MIT" xml:space="preserve">
187187
<value>MIT License</value>
188188
</data>
189+
<data name="NETworkManager_DocumentationUrl" xml:space="preserve">
190+
<value>https://github.com/BornToBeRoot/NETworkManager/blob/master/Documentation/</value>
191+
</data>
189192
<data name="NETworkManager_LicenseUrl" xml:space="preserve">
190193
<value>https://github.com/BornToBeRoot/NETworkManager/blob/master/LICENSE</value>
191194
</data>

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@
288288
<system:String x:Key="String_Copy">Kopieren</system:String>
289289
<system:String x:Key="String_Expand">Erweitern</system:String>
290290
<system:String x:Key="String_AdjustScreenAutomatically">Bildschirm automatisch anpassen</system:String>
291-
291+
<system:String x:Key="String_ForkMeOnGitHub">Fork me on Github!</system:String>
292+
<system:String x:Key="String_Documentation">Dokumentation</system:String>
293+
<system:String x:Key="String_Version">Version</system:String>
294+
292295
<!-- Help message -->
293296
<system:String x:Key="String_HelpMessage_ParameterHelp">Zeigt diesen Dialog an.</system:String>
294297
<system:String x:Key="String_HelpMessage_ParameterResetSettings">Setzt alle Einstellungen zurück.</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@
288288
<system:String x:Key="String_Copy">Copy</system:String>
289289
<system:String x:Key="String_Expand">Expand</system:String>
290290
<system:String x:Key="String_AdjustScreenAutomatically">Adjust screen automatically</system:String>
291+
<system:String x:Key="String_ForkMeOnGitHub">Fork me on Github!</system:String>
292+
<system:String x:Key="String_Documentation">Documentation</system:String>
293+
<system:String x:Key="String_Version">Version</system:String>
291294

292295
<!-- Help message -->
293296
<system:String x:Key="String_HelpMessage_ParameterHelp">Displays this dialog.</system:String>

Source/NETworkManager/ViewModels/Settings/AboutViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public string Version
5454
public AboutViewModel()
5555
{
5656
CopyrightAndAuthor = string.Format("{0} {1}.", AssemblyManager.Current.Copyright, AssemblyManager.Current.Company);
57-
58-
Version = AssemblyManager.Current.AssemblyVersion.ToString();
5957
}
6058
#endregion
6159

0 commit comments

Comments
 (0)