public bool IsEqual(object compare, object to) { var left = compare as ISmartReference; var right = to as string; if (left == null && right == null) return true; if (left == null || right == null) return false; return left.Name == right; }