/// <summary>
        /// Activates the specified token
        /// </summary>
        /// <param name="token">The token to activate</param>
        public void ActivateToken(PluginToken token)
        {
            IExtension ext;
            if (_activeTokens == null) _activeTokens = new Dictionary<PluginToken, IExtension>();
            if (_activeTokens.ContainsKey(token))
            {
                ext = _activeTokens[token];
            }
            else
            {
                ext = token.CreateInstance<IExtension>();
                if (ext == null) return;
                _activeTokens.Add(token, ext);
            }


            IMapPlugin gp = ext as IMapPlugin;
            if (gp != null)
            {
                IMapPluginArgs args = new GeoPluginArgs(_map, _legend, _mainMenu, _toolStrip, _progressHandler, _geoPlugins, _toolStripContainer, _panelManager);
                gp.Initialize(args);
                _geoPlugins.Add(gp);
            }

            ext.Activate();     
          
        }
Exemplo n.º 2
0
 /// <summary>
 /// Activates the specified token
 /// </summary>
 /// <param name="token">The token to activate</param>
 public void ActivateToken(PluginToken token)
 {
     IMapPlugin gp = null;
     if (_tokenPlugins.ContainsKey(token))
     {
         gp = _tokenPlugins[token];
     }
     else
     {
         gp = token.CreateInstance<IMapPlugin>();
         IMapPluginArgs args = new GeoPluginArgs(_map, _legend, _mainMenu, _toolStrip, _progressHandler, _geoPlugins, _toolStripContainer, _panelManager);
         gp.Initialize(args);
         _tokenPlugins.Add(token, gp);
     }
     
     _geoPlugins.Add(gp);
     gp.Activate();
     
 }