/// <summary> /// Determines whether the specified <see cref="T:System.Object" /> is equal to the current /// <see cref="T:System.Object" />. /// </summary> /// /// <param name="obj"> /// The object to compare with the current object. /// </param> /// /// <returns> /// true if the specified <see cref="T:System.Object" /> is equal to the current /// <see cref="T:System.Object" />; otherwise, false. /// </returns> public override bool Equals(object obj) { ScriptRef other = obj as ScriptRef; return(other != null && Path == other.Path); }
/// <summary> /// Updates this script reference's details from another equivalent reference. (Will fail if they do not have the same name). /// </summary> /// /// <param name="other"> /// The other script reference. /// </param> public void UpdateFrom(ScriptRef other) { if (other == null || other.Name != Name) { throw new InvalidOperationException("The other script reference must have the same name as this one."); } ScriptHash = other.ScriptHash; Resolved = other.Resolved; Dependencies = new List <ScriptRef>(other.Dependencies); Path = other.Path; }
private static bool AreEqual(ScriptRef x, ScriptRef y) { bool xIsNull = ReferenceEquals(x, null); bool yIsNull = ReferenceEquals(y, null); if (xIsNull != yIsNull) { return(false); } else { return(xIsNull || x.Equals(y)); } }
private static bool AreEqual(ScriptRef x, ScriptRef y) { bool xIsNull = ReferenceEquals(x, null); bool yIsNull = ReferenceEquals(y, null); if (xIsNull != yIsNull) { return false; } else { return xIsNull || x.Equals(y); } }
/// <summary> /// Updates this script reference's details from another equivalent reference. (Will fail if they do not have the same name). /// </summary> /// /// <param name="other"> /// The other script reference. /// </param> public void UpdateFrom(ScriptRef other) { if (other == null || other.Path != Path) { throw new InvalidOperationException("The other script reference must have the same name as this one."); } ScriptHash = other.ScriptHash; Resolved = other.Resolved; Dependencies = new List<ScriptRef>(other.Dependencies); Path = other.Path; }