/// <summary> /// Helper method to fetch the editing API for an IPropertyEditor. /// </summary> private static IPropertyEditorEditAPI GetEditingAPI(IPropertyEditor editor) { var api = editor as IPropertyEditorEditAPI; if (api == null) { throw new InvalidOperationException(string.Format("Type {0} needs to extend " + "IPropertyEditorEditAPI", editor.GetType())); } return(api); }