Esempio n. 1
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ Name?.GetHashCode() ?? 0;
         result = (result * 397) ^ Path?.GetHashCode() ?? 0;
         result = (result * 397) ^ Arguments.GetSequencedHashCode();
         result = (result * 397) ^ Bindings.GetUnsequencedHashCode();
         result = (result * 397) ^ WorkingDir?.GetHashCode() ?? 0;
         result = (result * 397) ^ Dependencies.GetUnsequencedHashCode();
         result = (result * 397) ^ Restrictions.GetUnsequencedHashCode();
         result = (result * 397) ^ Runner?.GetHashCode() ?? 0;
         return(result);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a deep copy of this <see cref="Command"/> instance.
        /// </summary>
        /// <returns>The new copy of the <see cref="Command"/>.</returns>
        public Command Clone()
        {
            var newCommand = new Command {
                UnknownAttributes = UnknownAttributes, UnknownElements = UnknownElements, IfZeroInstallVersion = IfZeroInstallVersion, Name = Name, Path = Path
            };

            newCommand.Arguments.AddRange(Arguments.CloneElements());
            newCommand.Bindings.AddRange(Bindings.CloneElements());
            if (WorkingDir != null)
            {
                newCommand.WorkingDir = WorkingDir.Clone();
            }
            if (Runner != null)
            {
                newCommand.Runner = Runner.CloneRunner();
            }
            newCommand.Dependencies.AddRange(Dependencies.CloneElements());
            newCommand.Restrictions.AddRange(Restrictions.CloneElements());

            return(newCommand);
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ (Name ?? "").GetHashCode();
         result = (result * 397) ^ (Path ?? "").GetHashCode();
         result = (result * 397) ^ Arguments.GetSequencedHashCode();
         result = (result * 397) ^ Bindings.GetSequencedHashCode();
         if (WorkingDir != null)
         {
             result = (result * 397) ^ WorkingDir.GetHashCode();
         }
         result = (result * 397) ^ Dependencies.GetSequencedHashCode();
         result = (result * 397) ^ Restrictions.GetSequencedHashCode();
         if (Runner != null)
         {
             result = (result * 397) ^ Runner.GetHashCode();
         }
         return(result);
     }
 }