Пример #1
0
        public async override Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
        {
            bool result = false;
            var  sett   = new PluginSettings(core);

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


            if (await base.InitializeAsync(core))
            {
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ADD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_CITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_COUNTRY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DELETE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DUTCHGRID));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_FORMAT));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MUNICIPALITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEFIELD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEPREFIX));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_OTHER));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_PARSEERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILESTOUSE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_STATE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_TYPE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_WGS84));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DOWNLOADMORE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ENCODING));

                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOAD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGLIST));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGSHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_TITLE));

                _shapeFilesManager = new ShapeFilesManager();
                _shapeFilesManager.Initialize();
                result = true;
            }
            return(result);
        }
Пример #2
0
        public override bool Initialize(Framework.Interfaces.ICore core)
        {
            bool result = false;

            if (Properties.Settings.Default.UpgradeNeeded)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeNeeded = false;
                Properties.Settings.Default.Save();
            }
            if (Properties.Settings.Default.ShapeFiles == null)
            {
                Properties.Settings.Default.ShapeFiles = new System.Collections.Specialized.StringCollection();
                Properties.Settings.Default.Save();
            }

            try
            {
                string p = core.PluginDataPath;
                if (!System.IO.Directory.Exists(p))
                {
                    System.IO.Directory.CreateDirectory(p);
                }
                p = System.IO.Path.Combine(new string[] { p, "Shapefiles" });
                if (!System.IO.Directory.Exists(p))
                {
                    System.IO.Directory.CreateDirectory(p);
                }
                if (string.IsNullOrEmpty(Properties.Settings.Default.DefaultShapeFilesFolder))
                {
                    Properties.Settings.Default.DefaultShapeFilesFolder = p;
                    Properties.Settings.Default.Save();
                }
            }
            catch
            {
            }


            if (base.Initialize(core))
            {
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ADD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_CITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_COUNTRY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DELETE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DUTCHGRID));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_FORMAT));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MUNICIPALITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEFIELD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEPREFIX));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_OTHER));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_PARSEERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILESTOUSE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_STATE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_TYPE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_WGS84));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DOWNLOADMORE));

                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOAD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGLIST));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGSHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_TITLE));

                _shapeFilesManager = new ShapeFilesManager();
                _shapeFilesManager.Initialize();
                result = true;
            }
            return result;
        }
Пример #3
0
        public async override Task<bool> InitializeAsync(Framework.Interfaces.ICore core)
        {
            bool result = false;
            var sett = new PluginSettings(core);

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


            if (await base.InitializeAsync(core))
            {
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ADD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_CITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_COUNTRY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DELETE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DUTCHGRID));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_FORMAT));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MUNICIPALITY));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEFIELD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_NAMEPREFIX));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_OTHER));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_PARSEERROR));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHAPEFILESTOUSE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_STATE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_TYPE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_WGS84));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_DOWNLOADMORE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_ENCODING));

                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOAD));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGLIST));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_DOWNLOADINGSHAPEFILE));
                core.LanguageItems.Add(new Framework.Data.LanguageItem(DownloadShapefileForm.STR_TITLE));

                _shapeFilesManager = new ShapeFilesManager();
                _shapeFilesManager.Initialize();
                result = true;
            }
            return result;
        }