예제 #1
0
        /**
         * Copy some additional resources from assets
         */
        private async void CopyOtherResources()
        {
            string mapResourcesDirPath = SKMaps.Instance.MapInitSettings.MapResourcesPath;
            await Task.Run(() =>
            {
                try
                {
                    bool resAlreadyExist;

                    string tracksPath = mapResourcesDirPath + "GPXTracks";
                    File tracksDir    = new File(tracksPath);
                    resAlreadyExist   = tracksDir.Exists();
                    if (!resAlreadyExist || _update)
                    {
                        if (!resAlreadyExist)
                        {
                            tracksDir.Mkdirs();
                        }
                        DemoUtils.CopyAssetsToFolder(Assets, "GPXTracks", mapResourcesDirPath + "GPXTracks");
                    }

                    string imagesPath = mapResourcesDirPath + "images";
                    File imagesDir    = new File(imagesPath);
                    resAlreadyExist   = imagesDir.Exists();
                    if (!resAlreadyExist || _update)
                    {
                        if (!resAlreadyExist)
                        {
                            imagesDir.Mkdirs();
                        }
                        DemoUtils.CopyAssetsToFolder(Assets, "images", mapResourcesDirPath + "images");
                    }
                }
                catch (IOException e)
                {
                    e.PrintStackTrace();
                }
            });
        }