private void AddInternalPluginMenuButtons() { if (this.worldWindow.CurrentWorld.IsEarth) { this.rapidFireModisManager = new RapidFireModisManager(this.worldWindow); this.rapidFireModisManager.Icon = this.Icon; } this.wmsBrowser = new WMSBrowser(this.worldWindow); this.wmsBrowser.Icon = this.Icon; if (this.worldWindow.CurrentWorld.IsEarth) { this.animatedEarthMananger = new AnimatedEarthManager(this.worldWindow); this.animatedEarthMananger.Icon = this.Icon; } }
private void OpenWorld(string worldXmlFile) { if (this.worldWindow.CurrentWorld != null) { foreach (PluginInfo p in this.compiler.Plugins) { try { if (p.Plugin.IsLoaded) { p.Plugin.Unload(); } } catch { } } try { this.worldWindow.CurrentWorld.Dispose(); } catch { } } if (this.rapidFireModisManager != null) { this.rapidFireModisManager.Dispose(); this.rapidFireModisManager = null; } if (this.animatedEarthMananger != null) { this.animatedEarthMananger.Dispose(); this.animatedEarthMananger = null; } if (this.wmsBrowser != null) { this.wmsBrowser.Dispose(); this.wmsBrowser = null; } worldWindow.CurrentWorld = MFW3D.ConfigurationLoader.Load(worldXmlFile, worldWindow.Cache); InitializePluginCompiler(); foreach (RenderableObject worldRootObject in this.worldWindow.CurrentWorld.RenderableObjects.ChildObjects) { //添加图层 } }
private void OpenWorld(string worldXmlFile) { if (this.worldWindow.CurrentWorld != null) { try { // this.worldWindow.ResetToolbar(); } catch { } try { foreach (PluginInfo p in this.compiler.Plugins) { try { if (p.Plugin.IsLoaded) { p.Plugin.Unload(); } } catch { } } } catch { } try { this.worldWindow.CurrentWorld.Dispose(); } catch { } } if (this.gotoDialog != null) { this.gotoDialog.Dispose(); this.gotoDialog = null; } if (this.rapidFireModisManager != null) { this.rapidFireModisManager.Dispose(); this.rapidFireModisManager = null; } if (this.animatedEarthMananger != null) { this.animatedEarthMananger.Dispose(); this.animatedEarthMananger = null; } if (this.wmsBrowser != null) { this.wmsBrowser.Dispose(); this.wmsBrowser = null; } worldWindow.CurrentWorld = WorldWind.ConfigurationLoader.Load(worldXmlFile, worldWindow.Cache); this.splashScreen.SetText("Initializing menus..."); InitializePluginCompiler(); foreach (RenderableObject worldRootObject in this.worldWindow.CurrentWorld.RenderableObjects.ChildObjects) { this.AddLayerMenuButtons(this.worldWindow, worldRootObject); } this.AddInternalPluginMenuButtons(); }