public override void Execute(ActionOption actionOption, Func <string, string> openPathCallBack, Func <string, string> savePathCallBack, string parameter = null, string parameter2 = null) { if (CanExecute(actionOption)) { FileHandleFacade.SaveFile(savePathCallBack.Invoke("Lilypond|*.ly"), parameter2); } else { Next.Execute(actionOption, openPathCallBack, savePathCallBack, parameter, parameter2); } }
public Command BuildCommands(FileHandleFacade fileHandlerFacade) { Command first = new AddClefTrebleCommand(fileHandlerFacade); Command second = new AddTempoCommand(fileHandlerFacade); Command third = new AddTimeCommand(fileHandlerFacade); Command fourth = new OpenFileCommand(fileHandlerFacade); Command fifth = new SaveAsLilyPondCommand(fileHandlerFacade); Command sixth = new SaveAsPdfCommand(fileHandlerFacade); Command backStop = new Command(fileHandlerFacade); first.Next = second; second.Next = third; third.Next = fourth; fourth.Next = fifth; fifth.Next = sixth; sixth.Next = backStop; return(first); }
public override void Execute(ActionOption actionOption, Func <string, string> openPathCallBack, Func <string, string> savePathCallBack, string parameter = null, string parameter2 = null) { if (CanExecute(actionOption)) { string path; if (parameter == null) { path = openPathCallBack.Invoke(null); } else { path = parameter; } OwnEventmanager.Manager.DispatchEvent("changeFilePath", path); FileHandleFacade.Load(path); } else { Next.Execute(actionOption, openPathCallBack, savePathCallBack, parameter, parameter2); } }
public AddClefTrebleCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.AddClefTreble; }
public SaveAsLilyPondCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.SaveAsLilyPond; }
public SaveAsPdfCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.SaveAsPdf; }
/// <summary> /// Constructor /// </summary> public StaffsViewModel(FileHandleFacade fileHandleFacade) { this.fileHandleFacade = fileHandleFacade; Staffs = new ObservableCollection <MusicalSymbol>(); OwnEventmanager.Manager.Subscribe("setStaffs", SetStaffs); }
public AddTempoCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.AddTempo; }
public AddTimeCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.AddTime; }
public OpenFileCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade) { ActionOption = ActionOption.OpenFile; }
public Command(FileHandleFacade fileHandleFacade) { FileHandleFacade = fileHandleFacade; }