void setupCollection(IScheduler sched)
        {
            ChangeTrackingEnabled = true;
            _sched = sched ?? RxApp.DeferredScheduler;
            invalidateHash();

            ItemsAdded.Subscribe(x => {
                if (ChangeTrackingEnabled == false) {
                    return;
                }
                CreatedOn[x.ContentHash] = _sched.Now;
                UpdatedOn[x.ContentHash] = _sched.Now;
            });

            ItemsRemoved.Subscribe(x => {
                if (ChangeTrackingEnabled == false) {
                    return;
                }
                CreatedOn.Remove(x.ContentHash);
                UpdatedOn.Remove(x.ContentHash);
            });

            ItemChanged.Subscribe(x => {
                if (ChangeTrackingEnabled == false) {
                    return;
                }
                UpdatedOn[x.Sender.ContentHash] = _sched.Now;
            });

            Changed.Subscribe(_ => invalidateHash());
        }
Example #2
0
 public bool Equals(ProjectViewModel other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return
         (string.Equals(Identify, other.Identify, StringComparison.CurrentCulture) &&
          Id == other.Id &&
          string.Equals(Name, other.Name, StringComparison.CurrentCulture) &&
          string.Equals(Identifier, other.Identifier, StringComparison.CurrentCulture) &&
          string.Equals(Description, other.Description, StringComparison.CurrentCulture) &&
          Equals(Parent, other.Parent) && string.Equals(HomePage, other.HomePage, StringComparison.CurrentCulture) &&
          CreatedOn.Equals(other.CreatedOn) &&
          UpdatedOn.Equals(other.UpdatedOn) &&
          Status == other.Status &&
          IsPublic == other.IsPublic &&
          InheritMembers == other.InheritMembers &&
          Equals(Trackers, other.Trackers) &&
          Equals(CustomFields, other.CustomFields) &&
          Equals(IssueCategories, other.IssueCategories) &&
          Equals(EnabledModules, other.EnabledModules) &&
          Equals(TimeEntryActivities, other.TimeEntryActivities));
 }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_projectsService != null ? _projectsService.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (_navigationService != null ? _navigationService.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DetailCommand != null ? DetailCommand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EditCommand != null ? EditCommand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Identify != null ? StringComparer.CurrentCulture.GetHashCode(Identify) : 0);
         hashCode = (hashCode * 397) ^ Id;
         hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.CurrentCulture.GetHashCode(Name) : 0);
         hashCode = (hashCode * 397) ^ (Identifier != null ? StringComparer.CurrentCulture.GetHashCode(Identifier) : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? StringComparer.CurrentCulture.GetHashCode(Description) : 0);
         hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HomePage != null ? StringComparer.CurrentCulture.GetHashCode(HomePage) : 0);
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Status;
         hashCode = (hashCode * 397) ^ IsPublic.GetHashCode();
         hashCode = (hashCode * 397) ^ InheritMembers.GetHashCode();
         hashCode = (hashCode * 397) ^ (Trackers != null ? Trackers.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IssueCategories != null ? IssueCategories.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EnabledModules != null ? EnabledModules.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TimeEntryActivities != null ? TimeEntryActivities.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Identifier != null ? Identifier.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HomePage != null ? HomePage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Status;
         hashCode = (hashCode * 397) ^ IsPublic.GetHashCode();
         hashCode = (hashCode * 397) ^ InheritMembers.GetHashCode();
         hashCode = (hashCode * 397) ^ (Trackers != null ? Trackers.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IssueCategories != null ? IssueCategories.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EnabledModules != null ? EnabledModules.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TimeEntryActivities != null ? TimeEntryActivities.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Project != null ? Project.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Tracker != null ? Tracker.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Priority != null ? Priority.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Author != null ? Author.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Subject != null ? Subject.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ StartDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DueDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DoneRatio.GetHashCode();
         hashCode = (hashCode * 397) ^ PrivateNotes.GetHashCode();
         hashCode = (hashCode * 397) ^ EstimatedHours.GetHashCode();
         hashCode = (hashCode * 397) ^ SpentHours.GetHashCode();
         hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ ClosedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ (Notes != null ? Notes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AssignedTo != null ? AssignedTo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ParentIssue != null ? ParentIssue.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FixedVersion != null ? FixedVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsPrivate.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalSpentHours.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalEstimatedHours.GetHashCode();
         hashCode = (hashCode * 397) ^ (Journals != null ? Journals.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Changesets != null ? Changesets.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Attachments != null ? Attachments.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Relations != null ? Relations.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Children != null ? Children.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Uploads != null ? Uploads.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Watchers != null ? Watchers.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #6
0
 public bool Equals(Issue other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && Equals(Project, other.Project) && Equals(Tracker, other.Tracker) && Equals(Status, other.Status) && Equals(Priority, other.Priority) && Equals(Author, other.Author) && Equals(Category, other.Category) && string.Equals(Subject, other.Subject) && string.Equals(Description, other.Description) && StartDate.Equals(other.StartDate) && DueDate.Equals(other.DueDate) && DoneRatio.Equals(other.DoneRatio) && PrivateNotes == other.PrivateNotes && EstimatedHours.Equals(other.EstimatedHours) && SpentHours.Equals(other.SpentHours) && Equals(CustomFields, other.CustomFields) && CreatedOn.Equals(other.CreatedOn) && UpdatedOn.Equals(other.UpdatedOn) && ClosedOn.Equals(other.ClosedOn) && string.Equals(Notes, other.Notes) && Equals(AssignedTo, other.AssignedTo) && Equals(ParentIssue, other.ParentIssue) && Equals(FixedVersion, other.FixedVersion) && IsPrivate == other.IsPrivate && TotalSpentHours.Equals(other.TotalSpentHours) && TotalEstimatedHours.Equals(other.TotalEstimatedHours) && Equals(Journals, other.Journals) && Equals(Changesets, other.Changesets) && Equals(Attachments, other.Attachments) && Equals(Relations, other.Relations) && Equals(Children, other.Children) && Equals(Uploads, other.Uploads) && Equals(Watchers, other.Watchers));
 }