private void OnOpenButtonClick(object sender, RoutedEventArgs e) { editorReceiver.Clear(); Editor.OpenFileCommand command = new Editor.OpenFileCommand(editorReceiver); editorInvoker.Invoke(command); // If nothing was opened it was not a lilypond file. In that case, throw it through the builder. if (editorReceiver.GetFilePath() == null || editorReceiver.GetFilePath() == "") { filePathTextBox.Text = command.selectedFilePath; currentScore = scoreBuilder.BuildScoreFromFile(filePathTextBox.Text); // If still nothing it was an invalid/unsupported file/file type. if (currentScore == null) { MessageBox.Show("Invalid or unsupported file/file type."); return; } } else { filePathTextBox.Text = editorReceiver.GetFilePath(); currentScore = lilyPondScoreBuilder.BuildScoreFromString(editorReceiver.GetContent()); } FillScoreViewer(currentScore); }
// Constructor public SaveAsLilyPondCommand(Receiver receiver) : base(receiver) { content = receiver.GetContent(); }
// Constructor public SaveAsPdfCommand(Receiver receiver) : base(receiver) { content = receiver.GetContent(); }