public void AddAssociation( string extension, string description, string editorClass, SaveEditorCallback saveEditorCallback) { var association = new SaveFileAssociation() { Extension = extension, Description = description, EditorClass = editorClass, SaveEditorCallback = saveEditorCallback, }; AddAssociation(association); }
public bool TryGetSaveEditorCallback( string path, out SaveEditorCallback saveEditor) { if (Associations.TryGetValue( path, out var association)) { saveEditor = association.SaveEditorCallback; return(true); } else { saveEditor = null; return(false); } }
public void SaveFile( IEditor editor, string path, SaveEditorCallback saveEditor) { if (editor is null) { throw new ArgumentNullException(nameof(editor)); } if (saveEditor is null) { throw new ArgumentNullException(nameof(saveEditor)); } if (!TrySaveEditor(editor, path, saveEditor)) { return; } editor.Path = path; OnEditorSaved(new EditorEventArgs(editor)); }