Пример #1
0
        /// <summary>
        ///     Adds the specified style.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public override void Add(TileStyle style)
        {
            foreach (Shape shape in style.Shapes)
            {
                HashSet<TileStyle> styles;
                if (StylesByShape.TryGetValue(shape, out styles) && styles.Count > 0)
                    throw new ArgumentException("A SimpleStyleManager can only contain a single style for each shape.");
            }

            base.Add(style);
        }
Пример #2
0
        /// <summary>
        ///     Adds the specified style.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public override void Add(TileStyle style)
        {
            foreach (Shape shape in style.Shapes)
            {
                HashSet <TileStyle> styles;
                if (StylesByShape.TryGetValue(shape, out styles) && styles.Count > 0)
                {
                    throw new ArgumentException("A SimpleStyleManager can only contain a single style for each shape.");
                }
            }

            base.Add(style);
        }