本文整理汇总了C#中IMethodDefinition.FullName方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodDefinition.FullName方法的具体用法?C# IMethodDefinition.FullName怎么用?C# IMethodDefinition.FullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethodDefinition
的用法示例。
在下文中一共展示了IMethodDefinition.FullName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParamNamesMatch
private bool ParamNamesMatch(IDifferences differences, IMethodDefinition implMethod, IMethodDefinition contractMethod)
{
int paramCount = implMethod.ParameterCount;
Contract.Assert(paramCount == contractMethod.ParameterCount);
IParameterDefinition[] implParams = implMethod.Parameters.ToArray();
IParameterDefinition[] contractParams = contractMethod.Parameters.ToArray();
bool match = true;
for (int i = 0; i < paramCount; i++)
{
IParameterDefinition implParam = implParams[i];
IParameterDefinition contractParam = contractParams[i];
if (!implParam.Name.Value.Equals(contractParam.Name.Value))
{
differences.AddIncompatibleDifference(this,
"Parameter name on member '{0}' is '{1}' in the implementation but '{2}' in the contract.",
implMethod.FullName(), implParam.Name.Value, contractParam.Name.Value);
match = false;
}
}
return match;
}
示例2: ParamModifiersMatch
private bool ParamModifiersMatch(IDifferences differences, IMethodDefinition implMethod, IMethodDefinition contractMethod)
{
int paramCount = implMethod.ParameterCount;
Contract.Assert(paramCount == contractMethod.ParameterCount);
if (paramCount == 0)
return true;
IParameterDefinition[] implParams = implMethod.Parameters.ToArray();
IParameterDefinition[] contractParams = contractMethod.Parameters.ToArray();
bool match = true;
for (int i = 0; i < paramCount; i++)
{
IParameterDefinition implParam = implParams[i];
IParameterDefinition contractParam = contractParams[i];
//TODO: Do we care about the compatibility with marshalling attributes Out\In? They don't seem to be set consistently.
if (GetModifier(implParam) != GetModifier(contractParam))
{
differences.AddIncompatibleDifference(this,
"Modifiers on parameter '{0}' on method '{1}' are '{2}' in the implementation but '{3}' in the contract.",
implParam.Name.Value, implMethod.FullName(), GetModifier(implParam), GetModifier(contractParam));
match = false;
}
// Now check custom modifiers, primarily focused on const & volatile
if (implParam.IsModified || contractParam.IsModified)
{
var union = implParam.CustomModifiers.Union(contractParam.CustomModifiers);
if (implParam.CustomModifiers.Count() != union.Count())
{
differences.AddIncompatibleDifference(this,
"Custom modifiers on parameter '{0}' on method '{1}' are '{2}' in the implementation but '{3}' in the contract.",
implParam.Name.Value, implMethod.FullName(), PrintCustomModifiers(implParam.CustomModifiers), PrintCustomModifiers(contractParam.CustomModifiers));
match = false;
}
}
}
return match;
}