コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
ファイル: ScriptRef.cs プロジェクト: emrahoner/CsQuery
        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);
            }
        }
コード例 #5
0
ファイル: ScriptRef.cs プロジェクト: emrahoner/CsQuery
        /// <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;
        }