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);
     }
 }
示例#2
0
        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);
        }
示例#3
0
 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);
 }
示例#8
0
 public AddTempoCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade)
 {
     ActionOption = ActionOption.AddTempo;
 }
示例#9
0
 public AddTimeCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade)
 {
     ActionOption = ActionOption.AddTime;
 }
示例#10
0
 public OpenFileCommand(FileHandleFacade fileHandleFacade) : base(fileHandleFacade)
 {
     ActionOption = ActionOption.OpenFile;
 }
 public Command(FileHandleFacade fileHandleFacade)
 {
     FileHandleFacade = fileHandleFacade;
 }