/// <inheritdoc /> public override bool Select(Envelope tolerant, Envelope strict, SelectionMode mode, out Envelope affectedArea, ClearStates clear) { affectedArea = new Envelope(); bool somethingChanged = false; IgnoreSelectionChanged = true; MapFrame.SuspendEvents(); foreach (var s in GetAllLayers().Where(_ => _.SelectionEnabled && _.IsVisible)) { Envelope layerArea; if (s.Select(tolerant, strict, mode, out layerArea, clear)) { somethingChanged = true; affectedArea.ExpandToInclude(layerArea); } } IgnoreSelectionChanged = false; MapFrame.ResumeEvents(); OnSelectionChanged(); // fires only AFTER the individual layers have fired their events. return(somethingChanged); }
/// <summary> /// Highlights the values in the specified region, and returns the affected area from the selection, /// which should allow for slightly faster drawing in cases where only a small area is changed. /// </summary> /// <param name="self">The IFeatureLayer from which to select features</param> /// <param name="tolerant">The geographic envelope in cases like cliking near points where tolerance is allowed</param> /// <param name="strict">The geographic region when working with absolutes, without a tolerance</param> /// <param name="affectedArea">The geographic envelope of the region impacted by the selection.</param> /// <param name="clear">Indicates whether prior selected features should be cleared.</param> /// <returns>True if any members were added to the current selection.</returns> public static bool Select(this IFeatureLayer self, Envelope tolerant, Envelope strict, out Envelope affectedArea, ClearStates clear) { return(self.Select(tolerant, strict, SelectionMode.Intersects, out affectedArea, clear)); }
/// <summary> /// This is overriden in sub-classes /// </summary> /// <param name="tolerant">The geographic envelope in cases like cliking near points where tolerance is allowed</param> /// <param name="strict">The geographic region when working with absolutes, without a tolerance</param> /// <param name="mode">The selection mode.</param> /// <param name="affectedArea">The affected area.</param> /// <param name="clear">Indicates whether prior selected features should be cleared.</param> /// <returns>False.</returns> public virtual bool Select(Envelope tolerant, Envelope strict, SelectionMode mode, out Envelope affectedArea, ClearStates clear) { affectedArea = null; return(false); }
/// <summary> /// This ignores the affected region and assumes that you want to use a selection based on /// the Intersects selection mode. /// </summary> /// <param name="self">This ISelectable</param> /// <param name="tolerant">The geographic envelope in cases like cliking near points where tolerance is allowed</param> /// <param name="strict">The geographic region when working with absolutes, without a tolerance</param> /// <param name="clear">Indicates whether prior selected features should be cleared.</param> /// <returns>Boolean, true if any items were added to the selection</returns> public static bool Select(this ISelectable self, Envelope tolerant, Envelope strict, ClearStates clear) { Envelope ignoreMe; return(self.Select(tolerant, strict, SelectionMode.Intersects, out ignoreMe, clear)); }