本文整理汇总了C#中Microsoft.CSharp.RuntimeBinder.Semantics.TypeArray.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# TypeArray.Equals方法的具体用法?C# TypeArray.Equals怎么用?C# TypeArray.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CSharp.RuntimeBinder.Semantics.TypeArray
的用法示例。
在下文中一共展示了TypeArray.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubstEqualTypeArrays
public bool SubstEqualTypeArrays(TypeArray taDst, TypeArray taSrc, TypeArray typeArgsCls, TypeArray typeArgsMeth, SubstTypeFlags grfst)
{
// Handle the simple common cases first.
if (taDst == taSrc || (taDst != null && taDst.Equals(taSrc)))
{
// The following assertion is not always true and indicates a problem where
// the signature of override method does not match the one inherited from
// the base class. The method match we have found does not take the type
// arguments of the base class into account. So actually we are not overriding
// the method that we "intend" to.
// Debug.Assert(taDst == SubstTypeArray(taSrc, typeArgsCls, typeArgsMeth, grfst));
return true;
}
if (taDst.Size != taSrc.Size)
return false;
if (taDst.Size == 0)
return true;
var ctx = new SubstContext(typeArgsCls, typeArgsMeth, grfst);
if (ctx.FNop())
return false;
for (int i = 0; i < taDst.size; i++)
{
if (!SubstEqualTypesCore(taDst.Item(i), taSrc.Item(i), ctx))
return false;
}
return true;
}