public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.mid)
            {
                hashcode = (hashcode * 397) + Mid.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.modifiedTime)
            {
                hashcode = (hashcode * 397) + ModifiedTime.GetHashCode();
            }
            if (__isset.status)
            {
                hashcode = (hashcode * 397) + Status.GetHashCode();
            }
            if (__isset.settings)
            {
                hashcode = (hashcode * 397) + Settings.GetHashCode();
            }
            if (__isset.displayNameOverridden)
            {
                hashcode = (hashcode * 397) + DisplayNameOverridden.GetHashCode();
            }
        }
        return(hashcode);
    }
        public void ToXml(XmlWriter writer)
        {
            writer.WriteStartElement("modification");
            writer.WriteAttributeString("type", Type);
            writer.WriteElementString("filename", FileName);
            writer.WriteElementString("project", FolderName);
            writer.WriteElementString("date", ModifiedTime.ToString("yyyy-MM-dd HH:mm:ss"));
            writer.WriteElementString("user", UserName);
            writer.WriteElementString("comment", Comment);
            writer.WriteElementString("changeNumber", ChangeNumber.ToString());

            if (!(Version == null || Version.Length == 0))
            {
                writer.WriteElementString("version", Version);
            }

            if (Url != null)
            {
                writer.WriteElementString("url", Url);
            }

            if (_EmailAddress != null)
            {
                writer.WriteElementString("email", _EmailAddress);
            }

            writer.WriteEndElement();
        }
Exemple #3
0
 protected bool Equals(RemoteUrl other)
 {
     return(CentroidMs1 == other.CentroidMs1 && CentroidMs2 == other.CentroidMs2 &&
            Equals(LockMassParameters, other.LockMassParameters) && string.Equals(ServerUrl, other.ServerUrl) &&
            string.Equals(Username, other.Username) && ModifiedTime.Equals(other.ModifiedTime) &&
            string.Equals(EncodedPath, other.EncodedPath));
 }
 protected bool Equals(BaseEntityDto <TIdentity> other)
 {
     return(Id.Equals(other.Id) &&
            CreatedTime.ToString() == other.CreatedTime.ToString() &&
            ModifiedTime.ToString() == other.ModifiedTime.ToString() &&
            CanModify == other.CanModify);
 }
Exemple #5
0
    public int CompareTo(MediaToolInfo toolInfo)
    {
        if (toolInfo == null)
        {
            throw new ArgumentNullException(nameof(toolInfo));
        }

        int result = string.Compare(FileName, toolInfo.FileName, StringComparison.OrdinalIgnoreCase);

        if (result != 0)
        {
            return(result);
        }

        result = ModifiedTime.CompareTo(toolInfo.ModifiedTime);
        if (result != 0)
        {
            return(result);
        }

        result = Size.CompareTo(toolInfo.Size);
        if (result != 0)
        {
            return(result);
        }

        return(string.Compare(Version, toolInfo.Version, StringComparison.OrdinalIgnoreCase));
    }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Kind != null)
         {
             hashCode = hashCode * 59 + Kind.GetHashCode();
         }
         if (CreatedTime != null)
         {
             hashCode = hashCode * 59 + CreatedTime.GetHashCode();
         }
         if (ModifiedTime != null)
         {
             hashCode = hashCode * 59 + ModifiedTime.GetHashCode();
         }
         if (Author != null)
         {
             hashCode = hashCode * 59 + Author.GetHashCode();
         }
         if (Comments != null)
         {
             hashCode = hashCode * 59 + Comments.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #7
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         return((ModifiedTime.GetHashCode() * 397) ^ (FullPath != null ? FullPath.GetHashCode() : 0));
     }
 }
 /// <summary>
 ///     Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current <see cref="T:System.Object" />.</returns>
 public override int GetHashCode()
 {
     return(CreatedTime.GetHashCode()
            ^ DirectoryCount.GetHashCode()
            ^ FileCount.GetHashCode()
            ^ ModifiedTime.GetHashCode()
            ^ Size.GetHashCode());
 }
        public override bool Equals(object obj)
        {
            var info = obj as ApplicationFileInfo;

            return(info != null &&
                   Filepath == info.Filepath &&
                   Filesize == info.Filesize &&
                   ModifiedTime.ToString().Equals(info.ModifiedTime.ToString()));
        }
Exemple #10
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (Digest != null ? Digest.GetHashCode() : 0);
         result = (result * 397) ^ ModifiedTime.GetHashCode();
         result = (result * 397) ^ Size.GetHashCode();
         result = (result * 397) ^ (FileName != null ? FileName.GetHashCode() : 0);
         return(result);
     }
 }
Exemple #11
0
        public override bool Equals(object obj)
        {
            var info             = obj as ApplicationFileInfo;
            var preliminaryEqual =
                info != null &&
                FilePath == info.FilePath &&
                FileSize == info.FileSize;

            // check duration and allow 3 seconds leeway (accounting for FAT32 imprecise date/time property)
            return(preliminaryEqual && ModifiedTime.Subtract(info.ModifiedTime).Duration() < TimeSpan.FromSeconds(3));
        }
Exemple #12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CentroidMs1.GetHashCode();
         hashCode = (hashCode * 397) ^ CentroidMs2.GetHashCode();
         hashCode = (hashCode * 397) ^ (LockMassParameters != null ? LockMassParameters.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ServerUrl != null ? ServerUrl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ModifiedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (EncodedPath != null ? EncodedPath.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #13
0
        public byte[] ToBytes()
        {
            MemoryStream memory = new MemoryStream(64);
            BinaryWriter writer = new BinaryWriter(memory);

            //Offset 0
            writer.Write(Attributes);

            //Offset 1-7
            WriteSevenZeroBytes(writer);

            //Offset 8-11
            writer.Write(FirstCluster);

            //Offset 12-15
            WriteFourZeroBytes(writer);

            //Offset 16-19
            writer.Write(FileSize);

            //Offset 20-23
            WriteFourZeroBytes(writer);

            //Offset 24-27
            writer.Write(FilenameCluster);

            //Offset 28-31
            WriteFourZeroBytes(writer);

            //Offset 32-39
            writer.Write(CreationTime.ToBinary());

            //Offset 40-47
            writer.Write(ModifiedTime.ToBinary());

            //Offset 48-55
            writer.Write(AccessedTime.ToBinary());

            //Offset 56-63
            WriteEightZeroBytes(writer);


            writer.Flush();
            byte[] data = memory.ToArray();
            writer.Close();
            return(data);
        }
        /// <summary>
        /// Returns true if ModelFlowChartEdgeMeta instances are equal
        /// </summary>
        /// <param name="other">Instance of ModelFlowChartEdgeMeta to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ModelFlowChartEdgeMeta other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Kind == other.Kind ||
                     Kind != null &&
                     Kind.Equals(other.Kind)
                 ) &&
                 (
                     CreatedTime == other.CreatedTime ||
                     CreatedTime != null &&
                     CreatedTime.Equals(other.CreatedTime)
                 ) &&
                 (
                     ModifiedTime == other.ModifiedTime ||
                     ModifiedTime != null &&
                     ModifiedTime.Equals(other.ModifiedTime)
                 ) &&
                 (
                     Author == other.Author ||
                     Author != null &&
                     Author.Equals(other.Author)
                 ) &&
                 (
                     Comments == other.Comments ||
                     Comments != null &&
                     Comments.Equals(other.Comments)
                 ));
        }
Exemple #15
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.AppendLine("LXATTRB");

            sb.AppendLine($"Format: 0x{Format:X}");
            sb.AppendLine($"Version: 0x{Version:X}");
            sb.AppendLine($"Mode: 0x{Mode:X}");
            sb.AppendLine($"Uid/Gid: 0x{Uid:X}/0x{Gid:X}");
            sb.AppendLine($"Device Id: 0x{DeviceId:X}");

            //convert to seconds so we can use it later.
            //.net has no API for adding nanoseconds that works, so this is what we get
            var lastAccessSubSec  = (LastAccessNanoSeconds / 1e+9).ToString(CultureInfo.InvariantCulture);
            var modifiedSubsec    = (ModifiedNanoSeconds / 1e+9).ToString(CultureInfo.InvariantCulture);
            var inodeChangeSubsec = (InodeChangedNanoSeconds / 1e+9).ToString(CultureInfo.InvariantCulture);

            sb.AppendLine($"Last Access Time: {LastAccessTime.ToUniversalTime():yyyy-MM-dd HH:mm:ss}.{(lastAccessSubSec.Length>2 ? lastAccessSubSec.Substring(2) : "0000000")}");
            sb.AppendLine($"Modified Time: {ModifiedTime.ToUniversalTime():yyyy-MM-dd HH:mm:ss}.{modifiedSubsec.Substring(2)}");
            sb.AppendLine($"Inode Changed: {InodeChanged.ToUniversalTime():yyyy-MM-dd HH:mm:ss}.{inodeChangeSubsec.Substring(2)}");

            return(sb.ToString());
        }
Exemple #16
0
 public override string ToString()
 => $"{Path} {ModifiedTime.ToLexicalString()} {FileSize}";
        public override int GetHashCode()
        {
            var hashCode = -1706955063;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Filepath);

            hashCode = hashCode * -1521134295 + Filesize.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ModifiedTime.ToString());

            return(hashCode);
        }
Exemple #18
0
 public override DateTime GetFileLastWriteTime()
 {
     return(ModifiedTime.GetValueOrDefault());
 }
        public int CompareTo(Object o)
        {
            Modification modification = (Modification)o;

            return(ModifiedTime.CompareTo(modification.ModifiedTime));
        }
Exemple #20
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("CompactContact(");
        bool __first = true;

        if (Mid != null && __isset.mid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Mid: ");
            Mid.ToString(sb);
        }
        if (__isset.createdTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CreatedTime: ");
            CreatedTime.ToString(sb);
        }
        if (__isset.modifiedTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ModifiedTime: ");
            ModifiedTime.ToString(sb);
        }
        if (__isset.status)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Status: ");
            Status.ToString(sb);
        }
        if (__isset.settings)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Settings: ");
            Settings.ToString(sb);
        }
        if (DisplayNameOverridden != null && __isset.displayNameOverridden)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayNameOverridden: ");
            DisplayNameOverridden.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }