Beispiel #1
0
        /// <summary>
        /// Returns true if the given cache entry contains equivalent contents
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        internal override bool IsEquivalent(CacheEntry other)
        {
            if ((other == null) || (other.GetType() != this.GetType()))
            {
                return(false);
            }

            BuildItemCacheEntry otherEntry = (BuildItemCacheEntry)other;

            if (this.Name != otherEntry.Name)
            {
                return(false);
            }

            if ((this.BuildItems == null && otherEntry.BuildItems != null) ||
                (this.BuildItems != null && otherEntry.BuildItems == null))
            {
                return(false);
            }

            if ((this.BuildItems == null) && (otherEntry.BuildItems == null))
            {
                return(true);
            }

            if (this.BuildItems.Length != otherEntry.BuildItems.Length)
            {
                return(false);
            }

            for (int i = 0; i < this.BuildItems.Length; i++)
            {
                if ((this.BuildItems[i] == null && otherEntry.BuildItems[i] != null) ||
                    (this.BuildItems[i] != null && otherEntry.BuildItems[i] == null))
                {
                    return(false);
                }

                if ((this.BuildItems[i].FinalItemSpecEscaped != otherEntry.BuildItems[i].FinalItemSpecEscaped) ||
                    (this.BuildItems[i].GetCustomMetadataCount() != otherEntry.BuildItems[i].GetCustomMetadataCount()))
                {
                    return(false);
                }

                ArrayList otherEntryMetadataNames = new ArrayList(otherEntry.BuildItems[i].GetAllCustomMetadataNames());

                foreach (string metadataName in this.BuildItems[i].GetAllCustomMetadataNames())
                {
                    if ((!otherEntryMetadataNames.Contains(metadataName)) ||
                        (this.BuildItems[i].GetEvaluatedMetadataEscaped(metadataName) != otherEntry.BuildItems[i].GetEvaluatedMetadataEscaped(metadataName)))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Returns true if the given cache entry contains equivalent contents
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        internal override bool IsEquivalent(CacheEntry other)
        {
            if ((other == null) || (other.GetType() != this.GetType()))
            {
                return(false);
            }

            if (!base.IsEquivalent(other))
            {
                return(false);
            }

            return(this.BuildResult == ((BuildResultCacheEntry)other).BuildResult);
        }
Beispiel #3
0
        /// <summary>
        /// Returns true if the given cache entry contains equivalent contents
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        internal override bool IsEquivalent(CacheEntry other)
        {
            if ((other == null) || (other.GetType() != this.GetType()))
            {
                return(false);
            }

            PropertyCacheEntry otherEntry = (PropertyCacheEntry)other;

            if (this.Name != otherEntry.Name)
            {
                return(false);
            }

            return(this.Value == otherEntry.Value);
        }
Beispiel #4
0
        internal static void WriteToStream(CacheEntry entry, BinaryWriter writer)
        {
            Type entryType = entry.GetType();

            if (typeof(BuildItemCacheEntry) == entryType)
            {
                writer.Write((byte)CacheEntryTypes.BuildItem);
                entry.WriteToStream(writer);
            }
            else if (typeof(BuildResultCacheEntry) == entryType)
            {
                writer.Write((byte)CacheEntryTypes.BuildResult);
                entry.WriteToStream(writer);
            }
            else if (typeof(PropertyCacheEntry) == entryType)
            {
                writer.Write((byte)CacheEntryTypes.Property);
                entry.WriteToStream(writer);
            }
        }