本文整理汇总了C#中System.Reflection.ParameterInfo.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterInfo.GetType方法的具体用法?C# ParameterInfo.GetType怎么用?C# ParameterInfo.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.ParameterInfo
的用法示例。
在下文中一共展示了ParameterInfo.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAccountOverrideOrNull
/// <summary>
/// Walk from the parameter up to the containing type, looking for a
/// <see cref="StorageAccountAttribute"/>. If found, return the account.
/// </summary>
internal static string GetAccountOverrideOrNull(ParameterInfo parameter)
{
if (parameter == null ||
parameter.GetType() == typeof(AttributeBindingSource.FakeParameterInfo))
{
return null;
}
StorageAccountAttribute attribute = parameter.GetCustomAttribute<StorageAccountAttribute>();
if (attribute != null)
{
return attribute.Account;
}
attribute = parameter.Member.GetCustomAttribute<StorageAccountAttribute>();
if (attribute != null)
{
return attribute.Account;
}
attribute = parameter.Member.DeclaringType.GetCustomAttribute<StorageAccountAttribute>();
if (attribute != null)
{
return attribute.Account;
}
return null;
}
示例2: ParametersAreEqual
protected bool ParametersAreEqual(ParameterInfo parameter1, ParameterInfo parameter2)
{
return parameter1.Name == parameter2.Name
&& parameter1.Position == parameter2.Position
&& parameter1.GetType() == parameter2.GetType()
&& parameter1.IsOut == parameter2.IsOut
&& parameter1.IsOptional == parameter2.IsOptional;
}
示例3: GetDefaultParameterValue
internal static object GetDefaultParameterValue(ParameterInfo parameter)
{
if (!(parameter.GetType().Assembly == typeof(TypeReferences).Assembly) && parameter.Member.DeclaringType.Assembly.ReflectionOnly)
{
return parameter.RawDefaultValue;
}
return parameter.DefaultValue;
}
示例4: IsDefined
internal static bool IsDefined(ParameterInfo target, Type caType, bool inherit) {
// JScript implements subclasses of ParameterInfo which throw an exception when Module is
// accessed. We know that none of these are from a ReflectionOnly assembly.
Type t = target.GetType();
if (t.Assembly == typeof(CustomAttribute).Assembly || !target.Member.Module.Assembly.ReflectionOnly)
return target.IsDefined(caType, inherit);
return CustomAttribute.CheckForCustomAttribute(CustomAttributeData.GetCustomAttributes(target), caType);
}
示例5: FromParameterInfo
internal static Parameter FromParameterInfo(ParameterInfo parameterInfo)
{
return new Parameter(parameterInfo.GetType(), parameterInfo.ParameterType, parameterInfo.Name);
}
示例6: AddParameterChildren
protected override void AddParameterChildren (NodeInfoCollection c, NodeInfo parent, ParameterInfo param)
{
AddSubnodes (c, parent, param.GetType(), param);
}
示例7: IsDefined
internal static bool IsDefined(ParameterInfo target, Type caType, bool inherit)
{
if (!(target.GetType().Assembly == typeof(Microsoft.JScript.CustomAttribute).Assembly) && target.Member.Module.Assembly.ReflectionOnly)
{
return CheckForCustomAttribute(CustomAttributeData.GetCustomAttributes(target), caType);
}
return target.IsDefined(caType, inherit);
}