zaaReloaded2/zaaReloaded2/ViewModels/AboutViewModel.cs

161 lines
4.0 KiB
C#
Executable File

/* AboutViewModel.cs
* part of zaaReloaded2
*
* Copyright 2015-2017 Daniel Kraus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bovender.Mvvm.ViewModels;
using Bovender.Mvvm;
using System.Diagnostics;
namespace zaaReloaded2.ViewModels
{
class AboutViewModel : ViewModelBase
{
#region Properties
public string AddinName
{
get
{
return Properties.Settings.Default.AddinName;
}
}
public string PubYear
{
get
{
string year = Properties.Settings.Default.PubYear;
if (year == "2015")
{
return year;
}
else
{
return "2015-" + year;
}
}
}
public string CopyrightString
{
get
{
return String.Format("© Copyright {0} {1}",
PubYear,
Properties.Settings.Default.Authors);
}
}
public string Version
{
get
{
return zaaReloaded2.Updater.Version.Current.ToString();
}
}
public string Homepage
{
get
{
return Properties.Settings.Default.Homepage.ToString();
}
}
public string Repository
{
get
{
return Properties.Settings.Default.Repository.ToString();
}
}
public string LicenseUrl
{
get
{
return Properties.Settings.Default.LicenseUrl.ToString();
}
}
#endregion
#region Commands
public DelegatingCommand GotoHomepageCommand
{
get
{
if (_gotoHomepageCommand == null)
{
_gotoHomepageCommand = new DelegatingCommand(
param => { Process.Start(new ProcessStartInfo(Homepage)); });
}
return _gotoHomepageCommand;
}
}
public DelegatingCommand GotoRepositoryCommand
{
get
{
if (_gotoRepositoryCommand == null)
{
_gotoRepositoryCommand = new DelegatingCommand(
param => { Process.Start(new ProcessStartInfo(Repository)); });
}
return _gotoRepositoryCommand;
}
}
public DelegatingCommand GotoLicenseCommand
{
get
{
if (_gotoLicenseCommand == null)
{
_gotoLicenseCommand = new DelegatingCommand(
param => { Process.Start(new ProcessStartInfo(LicenseUrl)); });
}
return _gotoLicenseCommand;
}
}
#endregion
#region ViewModelBase implementation
public override object RevealModelObject()
{
throw new NotImplementedException();
}
#endregion
#region Fields
DelegatingCommand _gotoHomepageCommand;
DelegatingCommand _gotoRepositoryCommand;
DelegatingCommand _gotoLicenseCommand;
#endregion
}
}