//
// Copyright 2014 Perforce Software Inc.
//
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Controls;
namespace Perforce.View {
///
/// Interaction logic for About.xaml
///
public partial class About : UserControl {
private Dictionary licenses;
public About() {
InitializeComponent();
SetupLicenses();
LicenseSelector.ItemsSource = licenses.Keys;
VersionInfo.Content = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
private void SetupLicenses() {
licenses = new Dictionary();
licenses.Add("Log4Net", Properties.Resources.log4net);
licenses.Add("Newtonsoft Json", Properties.Resources.Newtonsoft_Json);
licenses.Add("WPF Dialog Manager", Properties.Resources.TechnewlogicWpfDialogManagement);
licenses.Add("WPF Animated Gif", Properties.Resources.WpfAnimatedGif);
}
private void LicenseSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) {
var chooser = sender as ComboBox;
if (chooser != null) {
var choice = chooser.SelectedItem as string;
if (choice != null) {
LicenseInfo.Text = licenses[choice];
}
}
}
}
}