public OpenFileArguments(ISupportedFileDefinition fileDefinition, string path, Guid choosenEditor = default(Guid)) { FileDefinition = fileDefinition; Path = path; if (fileDefinition == null) { Editor = Guid.Empty; } else { Editor = choosenEditor == Guid.Empty ? fileDefinition.PreferredEditor : choosenEditor; } }
public override IEditor GetAssociatedEditor(ISupportedFileDefinition association) { var id = Guid.Empty; foreach (var cachedAssociation in CachedAssociations) { foreach (var definition in cachedAssociation.Value.CreateWithDefaultExtension) { if (!definition.Extension.Equals(association.FileExtension)) { continue; } id = new Guid(cachedAssociation.Key); break; } } return(id == Guid.Empty ? null : Editors.FirstOrDefault(x => x.EditorId == id)); }
public SaveFileArguments(string fullFilePath, string fileName, ISupportedFileDefinition fileDefinition) { FullFilePath = fullFilePath; FileName = fileName; FileDefinition = fileDefinition; }
public NewFileArguments(ISupportedFileDefinition fileDefinition, string name, Guid choosenEditor = default(Guid)) { FileDefinition = fileDefinition ?? throw new ArgumentNullException(); FileName = name; Editor = choosenEditor == Guid.Empty ? fileDefinition.PreferredEditor : choosenEditor; }
public void CreateAssociation(IEditor editor, ISupportedFileDefinition association) { CreateAssociations(editor, new List <ISupportedFileDefinition> { association }); }
public abstract IEditor GetAssociatedEditor(ISupportedFileDefinition association);