public bool Equals(JniValueMarshalerState value) { return(JniArgumentValue.Equals(value.JniArgumentValue) && ReferenceValue.Equals(value.ReferenceValue) && object.ReferenceEquals(PeerableValue, value.PeerableValue) && object.ReferenceEquals(Extra, value.Extra)); }
public bool Equals(JniValueMarshalerState other) { return(JniArgumentValue.Equals(other.JniArgumentValue) && ReferenceValue.Equals(other.ReferenceValue) && object.ReferenceEquals(PeerableValue, other.PeerableValue) && object.ReferenceEquals(Extra, other.Extra)); }
private bool AreDNsEqual(ReferenceValue dn1, ReferenceValue dn2, ManagementAgent ma, bool strictCompare) { if (strictCompare) { Tracer.TraceInformation("performing-strict-DN-comparison"); return(dn1.ToString() == dn2.ToString()); } else { Tracer.TraceInformation("performing-RFC-compliant-DN-comparison"); return(dn1.Equals(dn2)); } }
internal static bool Compare(MVEntry mventry, CSEntry csentry, string csattributeName, string mvattributeName) { ReferenceValue csval = null; ReferenceValue mvval = null; Attrib mvAttrib = mventry[mvattributeName]; if (csattributeName == "[DN]") { csval = csentry.DN; } else { Attrib csAttrib = csentry[csattributeName]; if (!csAttrib.IsPresent && !mvAttrib.IsPresent) { return(true); } if (csAttrib.IsPresent ^ mvAttrib.IsPresent) { return(false); } switch (csAttrib.DataType) { case AttributeType.Reference: csval = csAttrib.ReferenceValue; break; case AttributeType.String: csval = csentry.MA.CreateDN(csAttrib.StringValue); break; default: Tracer.TraceError("Can only compare string values as DNs"); return(false); } } if (mvAttrib.DataType != AttributeType.String) { Tracer.TraceError("Can only compare string values as DNs"); } mvval = csentry.MA.CreateDN(mvAttrib.StringValue); return(mvval.Equals(csval)); }
/// <summary> /// Determines whether the specified PropertyInstanceValueData is equal to the current PropertyInstanceValueData. /// </summary> /// <param name="that">The PropertyInstanceValueData to compare with the current object.</param> /// <returns>Returns true if the specified object has the same value type and same vale as the current PropertyInstanceValueData; otherwise false.</returns> public virtual bool Equals(PropertyInstanceValueData that) { // if that is null - not equal if (ReferenceEquals(that, null)) { return(false); } // if that is has same reference to me - equal if (ReferenceEquals(this, that)) { return(true); } // if that has a different value type than me - not equal if (ValueType != that.ValueType) { return(false); } // finally - if that has the same actual value as me - equal (otherwise, not equal) switch (ValueType) { case ValueTypeDefinitionData.Reference: return(ReferenceValue.Equals(that.ReferenceValue)); case ValueTypeDefinitionData.DateTime: return(DateTimeValue.Equals(that.DateTimeValue)); case ValueTypeDefinitionData.Bool: return(BoolValue == that.BoolValue); case ValueTypeDefinitionData.Float: return(FloatValue == that.FloatValue); case ValueTypeDefinitionData.Int: return(IntValue == that.IntValue); case ValueTypeDefinitionData.StringNonUnicode: return(StringNonUnicodeValue.Equals(that.StringNonUnicodeValue)); default: return(false); } }