Esempio n. 1
0
        /// <summary>
        /// Clears all map layers.
        /// </summary>
        public void ClearMapLayers()
        {
            AllocationLayers.Clear();

            foreach (var allocationMap in AllocationMaps.Values)
            {
                allocationMap.Invalidate();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a map layer.
        /// </summary>
        /// <param name="layer">The layer.</param>
        public void AddMapLayer(AllocationLayer layer)
        {
            AllocationLayers.Add(layer);

            foreach (var allocationMap in AllocationMaps.Values)
            {
                allocationMap.Invalidate();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Removes a layer.
        /// </summary>
        /// <param name="name">The name of the layer to remove</param>
        /// <returns></returns>
        public bool RemoveLayer(string name)
        {
            var existing = AllocationLayers.Find(delegate(AllocationLayer layer) { return(layer.Name == name); });

            if (existing != null)
            {
                AllocationLayers.Remove(existing);

                foreach (var allocationMap in AllocationMaps.Values)
                {
                    allocationMap.Invalidate();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }