示例#1
0
        // I had to add this for some reason to fix a problem caused by a bug
        // in Mono that was causing serialization to fail.
        protected ManifestFileInfo(
            SerializationInfo info,
            StreamingContext context) :
            base(
                info.GetString("ManifestObjectInfo+<Name>k__BackingField"),
                (ManifestDirectoryInfo)
                info.GetValue(
                    "ManifestObjectInfo+<ParentDirectory>k__BackingField",
                    typeof(ManifestDirectoryInfo)))
        {
            FileLength      = info.GetInt64("<FileLength>k__BackingField");
            LastModifiedUtc = info.GetDateTime("<LastModifiedUtc>k__BackingField");

            try
            {
                RegisteredUtc = info.GetDateTime("<RegisteredUtc>k__BackingField");
            }
            catch (Exception) { }

            try
            {
                FileHash = (FileHash)info.GetValue("<FileHash>k__BackingField", typeof(FileHash));
            }
            catch (Exception) { }
        }
示例#2
0
        public FileHash(FileHash orig)
        {
            HashData = orig.HashData;
            HashType = orig.HashType;

            myObjectHashIsSet = orig.myObjectHashIsSet;
            myObjectHash      = orig.myObjectHash;
        }
示例#3
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            if ((obj is FileHash) == false)
            {
                return(false);
            }

            FileHash other = (FileHash)obj;

            if (other.HashType != HashType)
            {
                return(false);
            }

            return(HashData.SequenceEqual(other.HashData));
        }