JD2022-TU1/main/tools/apps/DataFileAnalyzer/Commands/GoForwardCommand.cs

32 lines
825 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UAF.WPF.Commands;
namespace DataFileAnalyzer.Commands
{
public class GoForwardCommand : BaseCommand
{
public override bool CanExecute(object parameter)
{
DataFileAnalyzerModel model = parameter as DataFileAnalyzerModel;
if (model != null)
{
return model.FileHistory.CanGoForward;
}
return false;
}
public override void Execute(object parameter)
{
DataFileAnalyzerModel model = parameter as DataFileAnalyzerModel;
if (model != null)
{
if (model.FileHistory.CanGoForward)
model.FileHistory.Forward();
}
}
}
}