/// <summary>
 /// Adds an overlay to the specified window.
 /// </summary>
 public void Add(SolidEdgeFramework.Window window, ViewOverlay overlay)
 {
     if (window == null)
     {
         throw new ArgumentNullException("window");
     }
     Add(window.View, overlay);
 }
        /// <summary>
        /// Removes the specified overlay.
        /// </summary>
        public void Remove(ViewOverlay overlay)
        {
            if (overlay == null)
            {
                throw new ArgumentNullException("overlay");
            }

            if (_overlays.Contains(overlay))
            {
                _overlays.Remove(overlay);
            }

            overlay.Dispose();
        }
        /// <summary>
        /// Adds an overlay to the specified view.
        /// </summary>
        public void Add(SolidEdgeFramework.View view, ViewOverlay overlay)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (overlay == null)
            {
                throw new ArgumentNullException("overlay");
            }

            if (HasOverlay(view))
            {
                throw new System.Exception("Specified view already has an overlay.");
            }

            overlay.Controller = this;
            overlay.View       = view;
            _overlays.Add(overlay);
        }