Exemplo n.º 1
0
        public async override Task<bool> InitializeAsync(Framework.Interfaces.ICore core)
        {
            var sett = new PluginSettings(core);

            AddAction(ACTION_OSMONLINE);
            AddAction(ACTION_OSMOFFLINE);
            AddAction(ACTION_GOOGLEONLINE);

            try
            {
                if (string.IsNullOrEmpty(PluginSettings.Instance.OSMOfflineMapFolder))
                {
                    string p = core.PluginDataPath;
                    if (!System.IO.Directory.Exists(p))
                    {
                        System.IO.Directory.CreateDirectory(p);
                    }
                    p = System.IO.Path.Combine(new string[] { p, "OSMOfflineMaps" });
                    if (!System.IO.Directory.Exists(p))
                    {
                        System.IO.Directory.CreateDirectory(p);
                    }
                    PluginSettings.Instance.OSMOfflineMapFolder = p;
                }
            }
            catch
            {
            }

            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_ACTIVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_ALL));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_SEARCH));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_SELECTED));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_SHOWGEOCACHES));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_DECOUPLE_WINDOW));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(MapForm.STR_DOCK_WINDOW));

            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_TITLE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_DOWNLOAD));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_DOWNLOADINGFILE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_NAME));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_RETRIEVINGLIST));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(GetMapsForm.STR_SIZE));

            core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_CLEARCACHE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_GETMORE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_LOCATION));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MAPS));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_OFFLINEOSMMAPS));

            _tileLocalServer = new TileLocalServer();
            _tileLocalServer.Start(core);

            return await base.InitializeAsync(core);
        }
Exemplo n.º 2
0
 public PluginSettings(ICore core)
 {
     _uniqueInstance = this;
     _core = core;
 }
Exemplo n.º 3
0
 public PluginSettings(ICore core)
 {
     _uniqueInstance = this;
     _core           = core;
 }