public CompareForEquality ( IValue left, IValue right ) : bool | ||
left | IValue | |
right | IValue | |
Résultat | bool |
public override bool CompareForEquality(IValue left, IValue right)
{
bool retVal = base.CompareForEquality(left, right);
if (!retVal)
{
if (left != null && right != null && left.Type == right.Type)
{
StructureValue leftValue = left as StructureValue;
StructureValue rightValue = right as StructureValue;
if (leftValue != null && rightValue != null)
{
retVal = true;
foreach (KeyValuePair<string, IVariable> pair in leftValue.SubVariables)
{
IVariable leftVar = pair.Value;
IVariable rightVar = rightValue.GetVariable(pair.Key);
if (leftVar.Type != null)
{
retVal = leftVar.Type.CompareForEquality(leftVar.Value, rightVar.Value);
if (!retVal)
{
break;
}
}
}
}
}
}
return retVal;
}