Class EditorService
Service for getting an IProjectItemDocument as editor.
[Export(typeof(IEditorService))]
public class EditorService : IEditorService
- Inheritance
-
EditorService
- Implements
- Inherited Members
Remarks
This service depends on the extension of the Name.
Constructors
EditorService(IEditorFactory[])
Initializes a new instance of the EditorService class.
[ImportingConstructor]
public EditorService(IEditorFactory[] editorFactories)
Parameters
editorFactories
IEditorFactory[]Imported editor factories.
Methods
GetEditor(IProjectItem, IScriptShell)
Gets the editor over its IEditorFactory.
public IProjectItemDocument GetEditor(IProjectItem item, IScriptShell parentShell)
Parameters
item
IProjectItemProject item with.
parentShell
IScriptShellShell where the editor belongs to.
Returns
- IProjectItemDocument
IProjectItemDocument as editor for the IProjectItem.
Exceptions
- InvalidOperationException
Thrown when no IEditorFactory is found.
- ArgumentNullException
Thrown when
item
orparentShell
is null.
HasEditor(IProjectItem)
Gets an value indicating whether there is an editor factory for the item.
public bool HasEditor(IProjectItem item)
Parameters
item
IProjectItemItem to check.
Returns
- bool
True if this project item has an editor.
Exceptions
- ArgumentNullException
Thrown when
item
is null.