public void Clear() { if (currentEditor != null) { currentEditor.Dispose(); currentEditor = null; } target = null; }
Task <IObjectEditor> IEditorProvider.GetObjectEditorAsync(object item) { target = item as ComponentModelTarget; if (target == null) { throw new ArgumentException(string.Format("Cannot get editor for type {0} only ComponentModelObjectEditor types are allowed", item.GetType().Name)); } if (currentEditor != null) { currentEditor.PropertyChanged -= CurrentEditor_PropertyChanged; } currentEditor = new ComponentModelObjectEditor(target); currentEditor.PropertyChanged += CurrentEditor_PropertyChanged; //on each editor we store current used providers return(Task.FromResult <IObjectEditor>(currentEditor)); }
public Task <AssignableTypesResult> GetAssignableTypesAsync(ITypeInfo type, bool childTypes) => ComponentModelObjectEditor.GetAssignableTypes();