47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using UAF.WPF.Commands;
|
|
using UAF.Application;
|
|
using ConfigurePlus.Models;
|
|
|
|
namespace ConfigurePlus.Commands
|
|
{
|
|
public class OpenEnginePathCommand : BaseCommand
|
|
{
|
|
public override bool CanExecute(object parameter)
|
|
{
|
|
MainViewModel mainModel = Workspace.This.FirstDocument as MainViewModel;
|
|
if (mainModel != null)
|
|
{
|
|
if (mainModel.SelectedProject != null)
|
|
{
|
|
if (mainModel.SelectedProject.EnginePath != null)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override void Execute(object parameter)
|
|
{
|
|
MainViewModel mainModel = Workspace.This.FirstDocument as MainViewModel;
|
|
if (mainModel != null)
|
|
{
|
|
if (mainModel.SelectedProject != null)
|
|
{
|
|
if (mainModel.SelectedProject.EnginePath != null)
|
|
{
|
|
Process.Start(mainModel.SelectedProject.EnginePath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|