コード例 #1
0
ファイル: FileRef.cs プロジェクト: grappachu/apps.movideo
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Path?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ LastModifiedUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ Bytes.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StringComparer.OrdinalIgnoreCase.GetHashCode(FullFilePath);
         hashCode = (hashCode * 397) ^ LastModifiedUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ Fingerprint.GetHashCode();
         hashCode = (hashCode * 397) ^ WasCached.GetHashCode();
         return(hashCode);
     }
 }
コード例 #3
0
        public bool Equals(FileFingerprint other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(string.Equals(FullFilePath, other.FullFilePath, StringComparison.OrdinalIgnoreCase) &&
                   LastModifiedUtc.Equals(other.LastModifiedUtc) &&
                   Fingerprint.Equals(other.Fingerprint));
        }
コード例 #4
0
ファイル: File.cs プロジェクト: MShaffar19/bion
        public override int GetHashCode()
        {
            int result = 17;

            unchecked
            {
                if (ParentFolderIndex != default(int))
                {
                    result = (result * 31) + ParentFolderIndex.GetHashCode();
                }

                if (Name != default(string))
                {
                    result = (result * 31) + Name.GetHashCode();
                }

                if (LastModifiedUtc != default(DateTime))
                {
                    result = (result * 31) + LastModifiedUtc.GetHashCode();
                }

                if (CreatedUtc != default(DateTime))
                {
                    result = (result * 31) + CreatedUtc.GetHashCode();
                }

                if (Attributes != default(System.IO.FileAttributes))
                {
                    result = (result * 31) + Attributes.GetHashCode();
                }

                if (Length != default(long))
                {
                    result = (result * 31) + Length.GetHashCode();
                }
            }

            return(result);
        }
コード例 #5
0
ファイル: FileRef.cs プロジェクト: grappachu/apps.movideo
 public bool Equals(FileRef other)
 {
     return(string.Equals(Path, other.Path) && LastModifiedUtc.Equals(other.LastModifiedUtc) &&
            Bytes == other.Bytes);
 }
コード例 #6
0
        internal virtual string ToString(bool verbose)
        {
            StringBuilder sb = new StringBuilder(512);

            sb.Append("\r\nIsPrivateEntry   = ").Append(IsPrivateEntry);
            sb.Append("\r\nIsPartialEntry   = ").Append(IsPartialEntry);
            sb.Append("\r\nStreamSize       = ").Append(StreamSize);
            sb.Append("\r\nExpires          = ").Append(ExpiresUtc == DateTime.MinValue? "": ExpiresUtc.ToString("r", CultureInfo.CurrentCulture));
            sb.Append("\r\nLastAccessed     = ").Append(LastAccessedUtc == DateTime.MinValue? "": LastAccessedUtc.ToString("r", CultureInfo.CurrentCulture));
            sb.Append("\r\nLastModified     = ").Append(LastModifiedUtc == DateTime.MinValue? "": LastModifiedUtc.ToString("r", CultureInfo.CurrentCulture));
            sb.Append("\r\nLastSynchronized = ").Append(LastSynchronizedUtc == DateTime.MinValue? "": LastSynchronizedUtc.ToString("r", CultureInfo.CurrentCulture));
            sb.Append("\r\nMaxStale(sec)    = ").Append(MaxStale == TimeSpan.MinValue? "": ((int)MaxStale.TotalSeconds).ToString(NumberFormatInfo.CurrentInfo));
            sb.Append("\r\nHitCount         = ").Append(HitCount.ToString(NumberFormatInfo.CurrentInfo));
            sb.Append("\r\nUsageCount       = ").Append(UsageCount.ToString(NumberFormatInfo.CurrentInfo));
            sb.Append("\r\n");
            if (verbose)
            {
                sb.Append("EntryMetadata:\r\n");
                if (m_EntryMetadata != null)
                {
                    foreach (string s in m_EntryMetadata)
                    {
                        sb.Append(s).Append("\r\n");
                    }
                }
                sb.Append("---\r\nSystemMetadata:\r\n");
                if (m_SystemMetadata != null)
                {
                    foreach (string s in m_SystemMetadata)
                    {
                        sb.Append(s).Append("\r\n");
                    }
                }
            }
            return(sb.ToString());
        }