Beispiel #1
0
        /// <summary>
        /// Create instance of <see cref="SearchLayerInformer"/>
        /// </summary>
        /// <param name="serviceInfoExtractor">Instance of IServiceInfoExtractor</param>
        /// <param name="map">Map</param>
        /// <exception cref="ArgumentNullException">serviceInfoExtractor must be not null.</exception>
        public SearchLayerInformer(IServiceInfoExtractor serviceInfoExtractor, Map map)
        {
            if (serviceInfoExtractor == null)
            {
                throw new ArgumentNullException("serviceInfoExtractor");
            }
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            _serviceInfoExtractor = serviceInfoExtractor;
            _map = map;

            toolTip                  = new Popup(customToolTip = new CustomToolTipControl());
            customToolTip.Popup      = toolTip;
            toolTip.AutoClose        = false;
            toolTip.FocusOnOpen      = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;

            _map.MouseMove      += _map_MouseMove;
            _map.VisibleChanged += MapOnVisibleChanged;
            if (_map.Parent != null)
            {
                _map.Parent.VisibleChanged += MapOnVisibleChanged;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Create instance of <see cref="SearchLayerInformer"/>
        /// </summary>
        /// <param name="parentPlugin">DataDownload plugin</param>
        /// <param name="serviceInfoExtractor">Instance of IServiceInfoExtractor</param>
        /// <param name="map">Map</param>
        /// <exception cref="ArgumentNullException">serviceInfoExtractor must be not null.</exception>
        public SearchLayerInformer(DataDownloadPlugin parentPlugin, IServiceInfoExtractor serviceInfoExtractor, Map map)
        {
            if (parentPlugin == null)
            {
                throw new ArgumentNullException("parentPlugin");
            }
            if (serviceInfoExtractor == null)
            {
                throw new ArgumentNullException("serviceInfoExtractor");
            }
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            _parentPlugin         = parentPlugin;
            _serviceInfoExtractor = serviceInfoExtractor;
            _map = map;

            toolTip                  = new Popup(customToolTip = new CustomToolTipControl(_parentPlugin));
            customToolTip.Popup      = toolTip;
            toolTip.AutoClose        = false;
            toolTip.FocusOnOpen      = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;
            toolTip.TopLevel         = false;

            _parentPlugin.ShowPopupsChanged += OnParentPluginOnShowPopupsChanged;
            _map.MouseMove      += _map_MouseMove;
            _map.VisibleChanged += MapOnVisibleChanged;
            var parent = _map.Parent;

            while (parent != null)
            {
                parent.VisibleChanged += MapOnVisibleChanged;
                var form = parent as Form;
                if (form != null)
                {
                    toolTip.Parent = form;
                }
                parent = parent.Parent;
            }
            Debug.Assert(toolTip.Parent != null);
        }