示例#1
0
        public static void ExportFile(FileEntry entry)
        {
            string selectedFilename;

            // Open a folder selection instead of file selection only if there is need to.
            if (entry is ResourceEntry && Properties.Settings.Default.ExportResourcesChoice == Settings.ExportResourcesChoice.SYSGFX && ((ResourceEntry)entry).GraphicSize > 0)
            {
                selectedFilename = GUI.FolderSelection();
            }
            else
            {
                selectedFilename = GUI.FileSaveSelection(entry.Name);
            }
            if (selectedFilename != null)
            {
                ProgressWindow progress = new ProgressWindow("Exporting", report => entry.Export(selectedFilename, report), true);
                try
                {
                    progress.Run();
                }
                catch (OperationCanceledException)
                {
                    MessageBox.Show("Operation canceled.");
                }
                catch (Exception)
                {
                    MessageBox.Show("Operation canceled.");
                }
            }
        }
示例#2
0
        public static void ExportFile(FileEntry entry)
        {
            string selectedFilename;

            if (entry is ResourceEntry)
            {
                selectedFilename = GUI.FolderSelection();
            }
            else
            {
                selectedFilename = GUI.FileSaveSelection(entry.Name);
            }
            if (selectedFilename != null)
            {
                entry.Export(selectedFilename);
            }
        }