Exemple #1
0
        // Done!
        public void BringToFront(VisualMapNode node)
        {
            var list = new ConcreteVisualMap();

            for (int i = 0; i < this.Count; ++i)
            {
                if (this[i] != node)
                {
                    list.Add(this[i]);
                }
            }
            list.Add(node);

            this.Clear();
            for (int i = 0; i < list.Count; ++i)
            {
                this.Add(list[i]);
            }
        }
Exemple #2
0
        // Done!
        public void SendToBack(VisualMapNode node)
        {
            var list = new ConcreteVisualMap {
                node
            };

            for (int i = 0; i < this.Count; ++i)
            {
                if (this[i] != node)
                {
                    list.Add(this[i]);
                }
            }
            this.Clear();
            for (int i = 0; i < list.Count; ++i)
            {
                this.Add(list[i]);
            }
        }
Exemple #3
0
        // Done!
        #region Static Methods

        // Done!
        public static ConcreteVisualMap LoadFrom(ConcreteMap cm)
        {
            if (cm == null || cm.Count == 0)
            {
                return(new ConcreteVisualMap());
            }

            var cvm = new ConcreteVisualMap();

            for (int i = 0; i < cm.Count; ++i)
            {
                float hx = float.MaxValue;
                float hy = float.MaxValue;
                float lx = float.MinValue;
                float ly = float.MinValue;

                if (cm[i].Geometry.Count > 0)
                {
                    hx = cm[i].Geometry.Min(x => x.X);
                    hy = cm[i].Geometry.Min(x => x.Y);
                    lx = cm[i].Geometry.Max(x => x.X);
                    ly = cm[i].Geometry.Max(x => x.Y);
                }

                cvm.Add(new VisualMapNode
                {
                    ConcreteNode  = cm[i],
                    FillShape     = false,
                    FillShapePath = false,
                    IsLocked      = false,
                    IsVisible     = true,
                    Visuals       = new MapVisuals {
                        Geometry = Pens.Blue
                    },
                    Min = new Vector(hx, hy),
                    Max = new Vector(lx, ly),
                });
            }
            return(cvm);
        }