本文整理汇总了C#中IMessageLogger.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageLogger.WriteLine方法的具体用法?C# IMessageLogger.WriteLine怎么用?C# IMessageLogger.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessageLogger
的用法示例。
在下文中一共展示了IMessageLogger.WriteLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValueEditor
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;
}
示例2: GetCategoryEditorType
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;
}