38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using UAF.Application;
|
|
using UAF.WPF.Commands;
|
|
|
|
using ConfigurePlus.Models;
|
|
|
|
namespace ConfigurePlus.Commands
|
|
{
|
|
class SwitchProjectCommand : BaseCommand
|
|
{
|
|
public override bool CanExecute(object parameter)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override void Execute(object parameter)
|
|
{
|
|
MainViewModel mainModel = Workspace.This.FirstDocument as MainViewModel;
|
|
if (mainModel != null)
|
|
{
|
|
ProjectViewModel project = parameter as ProjectViewModel;
|
|
if (project != null)
|
|
{
|
|
if (project != mainModel.SelectedProject)
|
|
{
|
|
mainModel.SelectedProject = project;
|
|
mainModel.UpdateProjectInRegistry();
|
|
//Workspace.This.Logger.NotifyUser("Project change successful! ", "You are now using " + project.Name + " project settings. ");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|