コード例 #1
0
        public void SaveToFile(string saveFilename)
        {
            GC.Collect();
            SaveToXml(false);

            FileCabinet fc = new FileCabinet(saveFilename, BaseWorkingDirectory);

            fc.PackageID      = this.Id;
            this.saveFileName = saveFilename;
            fc.AddFile(filename);

            List <Guid> masterList = CreateLayerMasterList();

            string path = fc.TempDirectory + string.Format("{0}", fc.PackageID);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }



            foreach (Guid id in masterList)
            {
                if (LayerManager.LayerList.ContainsKey(id))
                {
                    LayerManager.LayerList[id].AddFilesToCabinet(fc);
                }
            }

            fc.Package();
            TourDirty = false;
        }
コード例 #2
0
ファイル: Tour.cs プロジェクト: hxhlb/wwt-windows-client
        public void SaveToFile(string saveFilename, bool tempFile, bool excludeAudio)
        {
            CleanUp();
            GC.Collect();
            SaveToXml(false);

            FileCabinet fc = new FileCabinet(saveFilename, BaseWorkingDirectory);

            fc.PackageID = this.Id;
            if (!tempFile)
            {
                this.saveFileName = saveFilename;
            }

            fc.AddFile(filename);

            if (authorImage != null)
            {
                fc.AddFile(WorkingDirectory + "Author.Png");
            }

            foreach (TourStop stop in TourStops)
            {
                stop.AddFilesToCabinet(fc, excludeAudio);
            }

            List <Guid> masterList = CreateLayerMasterList();

            foreach (Guid id in masterList)
            {
                if (LayerManager.LayerList.ContainsKey(id))
                {
                    LayerManager.LayerList[id].AddFilesToCabinet(fc);
                }
            }

            fc.Package();
            TourDirty = false;
        }
コード例 #3
0
        public static void ExtractCache()
        {
            SaveFileDialog saveDialog = new SaveFileDialog();
            saveDialog.Filter = Language.GetLocalizedText(1056, "WWT Cabinet File(*.cabinet)|*.cabinet");
            saveDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            saveDialog.AddExtension = true;
            saveDialog.DefaultExt = ".cabinet";

            if (saveDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string path = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Microsoft\\WorldWideTelescope";

                    FileCabinet cab = new FileCabinet(saveDialog.FileName, Properties.Settings.Default.CahceDirectory);

                    InjestDirectory(cab, path);
                    cab.Package();
                }
                catch (Exception ex)
                {
                    UiTools.ShowMessageBox(ex.Message, "Error Saving cache");
                }
            }
        }
コード例 #4
0
        public void SaveToFile(string saveFilename)
        {
            GC.Collect();
            SaveToXml(false);

            var fc = new FileCabinet(saveFilename, BaseWorkingDirectory);
            fc.PackageID = Id;
            saveFileName = saveFilename;
            fc.AddFile(filename);

            var masterList = CreateLayerMasterList();

            var path = fc.TempDirectory + string.Format("{0}", fc.PackageID);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            foreach (var id in masterList)
            {
                if (LayerManager.LayerList.ContainsKey(id))
                {
                    LayerManager.LayerList[id].AddFilesToCabinet(fc);
                }
            }

            fc.Package();
            TourDirty = false;
        }
コード例 #5
0
ファイル: Tour.cs プロジェクト: bluephoton/wwt-windows-client
        public void SaveToFile(string saveFilename, bool tempFile, bool excludeAudio)
        {
            CleanUp();
            GC.Collect();
            SaveToXml(false);

            var fc = new FileCabinet(saveFilename, BaseWorkingDirectory);
            fc.PackageID = Id;
            if (!tempFile)
            {
                saveFileName = saveFilename;
            }

            fc.AddFile(filename);

            if (authorImage != null)
            {
                fc.AddFile(WorkingDirectory + "Author.Png");
            }

            foreach (var stop in TourStops)
            {
                stop.AddFilesToCabinet(fc, excludeAudio);
            }

            var masterList = CreateLayerMasterList();

            foreach (var id in masterList)
            {
                if (LayerManager.LayerList.ContainsKey(id))
                {
                    LayerManager.LayerList[id].AddFilesToCabinet(fc);
                }
            }

            fc.Package();
            TourDirty = false;
        }