本文整理汇总了C#中Mono.Cecil.CustomAttribute.IsUriStringConstructor方法的典型用法代码示例。如果您正苦于以下问题:C# CustomAttribute.IsUriStringConstructor方法的具体用法?C# CustomAttribute.IsUriStringConstructor怎么用?C# CustomAttribute.IsUriStringConstructor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.CustomAttribute
的用法示例。
在下文中一共展示了CustomAttribute.IsUriStringConstructor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTermUriInjectMethod
private Action<ILProcessor> GetTermUriInjectMethod(CustomAttribute dictionaryAttribute)
{
if (dictionaryAttribute.IsQNameConstructor())
{
string prefix = dictionaryAttribute.ConstructorArguments[0].Value.ToString();
string term = dictionaryAttribute.ConstructorArguments[1].Value.ToString();
return processor => InjectCollectionAsQName(processor, prefix, term);
}
if (dictionaryAttribute.IsUriStringConstructor())
{
string uriString = dictionaryAttribute.ConstructorArguments[0].Value.ToString();
return processor => InjectCollectionAsUri(processor, uriString);
}
throw new InvalidOperationException("Unrecognized DictionaryAttribute constructor");
}
示例2: GetPropertyMappingCode
private Action<ILProcessor> GetPropertyMappingCode(CustomAttribute attribute)
{
if (attribute == null)
{
return null;
}
if (attribute.IsQNameConstructor())
{
string prefix = attribute.ConstructorArguments[0].Value.ToString();
string term = attribute.ConstructorArguments[1].Value.ToString();
return processor => InjectPropertyAsQName(processor, prefix, term);
}
if (attribute.IsUriStringConstructor())
{
string uriString = attribute.ConstructorArguments[0].Value.ToString();
return processor => InjectPropertyAsUri(processor, uriString);
}
throw new InvalidOperationException(string.Format("Unrecognized '{0}' constructor", attribute.AttributeType.FullName));
}