protected bool Equals(InternationalAffiliation other) { return(From.Equals(other.From) && To.Equals(other.To) && OnGoing.Equals(other.OnGoing) && string.Equals(Institution, other.Institution) && Locations.OrderBy(a => a.PlaceId).SequenceEqual(other.Locations.OrderBy(b => b.PlaceId)) && string.Equals(Position, other.Position)); }
public override int GetHashCode() { unchecked { int hashCode = From.GetHashCode(); hashCode = (hashCode * 397) ^ To.GetHashCode(); hashCode = (hashCode * 397) ^ OnGoing.GetHashCode(); hashCode = (hashCode * 397) ^ (Institution != null ? Institution.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Locations != null ? Locations.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Position != null ? Position.GetHashCode() : 0); return(hashCode); } }
private void MoveToArchive(TransmittalVM trans) { var file = trans.File; file.MoveTo(ArchivePath(file)); _ui.Send(x => Archive.Add(file.Name), null); if (Archive.Count > MAX_ARCHIVE) { _ui.Send(x => Archive.RemoveAt(0), null); } //OnGoing.Remove(trans); _ui.Send(x => OnGoing.Remove(trans), null); //Pending.Remove(file); _ui.Send(x => Pending.Remove(file), null); }
private async void Pending_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action != NotifyCollectionChangedAction.Add) { return; } foreach (FileInfo file in e.NewItems) { while (IsCurrentMinute(file)) { await Task.Delay(1000 * 15); } var trans = new TransmittalVM(); _ui.Send(x => OnGoing.Add(trans), null); trans.Completed += (s, a) => MoveToArchive(trans); trans.Send(Target.Title, file); } }