/// <summary> /// Select envelopes from geometry /// </summary> /// <param name="geometry">The geometry to select from</param> private void SelectEnvelopesFromGeometry(Geometry geometry) { this.ResetSelectedRectangles(); var selectedEnvelopes = new EnvelopeList { Envelopes = new List <Envelope>() }; // do envelope hit test VisualTreeHelper.HitTest( this.mainCanvas, null, hitTestResult => { var r = hitTestResult.VisualHit as Rectangle; if (r != null) { var selectedEnvelope = r.Tag as Envelope; if (selectedEnvelope != null) { selectedEnvelopes.Envelopes.Add(selectedEnvelope); this.AddToSelectedRectangleEnvelopePairs(r, selectedEnvelope); } } return(HitTestResultBehavior.Continue); }, new GeometryHitTestParameters(geometry)); selectedEnvelopes.Envelopes.Sort(new SortByTimestamp()); this.analyzerService.UpdateSelectedEnvelopes(selectedEnvelopes); }
/// <summary> /// Update selected envelopes /// </summary> /// <param name="currentSelectedEnvelopes">Current selected envelope</param> internal void UpdateSelectedEnvelopes(EnvelopeList currentSelectedEnvelopes) { Interlocked.Exchange(ref this.serviceState.CurrentSelectedEnvelopes, currentSelectedEnvelopes); this.mainPort.Post(new EnvelopesSelected()); }