diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs index 0e65a3502..b78ca5ad8 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs @@ -112,5 +112,70 @@ namespace HandBrake.ApplicationServices.Parsing return string.Format("{0} {1} ({2}) ({3})", this.TrackNumber, this.Language, this.Format, this.Description);
}
+
+ /// <summary>
+ /// The equals.
+ /// </summary>
+ /// <param name="other">
+ /// The other.
+ /// </param>
+ /// <returns>
+ /// The System.Boolean.
+ /// </returns>
+ public bool Equals(Audio other)
+ {
+ if (ReferenceEquals(null, other))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+ return other.TrackNumber == this.TrackNumber && object.Equals(other.Language, this.Language) && object.Equals(other.LanguageCode, this.LanguageCode) && object.Equals(other.Format, this.Format);
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+ /// </returns>
+ /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
+ if (obj.GetType() != typeof(Audio))
+ {
+ return false;
+ }
+ return Equals((Audio)obj);
+ }
+
+ /// <summary>
+ /// Serves as a hash function for a particular type.
+ /// </summary>
+ /// <returns>
+ /// A hash code for the current <see cref="T:System.Object"/>.
+ /// </returns>
+ /// <filterpriority>2</filterpriority>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int result = this.TrackNumber;
+ result = (result * 397) ^ (this.Language != null ? this.Language.GetHashCode() : 0);
+ result = (result * 397) ^ (this.LanguageCode != null ? this.LanguageCode.GetHashCode() : 0);
+ result = (result * 397) ^ (this.Format != null ? this.Format.GetHashCode() : 0);
+ return result;
+ }
+ }
}
}
\ No newline at end of file |