/// <summary> /// Initializes a new instance of the <see cref= "T:ConfigurationWizard.WizardPage"/> class. /// Initializes settings, message and pages. /// </summary> /// <param name="settings">The WorldWindSettingsComponent to use</param> internal Wizard(WorldWindSettings settings) { // // Required for Windows Form Designer support // InitializeComponent(); Wizard.Settings = settings; wizardPages = new ArrayList(); this.Text = "Dapple Advanced Settings"; this.AbortMessage = "Are you sure you want to cancel the wizard?"; AddPage(new WelcomePage()); AddPage(new CachePage()); AddPage(new ProxyPage()); AddPage(new DappleSearchPage()); AddPage(new FinalPage()); }
/// <summary> /// Initializes a new instance of the <see cref= "T:ConfigurationWizard.WizardPage"/> class. /// Initializes settings, message and pages. /// </summary> /// <param name="settings">The WorldWindSettings to use</param> public Wizard(WorldWindSettings settings) { // // Required for Windows Form Designer support // InitializeComponent(); Wizard.Settings = settings; wizardPages = new ArrayList(); this.Text = "World Wind welcome screen"; this.AbortMessage = "Are you sure you want to cancel the wizard?"; AddPage(new WelcomePage()); AddPage(new CachePage()); AddPage(new ProxyPage()); AddPage(new AtmospherePage()); AddPage(new FinalPage()); }
public TextureSource(string url, string cacheLocation, ImageStore imageStore, PriorityCallback priorityCallback) { // if (s_inQueueTexture == null) // InitStaticTextures(); // convert cache location to dds // string ddsCache = Path.GetDirectoryName(cacheLocation)+"\\"+Path.GetFileNameWithoutExtension(cacheLocation) + ".dds"; m_drd = new DataRequestDescriptor(url, cacheLocation, new CacheCallback(CacheCallback)); m_drd.CompletionCallback = new CompletionCallback(CompletionCallback); m_drd.PriorityCallback = priorityCallback; m_imageStore = imageStore; if (m_settings == null) { // get the World Wind Settings through reflection. Assembly a = Assembly.GetEntryAssembly(); Type appType = a.GetType("WorldWind.MainApplication"); System.Reflection.FieldInfo finfo = appType.GetField("Settings", BindingFlags.Static | BindingFlags.Public | BindingFlags.GetField); m_settings = finfo.GetValue(null) as WorldWindSettings; } }
/// <summary> /// Deserializes and optionally decrypts settings, using specified location /// </summary> private static void LoadSettings(string directory) { try { Settings = (WorldWindSettings) SettingsBase.LoadFromPath(Settings, directory); // decrypt encoded user credentials DataProtector dp = new DataProtector(DataProtector.Store.USE_USER_STORE); if(Settings.ProxyUsername.Length > 0) Settings.ProxyUsername = dp.TransparentDecrypt(Settings.ProxyUsername); if(Settings.ProxyPassword.Length > 0) Settings.ProxyPassword = dp.TransparentDecrypt(Settings.ProxyPassword); } catch(Exception caught) { Log.Write(caught); } }
/// <summary> /// Deserializes and optionally decrypts settings /// </summary> private static void LoadSettings() { try { Settings = (WorldWindSettings) SettingsBase.Load(Settings, SettingsBase.LocationType.User); if(!File.Exists(Settings.FileName)) { Settings.PluginsLoadedOnStartup.Add("ShapeFileInfoTool"); //Settings.PluginsLoadedOnStartup.Add("OverviewFormLoader"); //Settings.PluginsLoadedOnStartup.Add("Atmosphere"); Settings.PluginsLoadedOnStartup.Add("SkyGradient"); Settings.PluginsLoadedOnStartup.Add("BmngLoader"); //Settings.PluginsLoadedOnStartup.Add("Compass"); //Settings.PluginsLoadedOnStartup.Add("ExternalLayerManagerLoader"); Settings.PluginsLoadedOnStartup.Add("MeasureTool"); //Settings.PluginsLoadedOnStartup.Add("MovieRecorder"); Settings.PluginsLoadedOnStartup.Add("NRLWeatherLoader"); Settings.PluginsLoadedOnStartup.Add("ShapeFileLoader"); Settings.PluginsLoadedOnStartup.Add("Stars3D"); Settings.PluginsLoadedOnStartup.Add("GlobalClouds"); Settings.PluginsLoadedOnStartup.Add("PlaceFinderLoader"); Settings.PluginsLoadedOnStartup.Add("LightController"); Settings.PluginsLoadedOnStartup.Add("Earthquake_2.0.2.1"); Settings.PluginsLoadedOnStartup.Add("Historical_Earthquake_2.0.2.2"); Settings.PluginsLoadedOnStartup.Add("KMLImporter"); //Settings.PluginsLoadedOnStartup.Add("doublezoom"); //Settings.PluginsLoadedOnStartup.Add("PlanetaryRings"); Settings.PluginsLoadedOnStartup.Add("TimeController"); //Settings.PluginsLoadedOnStartup.Add("WavingFlags"); Settings.PluginsLoadedOnStartup.Add("ScaleBarLegend"); Settings.PluginsLoadedOnStartup.Add("Compass3D"); Settings.PluginsLoadedOnStartup.Add("AnaglyphStereo"); Settings.PluginsLoadedOnStartup.Add("GlobeIcon"); } // decrypt encoded user credentials DataProtector dp = new DataProtector(DataProtector.Store.USE_USER_STORE); if(Settings.ProxyUsername.Length > 0) Settings.ProxyUsername = dp.TransparentDecrypt(Settings.ProxyUsername); if(Settings.ProxyPassword.Length > 0) Settings.ProxyPassword = dp.TransparentDecrypt(Settings.ProxyPassword); } catch(Exception caught) { Log.Write(caught); } }
/// <summary> /// ʹ��Ĭ�ϵij�ʼ�� /// </summary> private void Initialize() { // ע����Ⱦѭ�� Application.Idle += this.OnApplicationIdle; settings = new WorldWindSettings(); // ��ȡ������Ϣ���Ժ����ȥ���ֱ��ʹ��ϵͳ���� //DataProtector dp = new DataProtector(DataProtector.Store.USE_USER_STORE); // load settings; World.LoadSettings(); this.Cache = new Cache(settings.CachePath, settings.CacheCleanupInterval, settings.TotalRunTime); DirectoryInfo configDirInfo = new DirectoryInfo(settings.ConfigPath); if (!configDirInfo.Exists) { MessageBox.Show("����Ŀ¼������","����", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } FileInfo[] configFiles = configDirInfo.GetFiles("*.xml", SearchOption.TopDirectoryOnly); this.CurrentWorld = ConfigurationLoader.Load(configFiles[0].FullName, this.Cache); }