Visually Located


Managing Extents within the ArcGIS WPF/Silverlight/etc. APIs

Managing extents within the ArcGIS .Net client API’s is pretty simple. Esri has an example on the resources page. I implemented one for the ArcFM Silverlight SDK sample. Oddly enough, they are quite similar. I don’t remember copying theirs, but you never know. Like most things we as developers do, after a couple of years you look back and wonder “What was I thinking?” I look back at my original code and wonder why did I implement the Extents class the way that I did. I originally used one List to hold all of the Extents. This made some of the code pretty ugly. I’ve created a different implementation that utilizes two stacks. I have one class that manages all of the extents: 1: public class Extents 2: { 3: private readonly Stack<Envelope> _backStack = new Stack<Envelope>(); 4: private readonly Stack<Envelope> _forwardStack = new Stack<Envelope>(); 5:  6: public bool HasPrevi... [More]