Пример #1
0
 public VeReprojectTilesLayer(string name, MainApplication parentApplication, VirtualEarthForm veForm)
     : base(name)
 {
     this.name = name;
     this.parentApplication = parentApplication;
     this.veForm = veForm;
     ServerLogoFilePath = Path.Combine(
                 Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath),
                 ServerLogoFilePath);
 }
Пример #2
0
        //NOTE had problems with pluginDir, possibly because Initialize wasn't getting called?
        //private static string _pluginDir;
        //public static string PluginDir
        //{
        //	get{return _pluginDir;}
        //}

        public override void Load()
        {
            try
            {
                if (ParentApplication.WorldWindow.CurrentWorld.IsEarth)
                {
                    m_Form = new VirtualEarthForm(ParentApplication);
                    m_Form.Owner = ParentApplication;

                    m_MenuItem = new MenuItem("MicroSoft VirtualEarth");
                    m_MenuItem.Click += new EventHandler(menuItemClicked);
                    ParentApplication.PluginsMenu.MenuItems.Add(m_MenuItem);

                    //#if DEBUG
                    string imgPath = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\VirtualEarth\\VirtualEarthPlugin.png";
                    //#else
                    //					_pluginDir = this.PluginDirectory;
                    //					string imgPath = this.PluginDirectory + @"\VirtualEarthPlugin.png";
                    //#endif
                    if (File.Exists(imgPath) == false)
                    {
                        Utility.Log.Write(new Exception("imgPath not found " + imgPath));
                    }
                    m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                        "MicroSoft VirtualEarth",
                        imgPath,
                        m_Form);

                    ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

                    base.Load();
                }
            }
            catch (Exception ex)
            {
                Utility.Log.Write(ex);
                throw;
            }
        }
Пример #3
0
        public override void Unload()
        {
            try
            {
                if (m_Form != null)
                {
                    m_Form.Dispose();
                    m_Form = null;
                    ParentApplication.PluginsMenu.MenuItems.Remove(m_MenuItem);
                    ParentApplication.WorldWindow.MenuBar.RemoveToolsMenuButton(m_ToolbarItem);
                }

                base.Unload();
            }
            catch (Exception ex)
            {
                Utility.Log.Write(ex);
                throw;
            }
        }
Пример #4
0
 public static void Init(Projection proj, TerrainAccessor terrainAccessor, double layerRadius, VirtualEarthForm veForm)
 {
     _proj = proj;
     _terrainAccessor = terrainAccessor;
     _layerRadius = layerRadius;
     _veForm = veForm;
     _font = new System.Drawing.Font("Verdana", 15, FontStyle.Bold);
     _brush = new SolidBrush(Color.Green);
 }