public static PropertyValueEditor GetValueEditor(IEnumerable attributes, IMessageLogger exceptionLogger) { PropertyValueEditor propertyValueEditor = null; if (attributes != null) { foreach (Attribute attribute in attributes) { EditorAttribute editorAttribute = attribute as EditorAttribute; if (editorAttribute != null) { try { Type editorType = Type.GetType(editorAttribute.EditorTypeName); if (editorType != null && typeof(PropertyValueEditor).IsAssignableFrom(editorType)) { propertyValueEditor = (PropertyValueEditor)Activator.CreateInstance(editorType); break; } } catch (Exception e) { if (exceptionLogger != null) { exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.ValueEditorLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); } } } } } return propertyValueEditor; }
public static PropertyValueEditor GetValueEditor(IEnumerable attributes, IMessageLogger exceptionLogger) { PropertyValueEditor propertyValueEditor = null; if (attributes != null) { foreach (Attribute attribute in attributes) { EditorAttribute editorAttribute = attribute as EditorAttribute; if (editorAttribute != null) { try { Type editorType = Type.GetType(editorAttribute.EditorTypeName); if (editorType != null && typeof(PropertyValueEditor).IsAssignableFrom(editorType)) { propertyValueEditor = (PropertyValueEditor)Activator.CreateInstance(editorType); break; } } catch (Exception e) { if (exceptionLogger != null) { exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.ValueEditorLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); } } } } } return(propertyValueEditor); }
public static Type GetCategoryEditorType(EditorAttribute attribute, IMessageLogger exceptionLogger) { try { Type editorType = Type.GetType(attribute.EditorTypeName); if (editorType != null && typeof(CategoryEditor).IsAssignableFrom(editorType)) { return editorType; } } catch (Exception e) { if (exceptionLogger != null) { exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryEditorTypeLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); } } return null; }
public static Type GetCategoryEditorType(EditorAttribute attribute, IMessageLogger exceptionLogger) { try { Type editorType = Type.GetType(attribute.EditorTypeName); if (editorType != null && typeof(CategoryEditor).IsAssignableFrom(editorType)) { return(editorType); } } catch (Exception e) { if (exceptionLogger != null) { exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryEditorTypeLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); } } return(null); }