// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // The About View Model // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.ViewModels { using System.ComponentModel.Composition; using Caliburn.Micro; using HandBrake.ApplicationServices; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; /// /// The About View Model /// [Export(typeof(IAboutViewModel))] public class AboutViewModel : ViewModelBase, IAboutViewModel { /// /// Backing Field for the User setting service. /// private readonly IUserSettingService userSettingService; /// /// Initializes a new instance of the class. /// /// /// The window manager. /// /// /// The user Setting Service. /// public AboutViewModel(IWindowManager windowManager, IUserSettingService userSettingService) : base(windowManager) { this.userSettingService = userSettingService; } /// /// Gets Version. /// public string Version { get { string nightly = userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty; return string.Format( "{0} ({1}) {2}", userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild), nightly); } } /// /// Close this window. /// public void Close() { this.TryClose(); } } }