summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs77
1 files changed, 18 insertions, 59 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs
index e8813930d..28e66ba59 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs
@@ -20,15 +20,9 @@ namespace HandBrakeWPF.Services.Queue.Model
/// </summary>
public class QueueTask : PropertyChangedBase
{
- #region Constants and Fields
-
- /// <summary>
- /// The status.
- /// </summary>
+ private static int id = 0;
private QueueItemStatus status;
- #endregion
-
#region Properties
/// <summary>
@@ -37,6 +31,8 @@ namespace HandBrakeWPF.Services.Queue.Model
public QueueTask()
{
this.Status = QueueItemStatus.Waiting;
+ id = id + 1;
+ this.Id = id;
}
/// <summary>
@@ -57,12 +53,17 @@ namespace HandBrakeWPF.Services.Queue.Model
this.Configuration = configuration;
this.Status = QueueItemStatus.Waiting;
this.ScannedSourcePath = scannedSourcePath;
+
+ id = id + 1;
+ this.Id = id;
}
+ public int Id { get; private set; }
+
/// <summary>
/// Gets or sets ScannedSource.
/// </summary>
- public string ScannedSourcePath { get; set; }
+ public string ScannedSourcePath { get; set; }
/// <summary>
/// Gets or sets Status.
@@ -93,64 +94,22 @@ namespace HandBrakeWPF.Services.Queue.Model
#endregion
- /// <summary>
- /// The equals.
- /// </summary>
- /// <param name="obj">
- /// The obj.
- /// </param>
- /// <returns>
- /// The <see cref="bool"/>.
- /// </returns>
- public override bool Equals(object obj)
+ protected bool Equals(QueueTask other)
{
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
-
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- return this.Equals((QueueTask)obj);
+ return this.Id == other.Id;
}
- /// <summary>
- /// The get hash code.
- /// </summary>
- /// <returns>
- /// The <see cref="int"/>.
- /// </returns>
- public override int GetHashCode()
+ public override bool Equals(object obj)
{
- unchecked
- {
- int hashCode = (this.ScannedSourcePath != null ? this.ScannedSourcePath.GetHashCode() : 0);
- hashCode = (hashCode * 397) ^ (this.Task != null ? this.Task.GetHashCode() : 0);
- hashCode = (hashCode * 397) ^ (int)this.status;
- return hashCode;
- }
+ if (ReferenceEquals(null, obj)) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ if (obj.GetType() != this.GetType()) return false;
+ return Equals((QueueTask)obj);
}
- /// <summary>
- /// The equals.
- /// </summary>
- /// <param name="other">
- /// The other.
- /// </param>
- /// <returns>
- /// The <see cref="bool"/>.
- /// </returns>
- protected bool Equals(QueueTask other)
+ public override int GetHashCode()
{
- return Equals(this.ScannedSourcePath, other.ScannedSourcePath) && Equals(this.Task, other.Task) && this.status == other.status;
+ return this.Id;
}
}
} \ No newline at end of file