initial commit
This commit is contained in:
commit
1b60743303
274 changed files with 25866 additions and 0 deletions
954
Explorer/UserControls/DiscViewExplorer.cs
Normal file
954
Explorer/UserControls/DiscViewExplorer.cs
Normal file
|
@ -0,0 +1,954 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.DiscViewExplorer
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.DiscView;
|
||||
using GDRomExplorer.Events;
|
||||
using GDRomExplorer.Forms;
|
||||
using GDRomExplorer.Others;
|
||||
using GDRomExplorer.ShellDataTransfert;
|
||||
using ImageReader.ISO9660.DirectoryRecords;
|
||||
using ImageReader.ISO9660.VolumeDescriptors;
|
||||
using SEGATools.CueSheet;
|
||||
using SEGATools.Disc;
|
||||
using SEGATools.DiscFileSystem;
|
||||
using SEGATools.Encrypt;
|
||||
using SEGATools.Security;
|
||||
using SEGATools.SortFile;
|
||||
using SEGATools.VirtualFile;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class DiscViewExplorer : UserControl
|
||||
{
|
||||
private static readonly Logger.ILog logger = Logger.CreateLog();
|
||||
private IDiscFileSystem discFileSystem;
|
||||
private TreeNode treeNodeInListView;
|
||||
private Control lastControlWithFocus;
|
||||
private MenuItemFactory menuItemFactory;
|
||||
private ContextMenuManager contextMenuManager;
|
||||
private UserActions userActions;
|
||||
private ToolStripItem[] discMenuItems;
|
||||
private DiscSelectionHandlerFactory treeViewSelectionHandlerFactory;
|
||||
private DiscSelectionHandlerFactory listViewSelectionHandlerFactory;
|
||||
private IContainer components;
|
||||
private GroupBox groupBox;
|
||||
private SplitContainer splitContainer;
|
||||
private TreeView treeView;
|
||||
private ListView listView;
|
||||
private DiscExtractor discExtractor;
|
||||
private SaveFileDialog saveFileDialogForInitialProgram;
|
||||
private SaveFileDialog saveFileDialogForExtraction;
|
||||
private SaveFileDialog saveFileDialogForCueSheet;
|
||||
private SaveFileDialog saveFileDialogForSortFile;
|
||||
private FolderBrowserDialog folderBrowserDialogForExtraction;
|
||||
private SaveFileDialog saveFileDialogForDesDecrypt;
|
||||
private GDDAConverterTool gddaConverterTool;
|
||||
private ImageList treeViewImageList;
|
||||
private ImageList listViewImageList;
|
||||
private ImageList contextMenuImageList;
|
||||
|
||||
public event EventHandler<EventArgs<DiscViewExplorer.ActionsForEditMenuItem>> SelectionChanged;
|
||||
|
||||
public string Title
|
||||
{
|
||||
get => this.groupBox.Text;
|
||||
private set => this.groupBox.Text = string.Format(GDRomExplorer.Resources.Strings.DiscViewExplorerGroupLabelWithFormat, (object) value);
|
||||
}
|
||||
|
||||
public string Filename => this.discFileSystem != null ? this.discFileSystem.FileName : string.Empty;
|
||||
|
||||
public DiscViewExplorer()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.userActions = new UserActions();
|
||||
this.userActions.SetHandler(UserActions.Action.ExportForGDEmu, new EventHandler(this.UserActionExportForGDEmu));
|
||||
this.userActions.SetHandler(UserActions.Action.CreateCueSheet, new EventHandler(this.UserActionCreateCueSheet));
|
||||
this.userActions.SetHandler(UserActions.Action.ShowGDDAConversion, new EventHandler(this.UserActionShowGDDAConversionForm));
|
||||
this.userActions.SetHandler(UserActions.Action.ShowBootSector, new EventHandler(this.UserActionShowBootSector));
|
||||
this.userActions.SetHandler(UserActions.Action.ExtractBootSector, new EventHandler(this.UserActionExtractInitialProgram));
|
||||
this.userActions.SetHandler(UserActions.Action.ExtractItem, new EventHandler(this.UserActionExtractItem));
|
||||
this.userActions.SetHandler(UserActions.Action.CreateSortFile, new EventHandler(this.UserActionGenerateSortFile));
|
||||
this.userActions.SetHandler(UserActions.Action.ShowPrimaryVolumeDescriptor, new EventHandler(this.UserActionShowPrimaryVolumeDescriptor));
|
||||
this.userActions.SetHandler(UserActions.Action.ConvertGDDA, new EventHandler(this.UserActionConvertGDDA));
|
||||
this.userActions.SetHandler(UserActions.Action.DecryptNaomiBinary, new EventHandler(this.UserActionDecryptBinaryFromDisc));
|
||||
this.treeViewSelectionHandlerFactory = (DiscSelectionHandlerFactory) new DiscTreeViewSelectionHandlerFactory(this, this.treeView);
|
||||
this.listViewSelectionHandlerFactory = (DiscSelectionHandlerFactory) new DiscListViewSelectionHandlerFactory(this, this.listView);
|
||||
this.menuItemFactory = new MenuItemFactory(this.userActions, this.contextMenuImageList);
|
||||
this.contextMenuManager = new ContextMenuManager(this.menuItemFactory);
|
||||
this.Resize += new EventHandler(this.DiscViewExplorer_Resize);
|
||||
this.Leave += new EventHandler(this.DiscViewExplorer_Leave);
|
||||
this.listView.Columns.Add(GDRomExplorer.Resources.Strings.DiscViewListColumnFileName, -2, HorizontalAlignment.Left);
|
||||
this.listView.Columns.Add(GDRomExplorer.Resources.Strings.DiscViewListColumnSize, -2, HorizontalAlignment.Right);
|
||||
this.listView.Columns.Add(GDRomExplorer.Resources.Strings.DiscViewListColumnSizeInBytes, -2, HorizontalAlignment.Right);
|
||||
this.listView.Columns.Add(GDRomExplorer.Resources.Strings.DiscViewListColumnLBA, -2, HorizontalAlignment.Right);
|
||||
this.listView.Columns.Add(GDRomExplorer.Resources.Strings.DiscViewListColumnModifiedDate, -2, HorizontalAlignment.Right);
|
||||
this.listView.MouseClick += new MouseEventHandler(this.listView_MouseClick);
|
||||
this.listView.MouseDoubleClick += new MouseEventHandler(this.listView_MouseClick);
|
||||
this.listView.MouseUp += new MouseEventHandler(this.listView_MouseClick);
|
||||
this.listView.ColumnClick += new ColumnClickEventHandler(this.listView_ColumnClick);
|
||||
this.listView.KeyDown += new KeyEventHandler(this.listView_KeyDown);
|
||||
this.listView.KeyUp += new KeyEventHandler(this.listView_KeyUp);
|
||||
this.listView.ItemDrag += new ItemDragEventHandler(this.DiscViewExplorer_ItemDrag);
|
||||
this.listView.GotFocus += new EventHandler(this.listView_GotFocus);
|
||||
this.listView.LostFocus += new EventHandler(this.DiscViewExplorer_Leave);
|
||||
this.listView.ListViewItemSorter = (IComparer) new ListViewColumnSorter()
|
||||
{
|
||||
Order = SortOrder.Ascending
|
||||
};
|
||||
this.treeView.AfterSelect += new TreeViewEventHandler(this.treeView_AfterSelect);
|
||||
this.treeView.MouseClick += new MouseEventHandler(this.treeView_MouseClick);
|
||||
this.treeView.MouseDoubleClick += new MouseEventHandler(this.treeView_MouseClick);
|
||||
this.treeView.ItemDrag += new ItemDragEventHandler(this.DiscViewExplorer_ItemDrag);
|
||||
this.treeView.GotFocus += new EventHandler(this.treeView_GotFocus);
|
||||
this.treeView.Leave += new EventHandler(this.DiscViewExplorer_Leave);
|
||||
this.saveFileDialogForInitialProgram.Title = GDRomExplorer.Resources.Strings.SfdInitialProgramTitle;
|
||||
this.saveFileDialogForInitialProgram.Filter = GDRomExplorer.Resources.Strings.SfdInitialProgramFilter;
|
||||
this.saveFileDialogForExtraction.Title = GDRomExplorer.Resources.Strings.SfdExtractTitle;
|
||||
this.saveFileDialogForExtraction.Filter = GDRomExplorer.Resources.Strings.SfdExtractFilter;
|
||||
this.saveFileDialogForCueSheet.Title = GDRomExplorer.Resources.Strings.SfdCueSheetTitle;
|
||||
this.saveFileDialogForCueSheet.Filter = GDRomExplorer.Resources.Strings.SfdCueSheetFilter;
|
||||
this.saveFileDialogForSortFile.Title = GDRomExplorer.Resources.Strings.SfdSortFileTitle;
|
||||
this.saveFileDialogForSortFile.Filter = GDRomExplorer.Resources.Strings.SfdSortFileFilter;
|
||||
this.saveFileDialogForDesDecrypt.Title = GDRomExplorer.Resources.Strings.NaomiEncryptDecryptToolSfdDecTitle;
|
||||
this.saveFileDialogForDesDecrypt.Filter = GDRomExplorer.Resources.Strings.NaomiEncryptDecryptToolSfdDecFilter;
|
||||
this.folderBrowserDialogForExtraction.Description = GDRomExplorer.Resources.Strings.FbdExtractFilesTitle;
|
||||
this.folderBrowserDialogForExtraction.RootFolder = Environment.SpecialFolder.Desktop;
|
||||
}
|
||||
|
||||
private void DiscViewExplorer_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
{
|
||||
if (e.Button != MouseButtons.Left)
|
||||
return;
|
||||
if (sender == this.listView)
|
||||
{
|
||||
this.HandleDragAndDropFrom(this.listView);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sender != this.treeView)
|
||||
throw new NotSupportedException();
|
||||
this.treeView.SelectedNode = e.Item as TreeNode;
|
||||
this.HandleDragAndDropFrom(this.treeView);
|
||||
}
|
||||
}
|
||||
|
||||
private void DiscViewExplorer_Load(object sender, EventArgs e) => this.CloseDisc();
|
||||
|
||||
private void DiscViewExplorer_Resize(object sender, EventArgs e) => this.ResizeListView();
|
||||
|
||||
private void DiscViewExplorer_Leave(object sender, EventArgs e) => this.contextMenuManager.CloseContextMenuIfAny();
|
||||
|
||||
public void LoadDisc(IDiscFileSystem discFileSystem)
|
||||
{
|
||||
this.EnableUIElements();
|
||||
this.discFileSystem = discFileSystem;
|
||||
this.discExtractor.DiscFileSystem = discFileSystem;
|
||||
this.Title = discFileSystem.DiscName;
|
||||
this.discMenuItems = this.menuItemFactory.CreateDiscWithSessionTopMenuItem(discFileSystem);
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(discFileSystem.FileName));
|
||||
TreeNode tree = ExplorerTreeNodeFactory.CreateTree(discFileSystem);
|
||||
this.treeView.Nodes.Add(tree);
|
||||
this.UpdateTreeViewSelectedNode(this.FindFileSystemTreeNode(discFileSystem, tree));
|
||||
}
|
||||
|
||||
public void CloseDisc()
|
||||
{
|
||||
this.DisableUIElements();
|
||||
this.treeNodeInListView = (TreeNode) null;
|
||||
this.discFileSystem = (IDiscFileSystem) null;
|
||||
this.DisableSelectionAndNotify();
|
||||
}
|
||||
|
||||
private TreeNode FindFileSystemTreeNode(IDiscFileSystem disc, TreeNode rootNode)
|
||||
{
|
||||
TreeNode treeNode1 = rootNode;
|
||||
foreach (IDiscSession discSession in (IEnumerable<IDiscSession>) disc.Sessions.OrderByDescending<IDiscSession, int>((Func<IDiscSession, int>) (session => session.Index)))
|
||||
{
|
||||
TreeNode[] treeNodeArray = rootNode.Nodes.Find(discSession.Name, false);
|
||||
if (treeNodeArray.Length != 0)
|
||||
{
|
||||
TreeNode treeNode2 = treeNodeArray[0];
|
||||
treeNode1 = treeNode2;
|
||||
if (treeNode2.FirstNode != null)
|
||||
{
|
||||
TreeNode firstNode = treeNode2.FirstNode;
|
||||
if (firstNode.Tag is IDiscTrack tag && tag.TrackData == TrackModeType.Data && (firstNode.LastNode != null && firstNode.LastNode.Tag is DirectoryRecord))
|
||||
{
|
||||
treeNode1 = firstNode.LastNode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return treeNode1;
|
||||
}
|
||||
|
||||
private void DisableUIElements()
|
||||
{
|
||||
this.Title = GDRomExplorer.Resources.Strings.DiscViewNoDiscTitle;
|
||||
this.treeView.Enabled = false;
|
||||
this.treeView.Nodes.Clear();
|
||||
this.treeView.BackColor = SystemColors.Control;
|
||||
this.listView.Enabled = false;
|
||||
this.listView.Items.Clear();
|
||||
this.listView.Scrollable = false;
|
||||
}
|
||||
|
||||
private void EnableUIElements()
|
||||
{
|
||||
this.treeView.BackColor = SystemColors.Window;
|
||||
this.treeView.Nodes.Clear();
|
||||
this.treeView.Enabled = true;
|
||||
this.listView.Items.Clear();
|
||||
this.listView.Scrollable = true;
|
||||
this.listView.Enabled = true;
|
||||
}
|
||||
|
||||
private void ShowBootSector(InitialProgramExtended ip)
|
||||
{
|
||||
using (FormInitialProgram formInitialProgram = new FormInitialProgram(ip, Path.GetDirectoryName(this.discFileSystem.FileName)))
|
||||
{
|
||||
int num = (int) formInitialProgram.ShowDialog((IWin32Window) this);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowPVD(PrimaryVolumeDescriptor PrimVolDesc)
|
||||
{
|
||||
using (FormPrimaryVolumeDescriptor volumeDescriptor = new FormPrimaryVolumeDescriptor(PrimVolDesc))
|
||||
{
|
||||
int num = (int) volumeDescriptor.ShowDialog((IWin32Window) this);
|
||||
}
|
||||
}
|
||||
|
||||
private void FillListView(DirectoryRecord directoryRecordToRead, TreeNode origin)
|
||||
{
|
||||
this.listView.Cursor = Cursors.AppStarting;
|
||||
this.listView.BeginUpdate();
|
||||
this.listView.Items.Clear();
|
||||
ListViewItem listViewItem1 = (ListViewItem) null;
|
||||
if (!directoryRecordToRead.IsRoot)
|
||||
{
|
||||
ListViewItem parentDirectoryItem = ExplorerListItemFactory.CreateParentDirectoryItem(directoryRecordToRead);
|
||||
this.listView.Items.Add(parentDirectoryItem);
|
||||
listViewItem1 = parentDirectoryItem;
|
||||
}
|
||||
ListViewItem[] items = new ListViewItem[directoryRecordToRead.SubDirectories.Count];
|
||||
int num = 0;
|
||||
foreach (DirectoryRecord subDirectory in directoryRecordToRead.SubDirectories)
|
||||
{
|
||||
ListViewItem listViewItem2 = ExplorerListItemFactory.CreateItem(subDirectory, this.discFileSystem);
|
||||
items[num++] = listViewItem2;
|
||||
if (origin != null && listViewItem2.Tag == origin.Tag)
|
||||
listViewItem1 = listViewItem2;
|
||||
}
|
||||
this.listView.Items.AddRange(items);
|
||||
this.listView.FocusedItem = listViewItem1;
|
||||
this.listView.Cursor = Cursors.Default;
|
||||
this.listView.EndUpdate();
|
||||
this.ResizeListView();
|
||||
}
|
||||
|
||||
private void ConvertGDDA(IDiscTrack discTrack)
|
||||
{
|
||||
using (FormAudioConversionSettings conversionSettings = new FormAudioConversionSettings())
|
||||
{
|
||||
if (conversionSettings.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
this.gddaConverterTool.ConvertGDDATracks(discTrack, conversionSettings.AudioConversionSettings);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExtractAndDecryptFile(DirectoryRecord directoryRecord)
|
||||
{
|
||||
if (directoryRecord == null || directoryRecord.IsDirectory)
|
||||
return;
|
||||
DESKey desKey;
|
||||
using (FormGetDESKey extractAndDecryptLabel = FormGetDESKey.aGetDESKeyFormWithExtractAndDecryptLabel(this.discFileSystem.NaomiDESKey))
|
||||
{
|
||||
if (extractAndDecryptLabel.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
desKey = extractAndDecryptLabel.DESKey;
|
||||
}
|
||||
this.saveFileDialogForDesDecrypt.FileName = Path.GetFileNameWithoutExtension(directoryRecord.Name);
|
||||
if (this.saveFileDialogForDesDecrypt.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
string fileName = this.saveFileDialogForDesDecrypt.FileName;
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(fileName));
|
||||
this.saveFileDialogForDesDecrypt.FileName = Path.GetFileNameWithoutExtension(fileName);
|
||||
IVirtualFile<DirectoryRecord> virtualFile1 = VirtualFileFactory.createVirtualFile(directoryRecord, this.discFileSystem);
|
||||
IVirtualFile<string> virtualFile2 = VirtualFileFactory.createVirtualFile(fileName);
|
||||
DesEncryptDecryptTool desDecryptor = new DesEncryptDecryptTool();
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
FormProcess.createForDesDecryptor(desDecryptor, TaskId);
|
||||
desDecryptor.DecryptAsync((IVirtualFile) virtualFile1, (IVirtualFile) virtualFile2, desKey, (object) TaskId);
|
||||
}
|
||||
|
||||
private void ExtractInitialProgram(InitialProgramExtended initialProgramExtended)
|
||||
{
|
||||
this.saveFileDialogForInitialProgram.FileName = initialProgramExtended.FileName;
|
||||
if (this.saveFileDialogForInitialProgram.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
string fileName = this.saveFileDialogForInitialProgram.FileName;
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(fileName));
|
||||
try
|
||||
{
|
||||
this.discExtractor.ExtractBootStrap((InitialProgram) initialProgramExtended, fileName);
|
||||
AppStatus.NotifyNewAppStatus(string.Format(GDRomExplorer.Resources.Strings.MsgBoxInitialProgramExtractionSuccessWithFormat, (object) fileName));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DiscViewExplorer.logger.ErrorFormat("Unable to extract the boot file: {0}", (object) ex);
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, GDRomExplorer.Resources.Strings.MsgBoxInitialProgramExtractionErrorWithFormat, GDRomExplorer.Resources.Strings.MsgBoxInitialProgramExtractionTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
AppStatus.NotifyNewAppStatus(string.Format(GDRomExplorer.Resources.Strings.MsgBoxInitialProgramExtractionErrorWithFormat, (object) fileName));
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportForGDEmu(IDiscFileSystem discFileSystem)
|
||||
{
|
||||
using (FormGDEmuExportSettings emuExportSettings = new FormGDEmuExportSettings(discFileSystem))
|
||||
{
|
||||
int num = (int) emuExportSettings.ShowDialog((IWin32Window) this);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateCueSheet(IDiscSession discSession)
|
||||
{
|
||||
string Title = string.Format("{0} ({1})", (object) this.discFileSystem.DiscName, (object) discSession.Name);
|
||||
this.saveFileDialogForCueSheet.FileName = Title;
|
||||
if (this.saveFileDialogForCueSheet.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
string fileName = this.saveFileDialogForCueSheet.FileName;
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(fileName));
|
||||
this.saveFileDialogForCueSheet.FileName = Path.GetFileNameWithoutExtension(fileName);
|
||||
try
|
||||
{
|
||||
CueSheetCreator.CreateFromDiscSession(discSession, fileName, Title);
|
||||
AppStatus.NotifyNewAppStatus(GDRomExplorer.Resources.Strings.MsgBoxCueCreatorSuccess);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DiscViewExplorer.logger.ErrorFormat("Unable to create the sort file: {0}", (object) ex);
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, GDRomExplorer.Resources.Strings.MsgBoxCueCreatorError, GDRomExplorer.Resources.Strings.MsgBoxCueCreatorTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
AppStatus.NotifyNewAppStatus(GDRomExplorer.Resources.Strings.MsgBoxCueCreatorError);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateSortFile(IDiscSession discSession)
|
||||
{
|
||||
string pathPrefix;
|
||||
int lowestFileWeight;
|
||||
using (FormSortFileOptions formSortFileOptions = new FormSortFileOptions())
|
||||
{
|
||||
if (formSortFileOptions.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
pathPrefix = formSortFileOptions.PathPrefix;
|
||||
lowestFileWeight = formSortFileOptions.LowestFileWeight;
|
||||
}
|
||||
if (string.IsNullOrEmpty(Path.GetFileName(this.saveFileDialogForSortFile.FileName)))
|
||||
this.saveFileDialogForSortFile.FileName = SortFileCreator.DefaultFileName;
|
||||
if (this.saveFileDialogForSortFile.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
string fileName = this.saveFileDialogForSortFile.FileName;
|
||||
this.saveFileDialogForSortFile.FileName = Path.GetFileNameWithoutExtension(fileName);
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(fileName));
|
||||
try
|
||||
{
|
||||
SortFileCreator.CreateSortFile(discSession, pathPrefix, lowestFileWeight, fileName);
|
||||
AppStatus.NotifyNewAppStatus(GDRomExplorer.Resources.Strings.MsgBoxSortFileCreationSuccess);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DiscViewExplorer.logger.ErrorFormat("Unable to create the sort file: {0}", (object) ex);
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, GDRomExplorer.Resources.Strings.MsgBoxSortFileCreationError, GDRomExplorer.Resources.Strings.MsgBoxSortFileCreationTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
AppStatus.NotifyNewAppStatus(GDRomExplorer.Resources.Strings.MsgBoxSortFileCreationError);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenExtractNodesDialog(List<DirectoryRecord> DirectoryRecords)
|
||||
{
|
||||
if (DirectoryRecords == null || DirectoryRecords.Count == 0)
|
||||
{
|
||||
DiscViewExplorer.logger.Debug((object) "Nothing to extract!");
|
||||
}
|
||||
else
|
||||
{
|
||||
string str;
|
||||
if (DirectoryRecords.Count == 1 && !DirectoryRecords[0].IsDirectory)
|
||||
{
|
||||
this.saveFileDialogForExtraction.FileName = DirectoryRecords[0].Name;
|
||||
if (this.saveFileDialogForExtraction.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
str = this.saveFileDialogForExtraction.FileName;
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(str));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.folderBrowserDialogForExtraction.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
str = this.folderBrowserDialogForExtraction.SelectedPath;
|
||||
this.UpdateDialogsPath(str);
|
||||
}
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
FormProcess.createForDiscExtractor(this.discExtractor, TaskId);
|
||||
this.discExtractor.ExtractPathsAsync(DirectoryRecords, str, (object) TaskId);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenExtractNodesDialogForDiscTrack(IDiscTrack discTrack)
|
||||
{
|
||||
this.saveFileDialogForExtraction.FileName = Path.GetFileName(discTrack.VirtualName);
|
||||
if (this.saveFileDialogForExtraction.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
string fileName = this.saveFileDialogForExtraction.FileName;
|
||||
this.UpdateDialogsPath(Path.GetDirectoryName(fileName));
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
FormProcess.createForDiscExtractor(this.discExtractor, TaskId);
|
||||
this.discExtractor.ExtractDiscTracksAsync(discTrack, fileName, (object) TaskId);
|
||||
}
|
||||
|
||||
private void UpdateDialogsPath(string outputPath) => this.saveFileDialogForInitialProgram.InitialDirectory = this.saveFileDialogForExtraction.InitialDirectory = this.saveFileDialogForCueSheet.InitialDirectory = this.saveFileDialogForSortFile.InitialDirectory = this.saveFileDialogForDesDecrypt.InitialDirectory = this.folderBrowserDialogForExtraction.SelectedPath = outputPath;
|
||||
|
||||
private void ResizeListView()
|
||||
{
|
||||
this.listView.SuspendLayout();
|
||||
for (int index = 0; index < this.listView.Columns.Count; ++index)
|
||||
this.listView.Columns[index].Width = -2;
|
||||
this.listView.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private void DisableSelectionAndNotify()
|
||||
{
|
||||
if (this.SelectionChanged == null)
|
||||
return;
|
||||
this.SelectionChanged((object) this, new EventArgs<DiscViewExplorer.ActionsForEditMenuItem>(DiscViewExplorer.ActionsForEditMenuItem.NoEditActions()));
|
||||
}
|
||||
|
||||
private void RemoveSelectionAndNotify()
|
||||
{
|
||||
if (this.SelectionChanged == null)
|
||||
return;
|
||||
this.SelectionChanged((object) this, this.CreateNewSelectionEvent(this.menuItemFactory.CreateSelectionDisabledTopMenuItem()));
|
||||
}
|
||||
|
||||
private void NotifySelectionChanged(ToolStripItem[] NewSelectionMenuItems)
|
||||
{
|
||||
if (this.SelectionChanged == null)
|
||||
return;
|
||||
this.SelectionChanged((object) this, this.CreateNewSelectionEvent(NewSelectionMenuItems));
|
||||
}
|
||||
|
||||
private EventArgs<DiscViewExplorer.ActionsForEditMenuItem> CreateNewSelectionEvent(
|
||||
ToolStripItem[] NewSelectionMenuItems)
|
||||
{
|
||||
return new EventArgs<DiscViewExplorer.ActionsForEditMenuItem>(new DiscViewExplorer.ActionsForEditMenuItem(this.discMenuItems, NewSelectionMenuItems));
|
||||
}
|
||||
|
||||
private void UpdateTreeViewSelectedNode(TreeNode newSelection)
|
||||
{
|
||||
this.treeView.SelectedNode = newSelection;
|
||||
this.treeView.SelectedNode.EnsureVisible();
|
||||
this.treeView.SelectedNode.Expand();
|
||||
}
|
||||
|
||||
private void NagivateUp()
|
||||
{
|
||||
if (this.treeNodeInListView.Parent == null || !(this.treeNodeInListView.Parent.Tag is DirectoryRecord))
|
||||
return;
|
||||
this.treeView.SelectedNode = this.treeNodeInListView.Parent;
|
||||
}
|
||||
|
||||
private void NavigateDown()
|
||||
{
|
||||
if (this.listView.FocusedItem == null || !(this.listView.FocusedItem.Tag is DirectoryRecord) || !(this.listView.FocusedItem.Tag as DirectoryRecord).IsDirectory)
|
||||
return;
|
||||
if (this.treeNodeInListView.Tag == this.listView.FocusedItem.Tag)
|
||||
{
|
||||
this.NagivateUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode[] treeNodeArray = this.treeNodeInListView.Nodes.Find(this.listView.FocusedItem.Name, false);
|
||||
if (treeNodeArray.Length != 1)
|
||||
return;
|
||||
this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView(treeNodeArray[0].Tag));
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectAllListViewItems()
|
||||
{
|
||||
foreach (ListViewItem listViewItem in this.listView.Items)
|
||||
{
|
||||
if (!DirectoryRecord.PARENT_DIRECTORY_NAME.Equals(listViewItem.Text))
|
||||
listViewItem.Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void UserActionExportForGDEmu(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscFileSystem))
|
||||
return;
|
||||
this.ExportForGDEmu(toolStripItem.Tag as IDiscFileSystem);
|
||||
}
|
||||
|
||||
private void UserActionCreateCueSheet(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscSession))
|
||||
return;
|
||||
this.CreateCueSheet(toolStripItem.Tag as IDiscSession);
|
||||
}
|
||||
|
||||
private void UserActionShowGDDAConversionForm(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscSession))
|
||||
return;
|
||||
using (FormGdda formGdda = new FormGdda(toolStripItem.Tag as IDiscSession))
|
||||
{
|
||||
if (formGdda.ShowDialog((IWin32Window) this) != DialogResult.OK)
|
||||
return;
|
||||
this.gddaConverterTool.ConvertGDDATracks((IList<IDiscTrack>) formGdda.SelectedDiscTracks, formGdda.AudioConversionSettings);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserActionShowBootSector(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is InitialProgramExtended))
|
||||
return;
|
||||
this.ShowBootSector(toolStripItem.Tag as InitialProgramExtended);
|
||||
}
|
||||
|
||||
private void UserActionExtractInitialProgram(object sender, EventArgs eventArgs)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is InitialProgramExtended))
|
||||
return;
|
||||
this.ExtractInitialProgram(toolStripItem.Tag as InitialProgramExtended);
|
||||
}
|
||||
|
||||
private void UserActionExtractItem(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
List<DirectoryRecord> DirectoryRecords = new List<DirectoryRecord>();
|
||||
if (toolStripItem.Tag is List<DirectoryRecord>)
|
||||
this.OpenExtractNodesDialog(toolStripItem.Tag as List<DirectoryRecord>);
|
||||
else if (toolStripItem.Tag is DirectoryRecord)
|
||||
{
|
||||
DirectoryRecords.Add(toolStripItem.Tag as DirectoryRecord);
|
||||
this.OpenExtractNodesDialog(DirectoryRecords);
|
||||
}
|
||||
else if (toolStripItem.Tag is IDiscTrack)
|
||||
this.OpenExtractNodesDialogForDiscTrack(toolStripItem.Tag as IDiscTrack);
|
||||
else
|
||||
DiscViewExplorer.logger.ErrorFormat("Unhandled tag object {0} for ToolStripItem {1}", toolStripItem.Tag, (object) toolStripItem);
|
||||
}
|
||||
|
||||
private void UserActionGenerateSortFile(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscSession))
|
||||
return;
|
||||
this.CreateSortFile(toolStripItem.Tag as IDiscSession);
|
||||
}
|
||||
|
||||
private void UserActionShowPrimaryVolumeDescriptor(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscTrack))
|
||||
return;
|
||||
this.ShowPVD((toolStripItem.Tag as IDiscTrack).Session.PrimaryVolumeDescriptor);
|
||||
}
|
||||
|
||||
private void UserActionConvertGDDA(object sender, EventArgs e)
|
||||
{
|
||||
if (!(sender is ToolStripItem))
|
||||
return;
|
||||
ToolStripItem toolStripItem = sender as ToolStripItem;
|
||||
if (!(toolStripItem.Tag is IDiscTrack))
|
||||
return;
|
||||
this.ConvertGDDA(toolStripItem.Tag as IDiscTrack);
|
||||
}
|
||||
|
||||
private void UserActionDecryptBinaryFromDisc(object sender, EventArgs e)
|
||||
{
|
||||
if (this.listView.SelectedItems.Count != 1 || !(this.listView.SelectedItems[0].Tag is DirectoryRecord))
|
||||
return;
|
||||
this.ExtractAndDecryptFile(this.listView.SelectedItems[0].Tag as DirectoryRecord);
|
||||
}
|
||||
|
||||
private void HandleDragAndDropFrom(ListView ListView)
|
||||
{
|
||||
List<DirectoryRecord> list = ListView.SelectedItems.Cast<ListViewItem>().Select<ListViewItem, DirectoryRecord>((Func<ListViewItem, DirectoryRecord>) (item => (DirectoryRecord) item.Tag)).ToList<DirectoryRecord>();
|
||||
DataObject dataObject = FileDescriptorFactory.createDataObject((object) list, this.discFileSystem);
|
||||
if (dataObject != null)
|
||||
{
|
||||
int num = (int) this.DoDragDrop((object) dataObject, DragDropEffects.Copy);
|
||||
}
|
||||
else
|
||||
DiscViewExplorer.logger.WarnFormat("Drag'n Drop canceled: FileDescriptorFactory does not support {0}", (object) list);
|
||||
}
|
||||
|
||||
private void HandleDragAndDropFrom(TreeView TreeView)
|
||||
{
|
||||
object tag = TreeView.SelectedNode.Tag;
|
||||
DataObject dataObject = FileDescriptorFactory.createDataObject(tag, this.discFileSystem);
|
||||
if (dataObject != null)
|
||||
{
|
||||
int num = (int) this.DoDragDrop((object) dataObject, DragDropEffects.Copy);
|
||||
}
|
||||
else
|
||||
DiscViewExplorer.logger.WarnFormat("Drag'n Drop canceled: FileDescriptorFactory does not support {0}", tag);
|
||||
}
|
||||
|
||||
public void Disc_AfterSelectHandler(IDiscFileSystem disc) => this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) disc));
|
||||
|
||||
public void Disc_MouseRightClickHandler(IDiscFileSystem disc)
|
||||
{
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) disc);
|
||||
this.contextMenuManager.CreateAndShowContextMenu(itemsForTreeView);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
public void DirectoryRecord_AfterSelectClickHandler(DirectoryRecord DirectoryRecord)
|
||||
{
|
||||
DiscViewExplorer.logger.InfoFormat("Opening path \"{0}\"", (object) DirectoryRecord.FullPath);
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DirectoryRecord);
|
||||
TreeNode treeNodeInListView = this.treeNodeInListView;
|
||||
this.treeNodeInListView = this.treeView.SelectedNode;
|
||||
this.FillListView(DirectoryRecord, treeNodeInListView);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
public void DirectoryRecord_MouseRightClickHandler(DirectoryRecord DirectoryRecord)
|
||||
{
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DirectoryRecord);
|
||||
this.contextMenuManager.CreateAndShowContextMenu(itemsForTreeView);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
public void DirectoryRecords_MouseLeftClickHandler(IList<DirectoryRecord> DirectoryRecords)
|
||||
{
|
||||
DirectoryRecord firstDirectoryRecord = DirectoryRecords[0];
|
||||
if (!DirectoryRecords.All<DirectoryRecord>((Func<DirectoryRecord, bool>) (directoryRecord => directoryRecord.ParentDirectory == firstDirectoryRecord.ParentDirectory)))
|
||||
this.RemoveSelectionAndNotify();
|
||||
else
|
||||
this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForListView((object) DirectoryRecords, this.discFileSystem));
|
||||
}
|
||||
|
||||
public void DirectoryRecords_MouseDoubleLeftClicksHandler(
|
||||
IList<DirectoryRecord> DirectoryRecords)
|
||||
{
|
||||
DirectoryRecord directoryRecord = DirectoryRecords[0];
|
||||
if (!directoryRecord.IsDirectory)
|
||||
return;
|
||||
this.UpdateTreeViewSelectedNode(this.treeNodeInListView.Tag as DirectoryRecord != directoryRecord || this.treeNodeInListView.Parent == null ? this.treeNodeInListView.Nodes[directoryRecord.Name] : this.treeNodeInListView.Parent);
|
||||
}
|
||||
|
||||
public void DirectoryRecords_MouseRightClickHandler(IList<DirectoryRecord> DirectoryRecords)
|
||||
{
|
||||
DirectoryRecord firstDirectoryRecord = DirectoryRecords[0];
|
||||
if (!DirectoryRecords.All<DirectoryRecord>((Func<DirectoryRecord, bool>) (directoryRecord => directoryRecord.ParentDirectory == firstDirectoryRecord.ParentDirectory)))
|
||||
{
|
||||
this.RemoveSelectionAndNotify();
|
||||
}
|
||||
else
|
||||
{
|
||||
ToolStripItem[] itemsForListView = this.menuItemFactory.CreateSelectionMenuItemsForListView((object) DirectoryRecords, this.discFileSystem);
|
||||
this.contextMenuManager.CreateAndShowContextMenu(itemsForListView);
|
||||
this.NotifySelectionChanged(itemsForListView);
|
||||
}
|
||||
}
|
||||
|
||||
public void InitialProgram_AfterSelectHandler(InitialProgramExtended InitialProgram) => this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) InitialProgram));
|
||||
|
||||
public void InitialProgram_MouseDoubleLeftClicksHandler(InitialProgramExtended InitialProgram)
|
||||
{
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) InitialProgram);
|
||||
this.ShowBootSector(InitialProgram);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
public void InitialProgram_MouseRightClickHandler(InitialProgramExtended InitialProgram) => this.contextMenuManager.CreateAndShowContextMenu(this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) InitialProgram));
|
||||
|
||||
public void DiscSession_AfterSelectHandler(IDiscSession DiscSession) => this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DiscSession));
|
||||
|
||||
public void DiscSession_MouseRightClickHandler(IDiscSession DiscSession)
|
||||
{
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DiscSession);
|
||||
this.contextMenuManager.CreateAndShowContextMenu(itemsForTreeView);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
public void DiscTrack_AfterSelectHandler(IDiscTrack DiscTrack) => this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DiscTrack));
|
||||
|
||||
public void DiscTrack_MouseRightClickHandler(IDiscTrack DiscTrack)
|
||||
{
|
||||
ToolStripItem[] itemsForTreeView = this.menuItemFactory.CreateSelectionMenuItemsForTreeView((object) DiscTrack);
|
||||
this.contextMenuManager.CreateAndShowContextMenu(itemsForTreeView);
|
||||
this.NotifySelectionChanged(itemsForTreeView);
|
||||
}
|
||||
|
||||
private void treeView_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
TreeNode nodeAt = this.treeView.GetNodeAt(e.Location);
|
||||
if (nodeAt == null)
|
||||
return;
|
||||
this.treeView.SelectedNode = nodeAt;
|
||||
IDiscViewSelection discViewSelection = this.treeViewSelectionHandlerFactory.newSelectionHandlers(this.treeView.SelectedNode.Tag);
|
||||
if (discViewSelection != null)
|
||||
discViewSelection.HandleMouseEvent(e);
|
||||
else
|
||||
DiscViewExplorer.logger.ErrorFormat("Unhandled object {0}", (object) this.Handle);
|
||||
}
|
||||
|
||||
private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
TreeNode node = e.Node;
|
||||
if (node == null)
|
||||
return;
|
||||
this.treeViewSelectionHandlerFactory.newSelectionHandlers(node.Tag)?.HandleAfterSelect();
|
||||
}
|
||||
|
||||
private void treeView_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
if (this.lastControlWithFocus == this.treeView)
|
||||
return;
|
||||
this.lastControlWithFocus = (Control) this.treeView;
|
||||
if (this.treeView.SelectedNode != null)
|
||||
this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForTreeView(this.treeView.SelectedNode.Tag));
|
||||
else
|
||||
this.RemoveSelectionAndNotify();
|
||||
}
|
||||
|
||||
private void listView_MouseClick(object sender, MouseEventArgs mouseEvent)
|
||||
{
|
||||
if (this.listView.SelectedItems.Count == 0)
|
||||
this.RemoveSelectionAndNotify();
|
||||
else
|
||||
this.listViewSelectionHandlerFactory.newSelectionHandlers((object) this.listView.SelectedItems.Cast<ListViewItem>().Select<ListViewItem, DirectoryRecord>((Func<ListViewItem, DirectoryRecord>) (item => (DirectoryRecord) item.Tag)).ToList<DirectoryRecord>()).HandleMouseEvent(mouseEvent);
|
||||
}
|
||||
|
||||
private void listView_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||
{
|
||||
this.listView.BeginUpdate();
|
||||
this.listView.Sorting = this.listView.Sorting != SortOrder.Ascending ? (((ListViewColumnSorter) this.listView.ListViewItemSorter).Order = SortOrder.Ascending) : (((ListViewColumnSorter) this.listView.ListViewItemSorter).Order = SortOrder.Descending);
|
||||
((ListViewColumnSorter) this.listView.ListViewItemSorter).SortColumn = e.Column;
|
||||
this.listView.Sort();
|
||||
this.listView.EndUpdate();
|
||||
}
|
||||
|
||||
private void listView_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (this.listView.SelectedItems.Count == 0)
|
||||
this.RemoveSelectionAndNotify();
|
||||
else
|
||||
this.listViewSelectionHandlerFactory.newSelectionHandlers((object) this.listView.SelectedItems.Cast<ListViewItem>().Select<ListViewItem, DirectoryRecord>((Func<ListViewItem, DirectoryRecord>) (item => (DirectoryRecord) item.Tag)).ToList<DirectoryRecord>()).HandleLeftClick();
|
||||
}
|
||||
|
||||
private void listView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Control)
|
||||
{
|
||||
if (e.KeyCode != Keys.A)
|
||||
return;
|
||||
this.SelectAllListViewItems();
|
||||
}
|
||||
else if (e.KeyCode == Keys.Return)
|
||||
{
|
||||
this.NavigateDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.KeyCode != Keys.Back)
|
||||
return;
|
||||
this.NagivateUp();
|
||||
}
|
||||
}
|
||||
|
||||
private void listView_GotFocus(object sender, EventArgs e)
|
||||
{
|
||||
if (this.lastControlWithFocus == this.listView)
|
||||
return;
|
||||
this.lastControlWithFocus = (Control) this.listView;
|
||||
if (this.listView.SelectedItems.Count > 0)
|
||||
this.NotifySelectionChanged(this.menuItemFactory.CreateSelectionMenuItemsForListView((object) this.listView.SelectedItems.Cast<ListViewItem>().Select<ListViewItem, DirectoryRecord>((Func<ListViewItem, DirectoryRecord>) (item => (DirectoryRecord) item.Tag)).ToList<DirectoryRecord>(), this.discFileSystem));
|
||||
else
|
||||
this.RemoveSelectionAndNotify();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = (IContainer) new Container();
|
||||
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (DiscViewExplorer));
|
||||
this.groupBox = new GroupBox();
|
||||
this.splitContainer = new SplitContainer();
|
||||
this.treeView = new TreeView();
|
||||
this.treeViewImageList = new ImageList(this.components);
|
||||
this.listView = new ListView();
|
||||
this.listViewImageList = new ImageList(this.components);
|
||||
this.saveFileDialogForInitialProgram = new SaveFileDialog();
|
||||
this.saveFileDialogForExtraction = new SaveFileDialog();
|
||||
this.saveFileDialogForCueSheet = new SaveFileDialog();
|
||||
this.saveFileDialogForSortFile = new SaveFileDialog();
|
||||
this.folderBrowserDialogForExtraction = new FolderBrowserDialog();
|
||||
this.saveFileDialogForDesDecrypt = new SaveFileDialog();
|
||||
this.discExtractor = new DiscExtractor(this.components);
|
||||
this.contextMenuImageList = new ImageList(this.components);
|
||||
this.gddaConverterTool = new GDDAConverterTool(this.components);
|
||||
this.groupBox.SuspendLayout();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
this.splitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
this.groupBox.AutoSize = true;
|
||||
this.groupBox.BackColor = SystemColors.Window;
|
||||
this.groupBox.Controls.Add((Control) this.splitContainer);
|
||||
this.groupBox.Dock = DockStyle.Fill;
|
||||
this.groupBox.Location = new Point(4, 4);
|
||||
this.groupBox.Name = "groupBox";
|
||||
this.groupBox.Size = new Size(632, 472);
|
||||
this.groupBox.TabIndex = 0;
|
||||
this.groupBox.TabStop = false;
|
||||
this.groupBox.Text = "Disc title";
|
||||
this.splitContainer.Dock = DockStyle.Fill;
|
||||
this.splitContainer.Location = new Point(3, 16);
|
||||
this.splitContainer.Name = "splitContainer";
|
||||
this.splitContainer.Panel1.Controls.Add((Control) this.treeView);
|
||||
this.splitContainer.Panel2.Controls.Add((Control) this.listView);
|
||||
this.splitContainer.Size = new Size(626, 453);
|
||||
this.splitContainer.SplitterDistance = 207;
|
||||
this.splitContainer.TabIndex = 0;
|
||||
this.splitContainer.TabStop = false;
|
||||
this.treeView.BackColor = SystemColors.Window;
|
||||
this.treeView.Dock = DockStyle.Fill;
|
||||
this.treeView.HideSelection = false;
|
||||
this.treeView.HotTracking = true;
|
||||
this.treeView.ImageIndex = 0;
|
||||
this.treeView.ImageList = this.treeViewImageList;
|
||||
this.treeView.Indent = 18;
|
||||
this.treeView.ItemHeight = 18;
|
||||
this.treeView.Location = new Point(0, 0);
|
||||
this.treeView.Name = "treeView";
|
||||
this.treeView.SelectedImageIndex = 0;
|
||||
this.treeView.ShowLines = false;
|
||||
this.treeView.ShowNodeToolTips = true;
|
||||
this.treeView.Size = new Size(207, 453);
|
||||
this.treeView.TabIndex = 1;
|
||||
this.treeViewImageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("treeViewImageList.ImageStream");
|
||||
this.treeViewImageList.TransparentColor = Color.Transparent;
|
||||
this.treeViewImageList.Images.SetKeyName(0, "gd_icon.png");
|
||||
this.treeViewImageList.Images.SetKeyName(1, "dclogo_black.png");
|
||||
this.treeViewImageList.Images.SetKeyName(2, "cdrom_data.png");
|
||||
this.treeViewImageList.Images.SetKeyName(3, "cdrom_audio.png");
|
||||
this.treeViewImageList.Images.SetKeyName(4, "file_binary.png");
|
||||
this.treeViewImageList.Images.SetKeyName(5, "iso9660.png");
|
||||
this.treeViewImageList.Images.SetKeyName(6, "folder_closed.ico");
|
||||
this.treeViewImageList.Images.SetKeyName(7, "folder_open.ico");
|
||||
this.listView.AllowColumnReorder = true;
|
||||
this.listView.Dock = DockStyle.Fill;
|
||||
this.listView.Font = new Font("Microsoft Sans Serif", 8.25f);
|
||||
this.listView.FullRowSelect = true;
|
||||
this.listView.HideSelection = false;
|
||||
this.listView.LabelWrap = false;
|
||||
this.listView.Location = new Point(0, 0);
|
||||
this.listView.Name = "listView";
|
||||
this.listView.ShowGroups = false;
|
||||
this.listView.ShowItemToolTips = true;
|
||||
this.listView.Size = new Size(415, 453);
|
||||
this.listView.SmallImageList = this.listViewImageList;
|
||||
this.listView.Sorting = SortOrder.Ascending;
|
||||
this.listView.TabIndex = 2;
|
||||
this.listView.UseCompatibleStateImageBehavior = false;
|
||||
this.listView.View = View.Details;
|
||||
this.listViewImageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("listViewImageList.ImageStream");
|
||||
this.listViewImageList.TransparentColor = Color.Transparent;
|
||||
this.listViewImageList.Images.SetKeyName(0, "file.ico");
|
||||
this.listViewImageList.Images.SetKeyName(1, "folder_closed.ico");
|
||||
this.listViewImageList.Images.SetKeyName(2, "folder_up.ico");
|
||||
this.discExtractor.DiscFileSystem = (IDiscFileSystem) null;
|
||||
this.contextMenuImageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("contextMenuImageList.ImageStream");
|
||||
this.contextMenuImageList.TransparentColor = Color.Transparent;
|
||||
this.contextMenuImageList.Images.SetKeyName(0, "extract_icon.ico");
|
||||
this.contextMenuImageList.Images.SetKeyName(1, "file.ico");
|
||||
this.contextMenuImageList.Images.SetKeyName(2, "zoom.ico");
|
||||
this.contextMenuImageList.Images.SetKeyName(3, "help.ico");
|
||||
this.contextMenuImageList.Images.SetKeyName(4, "folder_open.ico");
|
||||
this.contextMenuImageList.Images.SetKeyName(5, "folder_up.ico");
|
||||
this.AutoScaleDimensions = new SizeF(6f, 13f);
|
||||
this.AutoScaleMode = AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.Controls.Add((Control) this.groupBox);
|
||||
this.DoubleBuffered = true;
|
||||
this.Name = nameof (DiscViewExplorer);
|
||||
this.Padding = new Padding(4);
|
||||
this.Size = new Size(640, 480);
|
||||
this.Load += new EventHandler(this.DiscViewExplorer_Load);
|
||||
this.Leave += new EventHandler(this.DiscViewExplorer_Leave);
|
||||
this.groupBox.ResumeLayout(false);
|
||||
this.splitContainer.Panel1.ResumeLayout(false);
|
||||
this.splitContainer.Panel2.ResumeLayout(false);
|
||||
this.splitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
public sealed class ActionsForEditMenuItem
|
||||
{
|
||||
public bool AnyAvailable { get; private set; }
|
||||
|
||||
public bool SelectionMenuAvailable { get; private set; }
|
||||
|
||||
public ToolStripItem[] DiscMenuItems { get; private set; }
|
||||
|
||||
public ToolStripItem[] SelectionMenuItems { get; private set; }
|
||||
|
||||
internal ActionsForEditMenuItem(
|
||||
ToolStripItem[] DiscMenuItems,
|
||||
ToolStripItem[] SelectionMenuItems)
|
||||
{
|
||||
this.DiscMenuItems = DiscMenuItems;
|
||||
this.SelectionMenuItems = SelectionMenuItems;
|
||||
this.SelectionMenuAvailable = SelectionMenuItems != null && SelectionMenuItems.Length > 0;
|
||||
this.AnyAvailable = this.SelectionMenuAvailable || DiscMenuItems != null && DiscMenuItems.Length > 0;
|
||||
}
|
||||
|
||||
internal static DiscViewExplorer.ActionsForEditMenuItem NoEditActions() => new DiscViewExplorer.ActionsForEditMenuItem((ToolStripItem[]) null, (ToolStripItem[]) null);
|
||||
}
|
||||
}
|
||||
}
|
129
Explorer/UserControls/DiscViewExplorer.resx
Normal file
129
Explorer/UserControls/DiscViewExplorer.resx
Normal file
File diff suppressed because one or more lines are too long
305
Explorer/UserControls/DiscViewOpener.cs
Normal file
305
Explorer/UserControls/DiscViewOpener.cs
Normal file
|
@ -0,0 +1,305 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.DiscViewOpener
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Events;
|
||||
using GDRomExplorer.Forms;
|
||||
using GDRomExplorer.Properties;
|
||||
using GDRomExplorer.Resources;
|
||||
using ImageReader.DiscFileSystem;
|
||||
using SEGATools.Disc;
|
||||
using SEGATools.DiscFileSystem;
|
||||
using SEGATools.FileFormat;
|
||||
using SEGATools.Security;
|
||||
using SEGATools.UserProcess;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class DiscViewOpener : UserControl
|
||||
{
|
||||
private static readonly Logger.ILog logger = Logger.CreateLog();
|
||||
private FormLoading formLoading;
|
||||
private List<string> fileDialogIncludeFilters = new List<string>();
|
||||
private string SelectedDiscImage;
|
||||
private bool notifyStatusEvents;
|
||||
private IContainer components;
|
||||
private TableLayoutPanel tableLayoutPanel;
|
||||
private Button btOpen;
|
||||
private TextBox tbDiscImageFile;
|
||||
private GroupBox groupBox;
|
||||
private DiscOpener discOpener;
|
||||
private DiscFormatProvider discFormatProvider;
|
||||
private OpenFileDialog openFileDialog;
|
||||
|
||||
public event EventHandler<EventArgs<IDiscFileSystem>> ImageLoaded;
|
||||
|
||||
public event EventHandler ImageNotLoaded;
|
||||
|
||||
[Description("Specifies the text of the group box.")]
|
||||
[Category("Appearance")]
|
||||
[Browsable(true)]
|
||||
public override string Text
|
||||
{
|
||||
get => this.groupBox.Text;
|
||||
set => this.groupBox.Text = value;
|
||||
}
|
||||
|
||||
[Description("Specifies the text of the open button.")]
|
||||
[Category("Appearance")]
|
||||
[Browsable(true)]
|
||||
public string ButtonText
|
||||
{
|
||||
get => this.btOpen.Text;
|
||||
set => this.btOpen.Text = value;
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("Indicates the initial directory for the OpenFileDialog.")]
|
||||
[Category("Behavior")]
|
||||
public string InitialDirectory
|
||||
{
|
||||
get => this.openFileDialog.InitialDirectory;
|
||||
set => this.openFileDialog.InitialDirectory = value;
|
||||
}
|
||||
|
||||
[Description("Indicates whether the control should notify the application status bar control.")]
|
||||
[Category("Behavior")]
|
||||
[Browsable(true)]
|
||||
public bool NotifyStatusEvents
|
||||
{
|
||||
get => this.notifyStatusEvents;
|
||||
set => this.notifyStatusEvents = value;
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("Restrict the list of valid file extensions.")]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
[EditorBrowsable(EditorBrowsableState.Always)]
|
||||
[Browsable(true)]
|
||||
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing")]
|
||||
public List<string> FileDialogFilters
|
||||
{
|
||||
get => this.fileDialogIncludeFilters;
|
||||
set => this.fileDialogIncludeFilters = value;
|
||||
}
|
||||
|
||||
public DiscViewOpener()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.btOpen.Text = Strings.DiscViewOpenerButtonOpen;
|
||||
this.groupBox.Text = Strings.DiscViewOpenerLabel + (object) ':';
|
||||
this.openFileDialog.Title = Strings.DiscViewOpenerFileDialogTitle;
|
||||
this.discOpener = new DiscOpener();
|
||||
}
|
||||
|
||||
public void SetLoadedDiscImage(IDiscFileSystem discFileSystem)
|
||||
{
|
||||
string message = string.Format(Strings.StatusLabelImageLoaded, (object) discFileSystem.FileName);
|
||||
DiscViewOpener.logger.InfoFormat("Image successfully opened: {0}", (object) discFileSystem.FileName);
|
||||
this.tbDiscImageFile.Text = discFileSystem.FileName;
|
||||
this.tbDiscImageFile.BackColor = SystemColors.Window;
|
||||
if (this.ImageLoaded != null)
|
||||
this.ImageLoaded((object) this, new EventArgs<IDiscFileSystem>(discFileSystem));
|
||||
this.NotifyNewAppStatus(message);
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
this.openFileDialog.Filter = this.discFormatProvider.GetFileDialogFilters(this.FileDialogFilters != null ? this.FileDialogFilters.ToArray() : (string[]) null);
|
||||
if (this.openFileDialog.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
this.Open(this.openFileDialog.FileName);
|
||||
}
|
||||
|
||||
public void Open(string FileName)
|
||||
{
|
||||
if (!File.Exists(FileName))
|
||||
{
|
||||
DiscViewOpener.logger.ErrorFormat("File not found {0}", (object) FileName);
|
||||
string str = string.Format(Strings.MsgBoxImageOpenerFileNotFoundErrorWithFormat, (object) Path.GetFullPath(FileName));
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, str, Strings.MsgBoxImageOpenerTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
this.NotifyNewAppStatus(str);
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
string extension = Path.GetExtension(FileName);
|
||||
if (!this.discFormatProvider.IsFileExtensionSupported(extension))
|
||||
{
|
||||
DiscViewOpener.logger.ErrorFormat("Not supported file extension for file {0}", (object) FileName);
|
||||
string str = string.Format(Strings.MsgBoxImageOpenerBadFileExtensionErrorWithFormat, (object) Path.GetExtension(FileName));
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, str, Strings.MsgBoxImageOpenerTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
this.NotifyNewAppStatus(str);
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SelectedDiscImage = FileName;
|
||||
IImageFileFormat forFileExtension = this.discFormatProvider.FindImageFileFormatForFileExtension(extension);
|
||||
this.openFileDialog.InitialDirectory = Path.GetDirectoryName(this.SelectedDiscImage);
|
||||
this.openFileDialog.FileName = Path.GetFileName(this.SelectedDiscImage);
|
||||
if (this.openFileDialog.FilterIndex > 1)
|
||||
this.openFileDialog.FilterIndex = this.discFormatProvider.GetFileFormatIndex(forFileExtension);
|
||||
this.formLoading = new FormLoading(Strings.DiscViewOpenerImageLoadingTitle, Strings.DiscViewOpenerImageLoadingMessage);
|
||||
this.discOpener.FileOpenerProgressChanged += new AsyncOperationProgressChangedEventHandler(this.GDRomFileSystem_GDRomImageOpenProgressChanged);
|
||||
this.discOpener.FileOpenerCompleted += new AsyncOperationCompletedEventHandler(this.GDRomFileSystem_GDRomImageOpenCompleted);
|
||||
this.discOpener.OpenImageAsync(this.SelectedDiscImage, forFileExtension.ImageFileConverter, Settings.Default.ImageReaderComputePathTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
this.tbDiscImageFile.Text = string.Empty;
|
||||
this.tbDiscImageFile.BackColor = SystemColors.Menu;
|
||||
this.SelectedDiscImage = string.Empty;
|
||||
this.discOpener.CloseImage();
|
||||
if (this.ImageNotLoaded == null)
|
||||
return;
|
||||
this.ImageNotLoaded((object) this, new EventArgs());
|
||||
}
|
||||
|
||||
private void btOpen_Click(object sender, EventArgs e) => this.Open();
|
||||
|
||||
private void NotifyNewAppStatus(string message)
|
||||
{
|
||||
if (!this.NotifyStatusEvents)
|
||||
return;
|
||||
AppStatus.NotifyNewAppStatus(message);
|
||||
}
|
||||
|
||||
private string GetErrorMessage(Exception e)
|
||||
{
|
||||
switch (e)
|
||||
{
|
||||
case DiscFileSystemException _:
|
||||
return string.Format(Strings.StatusLabelImageError, (object) Strings.DiscViewOpenerNoFileSystemError);
|
||||
case InitialProgramException _:
|
||||
return string.Format(Strings.StatusLabelImageError, (object) string.Format(Strings.DiscViewOpenerInvalidInitialProgram, (object) e.Message));
|
||||
case DiscFormatException _:
|
||||
return string.Format(Strings.StatusLabelImageError, (object) e.Message);
|
||||
default:
|
||||
return string.Format(Strings.StatusLabelImageError, (object) Strings.DiscViewOpenerUnknownError);
|
||||
}
|
||||
}
|
||||
|
||||
private void GDRomFileSystem_GDRomImageOpenCompleted(
|
||||
object sender,
|
||||
UserProcessCompletedEventArgs e)
|
||||
{
|
||||
this.formLoading.Close();
|
||||
this.formLoading = (FormLoading) null;
|
||||
this.discOpener.FileOpenerProgressChanged -= new AsyncOperationProgressChangedEventHandler(this.GDRomFileSystem_GDRomImageOpenProgressChanged);
|
||||
this.discOpener.FileOpenerCompleted -= new AsyncOperationCompletedEventHandler(this.GDRomFileSystem_GDRomImageOpenCompleted);
|
||||
if (e.Error != null)
|
||||
{
|
||||
string errorMessage = this.GetErrorMessage(e.Error);
|
||||
DiscViewOpener.logger.ErrorFormat("Unable to open image {0}: {1}", (object) e.ResourceName, (object) e.Error);
|
||||
int num = (int) MessageBox.Show((IWin32Window) this, errorMessage, Strings.MsgBoxImageOpenerTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
this.NotifyNewAppStatus(errorMessage);
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
this.SetLoadedDiscImage(this.discOpener.DiscFileSystem);
|
||||
}
|
||||
|
||||
private void GDRomFileSystem_GDRomImageOpenProgressChanged(UserProcessProgressChangedEventArgs e)
|
||||
{
|
||||
if (this.formLoading.Visible)
|
||||
return;
|
||||
int num = (int) this.formLoading.ShowDialog((IWin32Window) this);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = (IContainer) new Container();
|
||||
this.tableLayoutPanel = new TableLayoutPanel();
|
||||
this.tbDiscImageFile = new TextBox();
|
||||
this.btOpen = new Button();
|
||||
this.groupBox = new GroupBox();
|
||||
this.openFileDialog = new OpenFileDialog();
|
||||
this.discOpener = new DiscOpener(this.components);
|
||||
this.discFormatProvider = new DiscFormatProvider(this.components);
|
||||
this.tableLayoutPanel.SuspendLayout();
|
||||
this.groupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
this.tableLayoutPanel.AutoSize = true;
|
||||
this.tableLayoutPanel.ColumnCount = 2;
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle());
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20f));
|
||||
this.tableLayoutPanel.Controls.Add((Control) this.tbDiscImageFile, 0, 0);
|
||||
this.tableLayoutPanel.Controls.Add((Control) this.btOpen, 1, 0);
|
||||
this.tableLayoutPanel.Dock = DockStyle.Fill;
|
||||
this.tableLayoutPanel.Location = new Point(3, 16);
|
||||
this.tableLayoutPanel.Margin = new Padding(0);
|
||||
this.tableLayoutPanel.Name = "tableLayoutPanel";
|
||||
this.tableLayoutPanel.RowCount = 1;
|
||||
this.tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
|
||||
this.tableLayoutPanel.Size = new Size(762, 31);
|
||||
this.tableLayoutPanel.TabIndex = 0;
|
||||
this.tbDiscImageFile.BackColor = Color.White;
|
||||
this.tbDiscImageFile.Dock = DockStyle.Fill;
|
||||
this.tbDiscImageFile.HideSelection = false;
|
||||
this.tbDiscImageFile.Location = new Point(3, 3);
|
||||
this.tbDiscImageFile.Name = "tbDiscImageFile";
|
||||
this.tbDiscImageFile.ReadOnly = true;
|
||||
this.tbDiscImageFile.Size = new Size(670, 20);
|
||||
this.tbDiscImageFile.TabIndex = 1;
|
||||
this.tbDiscImageFile.TabStop = false;
|
||||
this.tbDiscImageFile.WordWrap = false;
|
||||
this.btOpen.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
this.btOpen.AutoSize = true;
|
||||
this.btOpen.FlatStyle = FlatStyle.Popup;
|
||||
this.btOpen.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
|
||||
this.btOpen.ForeColor = Color.FromArgb(248, 48, 0);
|
||||
this.btOpen.Location = new Point(679, 1);
|
||||
this.btOpen.Margin = new Padding(3, 1, 3, 3);
|
||||
this.btOpen.Name = "btOpen";
|
||||
this.btOpen.Size = new Size(80, 24);
|
||||
this.btOpen.TabIndex = 2;
|
||||
this.btOpen.Text = "&Open";
|
||||
this.btOpen.UseVisualStyleBackColor = false;
|
||||
this.btOpen.Click += new EventHandler(this.btOpen_Click);
|
||||
this.groupBox.BackColor = SystemColors.Window;
|
||||
this.groupBox.Controls.Add((Control) this.tableLayoutPanel);
|
||||
this.groupBox.Dock = DockStyle.Fill;
|
||||
this.groupBox.Location = new Point(4, 4);
|
||||
this.groupBox.Margin = new Padding(0);
|
||||
this.groupBox.MaximumSize = new Size(0, 50);
|
||||
this.groupBox.MinimumSize = new Size(0, 50);
|
||||
this.groupBox.Name = "groupBox";
|
||||
this.groupBox.Size = new Size(768, 50);
|
||||
this.groupBox.TabIndex = 0;
|
||||
this.groupBox.TabStop = false;
|
||||
this.groupBox.Text = "disc image";
|
||||
this.AutoScaleDimensions = new SizeF(6f, 13f);
|
||||
this.AutoScaleMode = AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.Controls.Add((Control) this.groupBox);
|
||||
this.Name = nameof (DiscViewOpener);
|
||||
this.Padding = new Padding(4);
|
||||
this.Size = new Size(776, 55);
|
||||
this.tableLayoutPanel.ResumeLayout(false);
|
||||
this.tableLayoutPanel.PerformLayout();
|
||||
this.groupBox.ResumeLayout(false);
|
||||
this.groupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
}
|
||||
}
|
120
Explorer/UserControls/DiscViewOpener.resx
Normal file
120
Explorer/UserControls/DiscViewOpener.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
203
Explorer/UserControls/GDDAConverterTool.cs
Normal file
203
Explorer/UserControls/GDDAConverterTool.cs
Normal file
|
@ -0,0 +1,203 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.GDDAConverterTool
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Forms;
|
||||
using SEGATools.Audio;
|
||||
using SEGATools.DiscFileSystem;
|
||||
using SEGATools.VirtualFile;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class GDDAConverterTool : Component
|
||||
{
|
||||
private static readonly Logger.ILog logger = Logger.CreateLog();
|
||||
public string InitialDirectory;
|
||||
private IWin32Window owner;
|
||||
private Raw2WavConverter raw2wavConverter;
|
||||
private IContainer components;
|
||||
private OpenFileDialog openFileDialog;
|
||||
private SaveFileDialog saveFileDialog;
|
||||
private FolderBrowserDialog folderBrowserDialog;
|
||||
|
||||
public GDDAConverterTool()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.InitializeDialogs();
|
||||
this.raw2wavConverter = new Raw2WavConverter();
|
||||
}
|
||||
|
||||
public GDDAConverterTool(IContainer container)
|
||||
{
|
||||
container.Add((IComponent) this);
|
||||
this.InitializeComponent();
|
||||
this.InitializeDialogs();
|
||||
this.raw2wavConverter = new Raw2WavConverter(container);
|
||||
}
|
||||
|
||||
public void OpenAndConvertGDDAFiles(
|
||||
IWin32Window owner,
|
||||
AudioConversionSettings AudioConversionSettings)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.UpdateInitialDirectory(this.InitialDirectory);
|
||||
IList<IVirtualFile> inputFiles;
|
||||
string outputLocation;
|
||||
if (this.AskUserForInputFiles(out inputFiles) != DialogResult.OK || this.AskUserForSaveLocation(inputFiles, out outputLocation) != DialogResult.OK)
|
||||
return;
|
||||
this.StartAudioConversion(inputFiles, outputLocation, AudioConversionSettings);
|
||||
}
|
||||
|
||||
public void ConvertGDDATracks(
|
||||
IDiscTrack AudioTrack,
|
||||
AudioConversionSettings AudioConversionSettings)
|
||||
{
|
||||
this.ConvertGDDATracks((IList<IDiscTrack>) new List<IDiscTrack>()
|
||||
{
|
||||
AudioTrack
|
||||
}, AudioConversionSettings);
|
||||
}
|
||||
|
||||
public void ConvertGDDATracks(
|
||||
IList<IDiscTrack> AudioTracks,
|
||||
AudioConversionSettings AudioConversionSettings)
|
||||
{
|
||||
this.CheckTrackListIsValid(AudioTracks);
|
||||
this.UpdateInitialDirectory(this.InitialDirectory);
|
||||
if (AudioTracks.Count == 0)
|
||||
{
|
||||
this.ShowNoTrackWarning();
|
||||
}
|
||||
else
|
||||
{
|
||||
IList<IVirtualFile> list = (IList<IVirtualFile>) AudioTracks.Select<IDiscTrack, IVirtualFile>((Func<IDiscTrack, IVirtualFile>) (track => (IVirtualFile) track)).ToList<IVirtualFile>();
|
||||
string outputLocation;
|
||||
if (this.AskUserForSaveLocation(list, out outputLocation) != DialogResult.OK)
|
||||
return;
|
||||
this.StartAudioConversion(list, outputLocation, AudioConversionSettings);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartAudioConversion(
|
||||
IList<IVirtualFile> files,
|
||||
string outputPath,
|
||||
AudioConversionSettings AudioConversionSettings)
|
||||
{
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
this.raw2wavConverter.AudioConversionSettings = AudioConversionSettings;
|
||||
FormProcess.createForRawToWavConverter(this.raw2wavConverter, TaskId);
|
||||
this.raw2wavConverter.ConvertAsync(files, outputPath, (object) TaskId);
|
||||
}
|
||||
|
||||
private void InitializeDialogs()
|
||||
{
|
||||
this.openFileDialog.Title = GDRomExplorer.Resources.Strings.OfdConvertGddaTitle;
|
||||
this.openFileDialog.Filter = GDRomExplorer.Resources.Strings.OfdConvertGddaFilter;
|
||||
this.saveFileDialog.Title = GDRomExplorer.Resources.Strings.SfdCddaTitle;
|
||||
this.saveFileDialog.Filter = GDRomExplorer.Resources.Strings.SfdCddaFilter;
|
||||
this.folderBrowserDialog.Description = GDRomExplorer.Resources.Strings.FbdConvertGddaTitle;
|
||||
this.folderBrowserDialog.RootFolder = Environment.SpecialFolder.Desktop;
|
||||
}
|
||||
|
||||
private void UpdateInitialDirectory(string newInitialDirectory)
|
||||
{
|
||||
this.openFileDialog.InitialDirectory = newInitialDirectory;
|
||||
this.saveFileDialog.InitialDirectory = newInitialDirectory;
|
||||
this.folderBrowserDialog.SelectedPath = newInitialDirectory;
|
||||
}
|
||||
|
||||
private DialogResult AskUserForInputFiles(out IList<IVirtualFile> inputFiles)
|
||||
{
|
||||
inputFiles = (IList<IVirtualFile>) null;
|
||||
if (this.openFileDialog.ShowDialog(this.owner) != DialogResult.OK)
|
||||
return DialogResult.Cancel;
|
||||
inputFiles = (IList<IVirtualFile>) ((IEnumerable<string>) this.openFileDialog.FileNames).Select<string, IVirtualFile>((Func<string, IVirtualFile>) (inputFilename => (IVirtualFile) VirtualFileFactory.createVirtualFile(inputFilename))).ToList<IVirtualFile>();
|
||||
this.openFileDialog.InitialDirectory = Path.GetDirectoryName(this.openFileDialog.FileName);
|
||||
this.openFileDialog.FileName = Path.GetFileName(this.openFileDialog.FileName);
|
||||
return DialogResult.OK;
|
||||
}
|
||||
|
||||
private DialogResult AskUserForSaveLocation(
|
||||
IList<IVirtualFile> AudioTracks,
|
||||
out string outputLocation)
|
||||
{
|
||||
outputLocation = (string) null;
|
||||
if (AudioTracks.Count == 1)
|
||||
{
|
||||
if (this.AskUserForSaveFileLocation(AudioTracks[0], out outputLocation) != DialogResult.OK)
|
||||
return DialogResult.Cancel;
|
||||
}
|
||||
else if (this.AskUserForSaveDirectoryLocation(out outputLocation) != DialogResult.OK)
|
||||
return DialogResult.Cancel;
|
||||
return DialogResult.OK;
|
||||
}
|
||||
|
||||
private DialogResult AskUserForSaveFileLocation(
|
||||
IVirtualFile suggestedFileName,
|
||||
out string outputPath)
|
||||
{
|
||||
outputPath = (string) null;
|
||||
this.saveFileDialog.FileName = Path.GetFileNameWithoutExtension(suggestedFileName.VirtualName);
|
||||
if (this.saveFileDialog.ShowDialog(this.owner) != DialogResult.OK)
|
||||
return DialogResult.Cancel;
|
||||
outputPath = this.saveFileDialog.FileName;
|
||||
this.UpdateInitialDirectory(Path.GetDirectoryName(outputPath));
|
||||
this.saveFileDialog.FileName = Path.GetFileName(outputPath);
|
||||
return DialogResult.OK;
|
||||
}
|
||||
|
||||
private DialogResult AskUserForSaveDirectoryLocation(out string outputDirectory)
|
||||
{
|
||||
outputDirectory = (string) null;
|
||||
if (this.folderBrowserDialog.ShowDialog(this.owner) != DialogResult.OK)
|
||||
return DialogResult.Cancel;
|
||||
outputDirectory = this.folderBrowserDialog.SelectedPath;
|
||||
this.UpdateInitialDirectory(outputDirectory);
|
||||
return DialogResult.OK;
|
||||
}
|
||||
|
||||
private void CheckTrackListIsValid(IList<IDiscTrack> tracks)
|
||||
{
|
||||
if (tracks == null)
|
||||
throw new ArgumentNullException();
|
||||
foreach (IDiscTrack track in (IEnumerable<IDiscTrack>) tracks)
|
||||
{
|
||||
if (track.TrackData != TrackModeType.Audio)
|
||||
{
|
||||
GDDAConverterTool.logger.ErrorFormat("The track {0} is not an audio track!", (object) track);
|
||||
throw new ArgumentException("must be an audio track");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowNoTrackWarning()
|
||||
{
|
||||
GDDAConverterTool.logger.Warn((object) "No audio track to convert!");
|
||||
int num = (int) MessageBox.Show(this.owner, GDRomExplorer.Resources.Strings.MsgBoxAudioConverterNoTrackWarning, GDRomExplorer.Resources.Strings.MsgBoxAudioConverterTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
AppStatus.NotifyNewAppStatus(GDRomExplorer.Resources.Strings.MsgBoxAudioConverterNoTrackWarning);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.openFileDialog = new OpenFileDialog();
|
||||
this.saveFileDialog = new SaveFileDialog();
|
||||
this.folderBrowserDialog = new FolderBrowserDialog();
|
||||
this.openFileDialog.Multiselect = true;
|
||||
}
|
||||
}
|
||||
}
|
120
Explorer/UserControls/GDDAConverterTool.resx
Normal file
120
Explorer/UserControls/GDDAConverterTool.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
210
Explorer/UserControls/GDEmuExportSettings.cs
Normal file
210
Explorer/UserControls/GDEmuExportSettings.cs
Normal file
|
@ -0,0 +1,210 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.GDEmuExportSettings
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Events;
|
||||
using SEGATools.DiscFileSystem;
|
||||
using SEGATools.GDEmu;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class GDEmuExportSettings : UserControl
|
||||
{
|
||||
private IContainer components;
|
||||
private FolderBrowserDialog folderBrowserDialog;
|
||||
private GroupBox gbOutputDiscImage;
|
||||
private TextBox tbAppOutputFolder;
|
||||
private Button btSelectOutputFolder;
|
||||
private DiscViewOpener discViewOpener;
|
||||
private GroupBox gbExportOptions;
|
||||
private FlowLayoutPanel flpExportOptions;
|
||||
private CheckBox cbRegionFree;
|
||||
private CheckBox cbForceVGA;
|
||||
|
||||
public string InitialDirectory
|
||||
{
|
||||
get => this.folderBrowserDialog.SelectedPath;
|
||||
set
|
||||
{
|
||||
this.folderBrowserDialog.SelectedPath = value;
|
||||
this.discViewOpener.InitialDirectory = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IDiscFileSystem InputDiscImage { get; private set; }
|
||||
|
||||
public GDEmuExportOptions ExportOptions { get; private set; }
|
||||
|
||||
private static GDEmuExportOptions GetDefaultOptions() => new GDEmuExportOptions()
|
||||
{
|
||||
ForceVGA = true,
|
||||
RegionFree = true
|
||||
};
|
||||
|
||||
public GDEmuExportSettings()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.ExportOptions = GDEmuExportSettings.GetDefaultOptions();
|
||||
this.cbRegionFree.Checked = this.ExportOptions.RegionFree;
|
||||
this.cbForceVGA.Checked = this.ExportOptions.ForceVGA;
|
||||
this.InitializeUI();
|
||||
}
|
||||
|
||||
public void SetLoadedDiscImage(IDiscFileSystem discFileSystem)
|
||||
{
|
||||
this.InputDiscImage = discFileSystem;
|
||||
this.discViewOpener.SetLoadedDiscImage(discFileSystem);
|
||||
this.InitialDirectory = Path.GetDirectoryName(discFileSystem.FileName);
|
||||
}
|
||||
|
||||
private void InitializeUI()
|
||||
{
|
||||
this.discViewOpener.ImageLoaded += new EventHandler<EventArgs<IDiscFileSystem>>(this.discViewOpener_ImageLoaded);
|
||||
this.discViewOpener.ImageNotLoaded += new EventHandler(this.discViewOpener_ImageNotLoaded);
|
||||
this.cbRegionFree.CheckedChanged += new EventHandler(this.cbRegionFree_CheckedChanged);
|
||||
this.cbForceVGA.CheckedChanged += new EventHandler(this.cbForceVGA_CheckedChanged);
|
||||
}
|
||||
|
||||
private void discViewOpener_ImageNotLoaded(object sender, EventArgs e) => this.InputDiscImage = (IDiscFileSystem) null;
|
||||
|
||||
private void discViewOpener_ImageLoaded(object sender, EventArgs<IDiscFileSystem> e)
|
||||
{
|
||||
this.InputDiscImage = e.Value;
|
||||
this.InitialDirectory = Path.GetDirectoryName(this.InputDiscImage.FileName);
|
||||
}
|
||||
|
||||
private void btSelectOutputFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.folderBrowserDialog.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
this.tbAppOutputFolder.Text = Path.Combine(this.folderBrowserDialog.SelectedPath, this.ExportOptions.GDIFileName);
|
||||
this.ExportOptions.OutputPath = this.folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void cbForceVGA_CheckedChanged(object sender, EventArgs e) => this.ExportOptions.ForceVGA = this.cbForceVGA.Checked;
|
||||
|
||||
private void cbRegionFree_CheckedChanged(object sender, EventArgs e) => this.ExportOptions.RegionFree = this.cbRegionFree.Checked;
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (GDEmuExportSettings));
|
||||
this.folderBrowserDialog = new FolderBrowserDialog();
|
||||
this.gbOutputDiscImage = new GroupBox();
|
||||
this.btSelectOutputFolder = new Button();
|
||||
this.tbAppOutputFolder = new TextBox();
|
||||
this.gbExportOptions = new GroupBox();
|
||||
this.flpExportOptions = new FlowLayoutPanel();
|
||||
this.cbRegionFree = new CheckBox();
|
||||
this.cbForceVGA = new CheckBox();
|
||||
this.discViewOpener = new DiscViewOpener();
|
||||
this.gbOutputDiscImage.SuspendLayout();
|
||||
this.gbExportOptions.SuspendLayout();
|
||||
this.flpExportOptions.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
this.gbOutputDiscImage.BackColor = SystemColors.Window;
|
||||
this.gbOutputDiscImage.Controls.Add((Control) this.btSelectOutputFolder);
|
||||
this.gbOutputDiscImage.Controls.Add((Control) this.tbAppOutputFolder);
|
||||
this.gbOutputDiscImage.Location = new Point(3, 60);
|
||||
this.gbOutputDiscImage.Name = "gbOutputDiscImage";
|
||||
this.gbOutputDiscImage.Padding = new Padding(0);
|
||||
this.gbOutputDiscImage.Size = new Size(473, 46);
|
||||
this.gbOutputDiscImage.TabIndex = 1;
|
||||
this.gbOutputDiscImage.TabStop = false;
|
||||
this.gbOutputDiscImage.Text = " Output Disc Image:";
|
||||
this.btSelectOutputFolder.CausesValidation = false;
|
||||
this.btSelectOutputFolder.FlatStyle = FlatStyle.Popup;
|
||||
this.btSelectOutputFolder.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
|
||||
this.btSelectOutputFolder.ForeColor = Color.FromArgb(248, 48, 0);
|
||||
this.btSelectOutputFolder.Location = new Point(388, 14);
|
||||
this.btSelectOutputFolder.Name = "btSelectOutputFolder";
|
||||
this.btSelectOutputFolder.Size = new Size(79, 24);
|
||||
this.btSelectOutputFolder.TabIndex = 2;
|
||||
this.btSelectOutputFolder.Text = "...";
|
||||
this.btSelectOutputFolder.UseVisualStyleBackColor = false;
|
||||
this.btSelectOutputFolder.Click += new EventHandler(this.btSelectOutputFolder_Click);
|
||||
this.tbAppOutputFolder.BackColor = SystemColors.Window;
|
||||
this.tbAppOutputFolder.Location = new Point(6, 17);
|
||||
this.tbAppOutputFolder.Name = "tbAppOutputFolder";
|
||||
this.tbAppOutputFolder.ReadOnly = true;
|
||||
this.tbAppOutputFolder.Size = new Size(376, 20);
|
||||
this.tbAppOutputFolder.TabIndex = 3;
|
||||
this.tbAppOutputFolder.TabStop = false;
|
||||
this.gbExportOptions.BackColor = SystemColors.Window;
|
||||
this.gbExportOptions.Controls.Add((Control) this.flpExportOptions);
|
||||
this.gbExportOptions.Location = new Point(4, 112);
|
||||
this.gbExportOptions.Name = "gbExportOptions";
|
||||
this.gbExportOptions.Padding = new Padding(3, 0, 3, 3);
|
||||
this.gbExportOptions.Size = new Size(473, 42);
|
||||
this.gbExportOptions.TabIndex = 4;
|
||||
this.gbExportOptions.TabStop = false;
|
||||
this.gbExportOptions.Text = "Export Options:";
|
||||
this.flpExportOptions.AutoSize = true;
|
||||
this.flpExportOptions.Controls.Add((Control) this.cbRegionFree);
|
||||
this.flpExportOptions.Controls.Add((Control) this.cbForceVGA);
|
||||
this.flpExportOptions.Dock = DockStyle.Fill;
|
||||
this.flpExportOptions.Location = new Point(3, 13);
|
||||
this.flpExportOptions.Name = "flpExportOptions";
|
||||
this.flpExportOptions.Padding = new Padding(3);
|
||||
this.flpExportOptions.Size = new Size(467, 26);
|
||||
this.flpExportOptions.TabIndex = 0;
|
||||
this.cbRegionFree.AutoSize = true;
|
||||
this.cbRegionFree.Location = new Point(6, 6);
|
||||
this.cbRegionFree.Name = "cbRegionFree";
|
||||
this.cbRegionFree.Size = new Size(84, 17);
|
||||
this.cbRegionFree.TabIndex = 0;
|
||||
this.cbRegionFree.Text = "Region Free";
|
||||
this.cbRegionFree.UseVisualStyleBackColor = true;
|
||||
this.cbForceVGA.AutoSize = true;
|
||||
this.cbForceVGA.Location = new Point(96, 6);
|
||||
this.cbForceVGA.Name = "cbForceVGA";
|
||||
this.cbForceVGA.Size = new Size(78, 17);
|
||||
this.cbForceVGA.TabIndex = 1;
|
||||
this.cbForceVGA.Text = "Force VGA";
|
||||
this.cbForceVGA.UseVisualStyleBackColor = true;
|
||||
this.discViewOpener.AutoSize = true;
|
||||
this.discViewOpener.BackColor = SystemColors.Window;
|
||||
this.discViewOpener.ButtonText = "&Open";
|
||||
this.discViewOpener.FileDialogFilters = (List<string>) componentResourceManager.GetObject("discViewOpener.FileDialogFilters");
|
||||
this.discViewOpener.InitialDirectory = "";
|
||||
this.discViewOpener.Location = new Point(0, 0);
|
||||
this.discViewOpener.Margin = new Padding(0);
|
||||
this.discViewOpener.Name = "discViewOpener";
|
||||
this.discViewOpener.NotifyStatusEvents = false;
|
||||
this.discViewOpener.Padding = new Padding(3);
|
||||
this.discViewOpener.Size = new Size(479, 57);
|
||||
this.discViewOpener.TabIndex = 0;
|
||||
this.AutoScaleDimensions = new SizeF(6f, 13f);
|
||||
this.AutoScaleMode = AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.BackColor = SystemColors.Window;
|
||||
this.Controls.Add((Control) this.gbExportOptions);
|
||||
this.Controls.Add((Control) this.gbOutputDiscImage);
|
||||
this.Controls.Add((Control) this.discViewOpener);
|
||||
this.Name = nameof (GDEmuExportSettings);
|
||||
this.Size = new Size(480, 157);
|
||||
this.gbOutputDiscImage.ResumeLayout(false);
|
||||
this.gbOutputDiscImage.PerformLayout();
|
||||
this.gbExportOptions.ResumeLayout(false);
|
||||
this.gbExportOptions.PerformLayout();
|
||||
this.flpExportOptions.ResumeLayout(false);
|
||||
this.flpExportOptions.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
}
|
||||
}
|
123
Explorer/UserControls/GDEmuExportSettings.resx
Normal file
123
Explorer/UserControls/GDEmuExportSettings.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="discViewOpener.FileDialogFilters" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>AAEAAAD/////AQAAAAAAAAAEAQAAAH9TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24GAAAICAkCAAAAAQAAAAIAAAARAgAAAAQAAAAGAwAAAAQuZ2RpDQML</value>
|
||||
</data>
|
||||
</root>
|
115
Explorer/UserControls/InitialProgramOpener.cs
Normal file
115
Explorer/UserControls/InitialProgramOpener.cs
Normal file
|
@ -0,0 +1,115 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.InitialProgramOpener
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Forms;
|
||||
using GDRomExplorer.Resources;
|
||||
using SEGATools.Binary;
|
||||
using SEGATools.Scanner;
|
||||
using SEGATools.Security;
|
||||
using SEGATools.VirtualFile;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class InitialProgramOpener : Component
|
||||
{
|
||||
private static readonly Logger.ILog logger = Logger.CreateLog();
|
||||
private IWin32Window owner;
|
||||
private FormLoading formLoading;
|
||||
private IContainer components;
|
||||
private BackgroundWorker backgroundWorker;
|
||||
private OpenFileDialog openFileDialogForInitialProgram;
|
||||
|
||||
public InitialProgramOpener()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
this.openFileDialogForInitialProgram.Title = Strings.OfdInitialProgramTitle;
|
||||
this.openFileDialogForInitialProgram.Filter = Strings.OfdInitialProgramFilter;
|
||||
this.backgroundWorker.DoWork += new DoWorkEventHandler(this.bwOpenInitialProgramFile_DoWork);
|
||||
this.backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.bwOpenInitialProgramFile_RunWorkerCompleted);
|
||||
}
|
||||
|
||||
public void OpenAndViewInitialProgram(IWin32Window owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
if (this.openFileDialogForInitialProgram.ShowDialog(owner) != DialogResult.OK)
|
||||
return;
|
||||
this.backgroundWorker.RunWorkerAsync((object) VirtualFileFactory.createVirtualFile(this.openFileDialogForInitialProgram.FileName));
|
||||
using (this.formLoading = new FormLoading(Strings.InitialProgramLoadingTitle, Strings.InitialProgramLoadingMessage))
|
||||
{
|
||||
int num = (int) this.formLoading.ShowDialog(owner);
|
||||
}
|
||||
}
|
||||
|
||||
private void bwOpenInitialProgramFile_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
IVirtualFile virtualFile1 = (IVirtualFile) e.Argument;
|
||||
InitialProgram initialProgram;
|
||||
using (Stream fileInputStream = virtualFile1.FileInputStream)
|
||||
{
|
||||
byte[] buffer = new byte[InitialProgramConverter.INITIAL_PROGRAM_SIZE];
|
||||
fileInputStream.Read(buffer, 0, buffer.Length);
|
||||
initialProgram = InitialProgramConverter.ToInitialProgram(buffer, 0);
|
||||
}
|
||||
List<SEGALibrary> libraries;
|
||||
using (FileScanner fileScanner = new FileScanner())
|
||||
{
|
||||
IVirtualFile virtualFile2 = (IVirtualFile) VirtualFileFactory.createVirtualFile(initialProgram.Stream, virtualFile1.OriginalFileName);
|
||||
libraries = fileScanner.ScanFile<SEGALibrary>(virtualFile2, FileScannerPattern.aPatternForSEGALibraries(), (IFileScannerResultConverter<SEGALibrary>) new FileScannerResultConverterForSEGALibrary());
|
||||
}
|
||||
e.Result = (object) InitialProgramExtended.create(initialProgram, libraries);
|
||||
}
|
||||
|
||||
private void bwOpenInitialProgramFile_RunWorkerCompleted(
|
||||
object sender,
|
||||
RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
if (!this.formLoading.IsDisposed)
|
||||
this.formLoading.Dispose();
|
||||
if (e.Error != null)
|
||||
{
|
||||
string str = string.Format(Strings.MsgBoxInitialProgramOpenerErrorWithFormat, (object) e.Error.Message);
|
||||
InitialProgramOpener.logger.ErrorFormat("Unable to open ip: {0}", (object) e.Error);
|
||||
int num = (int) MessageBox.Show(this.owner, str, Strings.MsgBoxInitialProgramOpenerTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
AppStatus.NotifyNewAppStatus(str);
|
||||
}
|
||||
else
|
||||
{
|
||||
string fileName = this.openFileDialogForInitialProgram.FileName;
|
||||
this.openFileDialogForInitialProgram.FileName = Path.GetFileName(fileName);
|
||||
string message = string.Format(Strings.MsgBoxInitialProgramOpenerSuccessWithFormat, (object) fileName);
|
||||
InitialProgramOpener.logger.InfoFormat("File {0} successfully opened", (object) fileName);
|
||||
AppStatus.NotifyNewAppStatus(message);
|
||||
using (FormInitialProgram formInitialProgram = new FormInitialProgram((InitialProgramExtended) e.Result, Path.GetDirectoryName(fileName)))
|
||||
{
|
||||
int num = (int) formInitialProgram.ShowDialog(this.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.backgroundWorker = new BackgroundWorker();
|
||||
this.openFileDialogForInitialProgram = new OpenFileDialog();
|
||||
this.openFileDialogForInitialProgram.Multiselect = true;
|
||||
}
|
||||
}
|
||||
}
|
120
Explorer/UserControls/InitialProgramOpener.resx
Normal file
120
Explorer/UserControls/InitialProgramOpener.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
131
Explorer/UserControls/NaomiEncryptDecryptTool.cs
Normal file
131
Explorer/UserControls/NaomiEncryptDecryptTool.cs
Normal file
|
@ -0,0 +1,131 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.NaomiEncryptDecryptTool
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Forms;
|
||||
using GDRomExplorer.Resources;
|
||||
using SEGATools.Encrypt;
|
||||
using SEGATools.VirtualFile;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class NaomiEncryptDecryptTool : Component
|
||||
{
|
||||
private static readonly Logger.ILog logger = Logger.CreateLog();
|
||||
private IWin32Window owner;
|
||||
public string InitialDirectory;
|
||||
private IContainer components;
|
||||
private OpenFileDialog openFileDialog;
|
||||
private SaveFileDialog saveFileDialog;
|
||||
|
||||
public NaomiEncryptDecryptTool() => this.InitializeComponent();
|
||||
|
||||
public NaomiEncryptDecryptTool(IContainer container)
|
||||
{
|
||||
container.Add((IComponent) this);
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public void OpenAndEncryptNaomiBinary(IWin32Window owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.ChangeFileDialogsForEncryption();
|
||||
NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder filesAndKeyHolder = this.OpenDialogsForInputAndOutputFiles(true);
|
||||
if (filesAndKeyHolder == null)
|
||||
return;
|
||||
DesEncryptDecryptTool desDecryptor = new DesEncryptDecryptTool();
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
FormProcess.createForDesEncryptor(desDecryptor, TaskId);
|
||||
desDecryptor.EncryptAsync(filesAndKeyHolder.InputFile, filesAndKeyHolder.OutputFile, filesAndKeyHolder.DESKey, (object) TaskId);
|
||||
}
|
||||
|
||||
public void OpenAndDecryptNaomiBinary(IWin32Window owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.ChangeFileDialogsForDecryption();
|
||||
NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder filesAndKeyHolder = this.OpenDialogsForInputAndOutputFiles(false);
|
||||
if (filesAndKeyHolder == null)
|
||||
return;
|
||||
DesEncryptDecryptTool desDecryptor = new DesEncryptDecryptTool();
|
||||
Guid TaskId = Guid.NewGuid();
|
||||
FormProcess.createForDesDecryptor(desDecryptor, TaskId);
|
||||
desDecryptor.DecryptAsync(filesAndKeyHolder.InputFile, filesAndKeyHolder.OutputFile, filesAndKeyHolder.DESKey, (object) TaskId);
|
||||
}
|
||||
|
||||
private NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder OpenDialogsForInputAndOutputFiles(
|
||||
bool isForEncryption)
|
||||
{
|
||||
if (this.openFileDialog.ShowDialog(this.owner) != DialogResult.OK)
|
||||
return (NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder) null;
|
||||
IVirtualFile virtualFile1 = (IVirtualFile) VirtualFileFactory.createVirtualFile(this.openFileDialog.FileName);
|
||||
this.openFileDialog.InitialDirectory = Path.GetDirectoryName(this.openFileDialog.FileName);
|
||||
this.openFileDialog.FileName = Path.GetFileName(this.openFileDialog.FileName);
|
||||
FormGetDESKey formGetDesKey = !isForEncryption ? FormGetDESKey.aGetDESKeyFormWithDecryptLabel() : FormGetDESKey.aGetDESKeyFormWithEncryptLabel();
|
||||
if (formGetDesKey.ShowDialog(this.owner) != DialogResult.OK)
|
||||
{
|
||||
formGetDesKey.Dispose();
|
||||
return (NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder) null;
|
||||
}
|
||||
formGetDesKey.Dispose();
|
||||
DESKey desKey = formGetDesKey.DESKey;
|
||||
this.saveFileDialog.FileName = Path.GetFileNameWithoutExtension(this.openFileDialog.FileName);
|
||||
if (this.saveFileDialog.ShowDialog(this.owner) != DialogResult.OK)
|
||||
return (NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder) null;
|
||||
IVirtualFile virtualFile2 = (IVirtualFile) VirtualFileFactory.createVirtualFile(this.saveFileDialog.FileName);
|
||||
this.saveFileDialog.InitialDirectory = Path.GetDirectoryName(this.saveFileDialog.FileName);
|
||||
this.saveFileDialog.FileName = Path.GetFileName(this.saveFileDialog.FileName);
|
||||
return new NaomiEncryptDecryptTool.InputOutputFilesAndKeyHolder()
|
||||
{
|
||||
InputFile = virtualFile1,
|
||||
OutputFile = virtualFile2,
|
||||
DESKey = desKey
|
||||
};
|
||||
}
|
||||
|
||||
private void ChangeFileDialogsForEncryption()
|
||||
{
|
||||
this.openFileDialog.Title = Strings.NaomiEncryptDecryptToolOfdEncTitle;
|
||||
this.openFileDialog.Filter = Strings.NaomiEncryptDecryptToolOfdEncFilter;
|
||||
this.openFileDialog.InitialDirectory = this.InitialDirectory;
|
||||
this.saveFileDialog.Title = Strings.NaomiEncryptDecryptToolSfdEncTitle;
|
||||
this.saveFileDialog.Filter = Strings.NaomiEncryptDecryptToolSfdEncFilter;
|
||||
this.saveFileDialog.InitialDirectory = this.InitialDirectory;
|
||||
}
|
||||
|
||||
private void ChangeFileDialogsForDecryption()
|
||||
{
|
||||
this.openFileDialog.Title = Strings.NaomiEncryptDecryptToolOfdDecTitle;
|
||||
this.openFileDialog.Filter = Strings.NaomiEncryptDecryptToolOfdDecFilter;
|
||||
this.openFileDialog.InitialDirectory = this.InitialDirectory;
|
||||
this.saveFileDialog.Title = Strings.NaomiEncryptDecryptToolSfdDecTitle;
|
||||
this.saveFileDialog.Filter = Strings.NaomiEncryptDecryptToolSfdDecFilter;
|
||||
this.saveFileDialog.InitialDirectory = this.InitialDirectory;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.openFileDialog = new OpenFileDialog();
|
||||
this.saveFileDialog = new SaveFileDialog();
|
||||
}
|
||||
|
||||
private class InputOutputFilesAndKeyHolder
|
||||
{
|
||||
public IVirtualFile InputFile;
|
||||
public IVirtualFile OutputFile;
|
||||
public DESKey DESKey;
|
||||
}
|
||||
}
|
||||
}
|
120
Explorer/UserControls/NaomiEncryptDecryptTool.resx
Normal file
120
Explorer/UserControls/NaomiEncryptDecryptTool.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
424
Explorer/UserControls/PrimaryVolumeDescriptorViewer.cs
Normal file
424
Explorer/UserControls/PrimaryVolumeDescriptorViewer.cs
Normal file
|
@ -0,0 +1,424 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: GDRomExplorer.UserControls.PrimaryVolumeDescriptorViewer
|
||||
// Assembly: GD-ROM Explorer, Version=1.6.3.0, Culture=neutral, PublicKeyToken=611be24fdeb07e08
|
||||
// MVID: B7A7D10A-9A63-4E9E-9840-D297E5FC2219
|
||||
// Assembly location: GD-ROM Explorer.exe
|
||||
|
||||
using GDRomExplorer.Resources;
|
||||
using ImageReader.ISO9660.VolumeDescriptors;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GDRomExplorer.UserControls
|
||||
{
|
||||
public class PrimaryVolumeDescriptorViewer : UserControl
|
||||
{
|
||||
private IContainer components;
|
||||
private TextBox tbVolumeSpaceSize;
|
||||
private Label lbVolumeSpaceSize;
|
||||
private TextBox tbVolumeNumber;
|
||||
private Label lbVolumeNumber;
|
||||
private TextBox tbVolumeSetId;
|
||||
private Label lbVolumeSetId;
|
||||
private TextBox tbVolumeCreationDate;
|
||||
private Label lbVloumeCreationDate;
|
||||
private TextBox tbVolumeModificationDate;
|
||||
private Label lbVolumeModificationDate;
|
||||
private TextBox tbVolumeExpirationDate;
|
||||
private Label lbVolumeExpirationDate;
|
||||
private TextBox tbVolumeEffectiveDate;
|
||||
private Label lbVolumeEffectiveDate;
|
||||
private TextBox tbSystemId;
|
||||
private TextBox tbVolumeId;
|
||||
private TextBox tbPublisherId;
|
||||
private TextBox tbPreparerId;
|
||||
private TextBox tbApplicationId;
|
||||
private TextBox tbCopyrightFileId;
|
||||
private TextBox tbAbstractFileId;
|
||||
private TextBox tbBibliographicFileId;
|
||||
private Label lbSystemId;
|
||||
private Label lbVolumeId;
|
||||
private Label nbPublisherId;
|
||||
private Label lbPreparerId;
|
||||
private Label lbApplicationId;
|
||||
private Label lbCopyrightFileId;
|
||||
private Label lbAbstractFileId;
|
||||
private Label lbBibliographicFileId;
|
||||
private TextBox tbLogicalBlockSize;
|
||||
private Label lbLogicalBlockSize;
|
||||
|
||||
public PrimaryVolumeDescriptorViewer() => this.InitializeComponent();
|
||||
|
||||
public void LoadPrimaryVolumeDescriptor(PrimaryVolumeDescriptor PrimaryVolumeDescriptor)
|
||||
{
|
||||
if (PrimaryVolumeDescriptor == null)
|
||||
return;
|
||||
this.tbSystemId.Text = PrimaryVolumeDescriptor.SystemIdentifier;
|
||||
this.tbVolumeId.Text = PrimaryVolumeDescriptor.Identifier;
|
||||
this.tbApplicationId.Text = PrimaryVolumeDescriptor.ApplicationIdentifier;
|
||||
this.tbPublisherId.Text = PrimaryVolumeDescriptor.PublisherIdentifier;
|
||||
this.tbPreparerId.Text = PrimaryVolumeDescriptor.PreparerIdentifier;
|
||||
this.tbVolumeSetId.Text = PrimaryVolumeDescriptor.SetIdentifier;
|
||||
this.tbVolumeSpaceSize.Text = string.Format("{0} blocks", (object) PrimaryVolumeDescriptor.SpaceSize);
|
||||
this.tbVolumeNumber.Text = string.Format("{0}/{1}", (object) PrimaryVolumeDescriptor.SequenceNumber, (object) PrimaryVolumeDescriptor.SetSize);
|
||||
this.tbLogicalBlockSize.Text = string.Format("{0} bytes", (object) PrimaryVolumeDescriptor.LogicalBlockSize);
|
||||
this.UpdateDateTimeTextBox(this.tbVolumeCreationDate, PrimaryVolumeDescriptor.CreationDateTime);
|
||||
this.UpdateDateTimeTextBox(this.tbVolumeModificationDate, PrimaryVolumeDescriptor.ModificationDateTime);
|
||||
this.UpdateDateTimeTextBox(this.tbVolumeEffectiveDate, PrimaryVolumeDescriptor.EffectiveDateTime);
|
||||
this.UpdateDateTimeTextBox(this.tbVolumeExpirationDate, PrimaryVolumeDescriptor.ExpirationDateTime);
|
||||
this.tbAbstractFileId.Text = PrimaryVolumeDescriptor.AbstractFileIdentifier;
|
||||
this.tbCopyrightFileId.Text = PrimaryVolumeDescriptor.CopyrightFileIdentifier;
|
||||
this.tbBibliographicFileId.Text = PrimaryVolumeDescriptor.BibliographicFileIdentifier;
|
||||
}
|
||||
|
||||
private void UpdateDateTimeTextBox(TextBox dateTimeTextBox, DateTime? dateTime)
|
||||
{
|
||||
if (dateTime.HasValue)
|
||||
dateTimeTextBox.Text = dateTime.Value.ToString();
|
||||
else
|
||||
dateTimeTextBox.Text = Strings.InvalidDateTimeText;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
this.components.Dispose();
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tbVolumeSpaceSize = new TextBox();
|
||||
this.lbVolumeSpaceSize = new Label();
|
||||
this.tbVolumeNumber = new TextBox();
|
||||
this.lbVolumeNumber = new Label();
|
||||
this.tbVolumeSetId = new TextBox();
|
||||
this.lbVolumeSetId = new Label();
|
||||
this.tbVolumeCreationDate = new TextBox();
|
||||
this.lbVloumeCreationDate = new Label();
|
||||
this.tbVolumeModificationDate = new TextBox();
|
||||
this.lbVolumeModificationDate = new Label();
|
||||
this.tbVolumeExpirationDate = new TextBox();
|
||||
this.lbVolumeExpirationDate = new Label();
|
||||
this.tbVolumeEffectiveDate = new TextBox();
|
||||
this.lbVolumeEffectiveDate = new Label();
|
||||
this.tbSystemId = new TextBox();
|
||||
this.tbVolumeId = new TextBox();
|
||||
this.tbPublisherId = new TextBox();
|
||||
this.tbPreparerId = new TextBox();
|
||||
this.tbApplicationId = new TextBox();
|
||||
this.tbCopyrightFileId = new TextBox();
|
||||
this.tbAbstractFileId = new TextBox();
|
||||
this.tbBibliographicFileId = new TextBox();
|
||||
this.lbSystemId = new Label();
|
||||
this.lbVolumeId = new Label();
|
||||
this.nbPublisherId = new Label();
|
||||
this.lbPreparerId = new Label();
|
||||
this.lbApplicationId = new Label();
|
||||
this.lbCopyrightFileId = new Label();
|
||||
this.lbAbstractFileId = new Label();
|
||||
this.lbBibliographicFileId = new Label();
|
||||
this.tbLogicalBlockSize = new TextBox();
|
||||
this.lbLogicalBlockSize = new Label();
|
||||
this.SuspendLayout();
|
||||
this.tbVolumeSpaceSize.BackColor = SystemColors.Window;
|
||||
this.tbVolumeSpaceSize.Location = new Point(414, 48);
|
||||
this.tbVolumeSpaceSize.Margin = new Padding(2);
|
||||
this.tbVolumeSpaceSize.Name = "tbVolumeSpaceSize";
|
||||
this.tbVolumeSpaceSize.ReadOnly = true;
|
||||
this.tbVolumeSpaceSize.Size = new Size(155, 20);
|
||||
this.tbVolumeSpaceSize.TabIndex = 9;
|
||||
this.tbVolumeSpaceSize.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeSpaceSize.Location = new Point(277, 50);
|
||||
this.lbVolumeSpaceSize.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeSpaceSize.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeSpaceSize.Name = "lbVolumeSpaceSize";
|
||||
this.lbVolumeSpaceSize.Size = new Size(133, 13);
|
||||
this.lbVolumeSpaceSize.TabIndex = 8;
|
||||
this.lbVolumeSpaceSize.Text = "Volume Space Size:";
|
||||
this.lbVolumeSpaceSize.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeNumber.BackColor = SystemColors.Window;
|
||||
this.tbVolumeNumber.Location = new Point(414, 26);
|
||||
this.tbVolumeNumber.Margin = new Padding(2);
|
||||
this.tbVolumeNumber.Name = "tbVolumeNumber";
|
||||
this.tbVolumeNumber.ReadOnly = true;
|
||||
this.tbVolumeNumber.Size = new Size(155, 20);
|
||||
this.tbVolumeNumber.TabIndex = 11;
|
||||
this.tbVolumeNumber.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeNumber.Location = new Point(277, 28);
|
||||
this.lbVolumeNumber.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeNumber.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeNumber.Name = "lbVolumeNumber";
|
||||
this.lbVolumeNumber.Size = new Size(133, 13);
|
||||
this.lbVolumeNumber.TabIndex = 10;
|
||||
this.lbVolumeNumber.Text = "Volume Number:";
|
||||
this.lbVolumeNumber.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeSetId.BackColor = SystemColors.Window;
|
||||
this.tbVolumeSetId.Location = new Point(414, 4);
|
||||
this.tbVolumeSetId.Margin = new Padding(2);
|
||||
this.tbVolumeSetId.Name = "tbVolumeSetId";
|
||||
this.tbVolumeSetId.ReadOnly = true;
|
||||
this.tbVolumeSetId.Size = new Size(155, 20);
|
||||
this.tbVolumeSetId.TabIndex = 23;
|
||||
this.tbVolumeSetId.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeSetId.Location = new Point(277, 6);
|
||||
this.lbVolumeSetId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeSetId.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeSetId.Name = "lbVolumeSetId";
|
||||
this.lbVolumeSetId.Size = new Size(133, 13);
|
||||
this.lbVolumeSetId.TabIndex = 22;
|
||||
this.lbVolumeSetId.Text = "Volume Set ID:";
|
||||
this.lbVolumeSetId.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeCreationDate.BackColor = SystemColors.Window;
|
||||
this.tbVolumeCreationDate.Location = new Point(414, 114);
|
||||
this.tbVolumeCreationDate.Margin = new Padding(2);
|
||||
this.tbVolumeCreationDate.Name = "tbVolumeCreationDate";
|
||||
this.tbVolumeCreationDate.ReadOnly = true;
|
||||
this.tbVolumeCreationDate.Size = new Size(155, 20);
|
||||
this.tbVolumeCreationDate.TabIndex = 37;
|
||||
this.tbVolumeCreationDate.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVloumeCreationDate.Location = new Point(277, 116);
|
||||
this.lbVloumeCreationDate.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVloumeCreationDate.MinimumSize = new Size(130, 13);
|
||||
this.lbVloumeCreationDate.Name = "lbVloumeCreationDate";
|
||||
this.lbVloumeCreationDate.Size = new Size(133, 13);
|
||||
this.lbVloumeCreationDate.TabIndex = 36;
|
||||
this.lbVloumeCreationDate.Text = "Volume Creation Date:";
|
||||
this.lbVloumeCreationDate.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeModificationDate.BackColor = SystemColors.Window;
|
||||
this.tbVolumeModificationDate.Location = new Point(414, 136);
|
||||
this.tbVolumeModificationDate.Margin = new Padding(2);
|
||||
this.tbVolumeModificationDate.Name = "tbVolumeModificationDate";
|
||||
this.tbVolumeModificationDate.ReadOnly = true;
|
||||
this.tbVolumeModificationDate.Size = new Size(155, 20);
|
||||
this.tbVolumeModificationDate.TabIndex = 39;
|
||||
this.tbVolumeModificationDate.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeModificationDate.Location = new Point(277, 138);
|
||||
this.lbVolumeModificationDate.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeModificationDate.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeModificationDate.Name = "lbVolumeModificationDate";
|
||||
this.lbVolumeModificationDate.Size = new Size(133, 13);
|
||||
this.lbVolumeModificationDate.TabIndex = 38;
|
||||
this.lbVolumeModificationDate.Text = "Volume Modification Date:";
|
||||
this.lbVolumeModificationDate.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeExpirationDate.BackColor = SystemColors.Window;
|
||||
this.tbVolumeExpirationDate.Location = new Point(414, 70);
|
||||
this.tbVolumeExpirationDate.Margin = new Padding(2);
|
||||
this.tbVolumeExpirationDate.Name = "tbVolumeExpirationDate";
|
||||
this.tbVolumeExpirationDate.ReadOnly = true;
|
||||
this.tbVolumeExpirationDate.Size = new Size(155, 20);
|
||||
this.tbVolumeExpirationDate.TabIndex = 41;
|
||||
this.tbVolumeExpirationDate.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeExpirationDate.Location = new Point(277, 72);
|
||||
this.lbVolumeExpirationDate.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeExpirationDate.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeExpirationDate.Name = "lbVolumeExpirationDate";
|
||||
this.lbVolumeExpirationDate.Size = new Size(133, 13);
|
||||
this.lbVolumeExpirationDate.TabIndex = 40;
|
||||
this.lbVolumeExpirationDate.Text = "Volume Expiration Date:";
|
||||
this.lbVolumeExpirationDate.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbVolumeEffectiveDate.BackColor = SystemColors.Window;
|
||||
this.tbVolumeEffectiveDate.Location = new Point(414, 92);
|
||||
this.tbVolumeEffectiveDate.Margin = new Padding(2);
|
||||
this.tbVolumeEffectiveDate.Name = "tbVolumeEffectiveDate";
|
||||
this.tbVolumeEffectiveDate.ReadOnly = true;
|
||||
this.tbVolumeEffectiveDate.Size = new Size(155, 20);
|
||||
this.tbVolumeEffectiveDate.TabIndex = 43;
|
||||
this.tbVolumeEffectiveDate.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbVolumeEffectiveDate.Location = new Point(277, 94);
|
||||
this.lbVolumeEffectiveDate.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeEffectiveDate.MinimumSize = new Size(130, 13);
|
||||
this.lbVolumeEffectiveDate.Name = "lbVolumeEffectiveDate";
|
||||
this.lbVolumeEffectiveDate.Size = new Size(133, 13);
|
||||
this.lbVolumeEffectiveDate.TabIndex = 42;
|
||||
this.lbVolumeEffectiveDate.Text = "Volume Effective Date:";
|
||||
this.lbVolumeEffectiveDate.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbSystemId.BackColor = SystemColors.Window;
|
||||
this.tbSystemId.Location = new Point(113, 4);
|
||||
this.tbSystemId.Margin = new Padding(2);
|
||||
this.tbSystemId.Name = "tbSystemId";
|
||||
this.tbSystemId.ReadOnly = true;
|
||||
this.tbSystemId.Size = new Size(155, 20);
|
||||
this.tbSystemId.TabIndex = 5;
|
||||
this.tbSystemId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbVolumeId.BackColor = SystemColors.Window;
|
||||
this.tbVolumeId.Location = new Point(113, 26);
|
||||
this.tbVolumeId.Margin = new Padding(2);
|
||||
this.tbVolumeId.Name = "tbVolumeId";
|
||||
this.tbVolumeId.ReadOnly = true;
|
||||
this.tbVolumeId.Size = new Size(155, 20);
|
||||
this.tbVolumeId.TabIndex = 7;
|
||||
this.tbVolumeId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbPublisherId.BackColor = SystemColors.Window;
|
||||
this.tbPublisherId.Location = new Point(113, 70);
|
||||
this.tbPublisherId.Margin = new Padding(2);
|
||||
this.tbPublisherId.Name = "tbPublisherId";
|
||||
this.tbPublisherId.ReadOnly = true;
|
||||
this.tbPublisherId.Size = new Size(155, 20);
|
||||
this.tbPublisherId.TabIndex = 25;
|
||||
this.tbPublisherId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbPreparerId.BackColor = SystemColors.Window;
|
||||
this.tbPreparerId.Location = new Point(113, 92);
|
||||
this.tbPreparerId.Margin = new Padding(2);
|
||||
this.tbPreparerId.Name = "tbPreparerId";
|
||||
this.tbPreparerId.ReadOnly = true;
|
||||
this.tbPreparerId.Size = new Size(155, 20);
|
||||
this.tbPreparerId.TabIndex = 27;
|
||||
this.tbPreparerId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbApplicationId.BackColor = SystemColors.Window;
|
||||
this.tbApplicationId.Location = new Point(113, 48);
|
||||
this.tbApplicationId.Margin = new Padding(2);
|
||||
this.tbApplicationId.Name = "tbApplicationId";
|
||||
this.tbApplicationId.ReadOnly = true;
|
||||
this.tbApplicationId.Size = new Size(155, 20);
|
||||
this.tbApplicationId.TabIndex = 29;
|
||||
this.tbApplicationId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbCopyrightFileId.BackColor = SystemColors.Window;
|
||||
this.tbCopyrightFileId.Location = new Point(113, 114);
|
||||
this.tbCopyrightFileId.Margin = new Padding(2);
|
||||
this.tbCopyrightFileId.Name = "tbCopyrightFileId";
|
||||
this.tbCopyrightFileId.ReadOnly = true;
|
||||
this.tbCopyrightFileId.Size = new Size(155, 20);
|
||||
this.tbCopyrightFileId.TabIndex = 31;
|
||||
this.tbCopyrightFileId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbAbstractFileId.BackColor = SystemColors.Window;
|
||||
this.tbAbstractFileId.Location = new Point(113, 136);
|
||||
this.tbAbstractFileId.Margin = new Padding(2);
|
||||
this.tbAbstractFileId.Name = "tbAbstractFileId";
|
||||
this.tbAbstractFileId.ReadOnly = true;
|
||||
this.tbAbstractFileId.Size = new Size(155, 20);
|
||||
this.tbAbstractFileId.TabIndex = 33;
|
||||
this.tbAbstractFileId.TextAlign = HorizontalAlignment.Center;
|
||||
this.tbBibliographicFileId.BackColor = SystemColors.Window;
|
||||
this.tbBibliographicFileId.Location = new Point(113, 159);
|
||||
this.tbBibliographicFileId.Margin = new Padding(2);
|
||||
this.tbBibliographicFileId.Name = "tbBibliographicFileId";
|
||||
this.tbBibliographicFileId.ReadOnly = true;
|
||||
this.tbBibliographicFileId.Size = new Size(155, 20);
|
||||
this.tbBibliographicFileId.TabIndex = 35;
|
||||
this.tbBibliographicFileId.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbSystemId.Location = new Point(2, 6);
|
||||
this.lbSystemId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbSystemId.MinimumSize = new Size(107, 13);
|
||||
this.lbSystemId.Name = "lbSystemId";
|
||||
this.lbSystemId.Size = new Size(107, 13);
|
||||
this.lbSystemId.TabIndex = 4;
|
||||
this.lbSystemId.Text = "System ID:";
|
||||
this.lbSystemId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbVolumeId.Location = new Point(2, 28);
|
||||
this.lbVolumeId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbVolumeId.MinimumSize = new Size(107, 13);
|
||||
this.lbVolumeId.Name = "lbVolumeId";
|
||||
this.lbVolumeId.Size = new Size(107, 13);
|
||||
this.lbVolumeId.TabIndex = 6;
|
||||
this.lbVolumeId.Text = "Volume ID:";
|
||||
this.lbVolumeId.TextAlign = ContentAlignment.TopRight;
|
||||
this.nbPublisherId.Location = new Point(2, 72);
|
||||
this.nbPublisherId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.nbPublisherId.MinimumSize = new Size(107, 13);
|
||||
this.nbPublisherId.Name = "nbPublisherId";
|
||||
this.nbPublisherId.Size = new Size(107, 13);
|
||||
this.nbPublisherId.TabIndex = 24;
|
||||
this.nbPublisherId.Text = "Publisher ID:";
|
||||
this.nbPublisherId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbPreparerId.Location = new Point(2, 94);
|
||||
this.lbPreparerId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbPreparerId.MinimumSize = new Size(107, 13);
|
||||
this.lbPreparerId.Name = "lbPreparerId";
|
||||
this.lbPreparerId.Size = new Size(107, 13);
|
||||
this.lbPreparerId.TabIndex = 26;
|
||||
this.lbPreparerId.Text = "Preparer ID:";
|
||||
this.lbPreparerId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbApplicationId.Location = new Point(2, 50);
|
||||
this.lbApplicationId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbApplicationId.MinimumSize = new Size(107, 13);
|
||||
this.lbApplicationId.Name = "lbApplicationId";
|
||||
this.lbApplicationId.Size = new Size(107, 13);
|
||||
this.lbApplicationId.TabIndex = 28;
|
||||
this.lbApplicationId.Text = "Application ID:";
|
||||
this.lbApplicationId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbCopyrightFileId.Location = new Point(2, 116);
|
||||
this.lbCopyrightFileId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbCopyrightFileId.MinimumSize = new Size(107, 13);
|
||||
this.lbCopyrightFileId.Name = "lbCopyrightFileId";
|
||||
this.lbCopyrightFileId.Size = new Size(107, 13);
|
||||
this.lbCopyrightFileId.TabIndex = 30;
|
||||
this.lbCopyrightFileId.Text = "Copyright File ID:";
|
||||
this.lbCopyrightFileId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbAbstractFileId.Location = new Point(2, 138);
|
||||
this.lbAbstractFileId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbAbstractFileId.MinimumSize = new Size(107, 13);
|
||||
this.lbAbstractFileId.Name = "lbAbstractFileId";
|
||||
this.lbAbstractFileId.Size = new Size(107, 13);
|
||||
this.lbAbstractFileId.TabIndex = 32;
|
||||
this.lbAbstractFileId.Text = "Abstract File ID:";
|
||||
this.lbAbstractFileId.TextAlign = ContentAlignment.TopRight;
|
||||
this.lbBibliographicFileId.Location = new Point(2, 161);
|
||||
this.lbBibliographicFileId.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbBibliographicFileId.MinimumSize = new Size(107, 13);
|
||||
this.lbBibliographicFileId.Name = "lbBibliographicFileId";
|
||||
this.lbBibliographicFileId.Size = new Size(107, 13);
|
||||
this.lbBibliographicFileId.TabIndex = 34;
|
||||
this.lbBibliographicFileId.Text = "Bibliographic File ID:";
|
||||
this.lbBibliographicFileId.TextAlign = ContentAlignment.TopRight;
|
||||
this.tbLogicalBlockSize.BackColor = SystemColors.Window;
|
||||
this.tbLogicalBlockSize.Location = new Point(414, 159);
|
||||
this.tbLogicalBlockSize.Margin = new Padding(2);
|
||||
this.tbLogicalBlockSize.Name = "tbLogicalBlockSize";
|
||||
this.tbLogicalBlockSize.ReadOnly = true;
|
||||
this.tbLogicalBlockSize.Size = new Size(155, 20);
|
||||
this.tbLogicalBlockSize.TabIndex = 45;
|
||||
this.tbLogicalBlockSize.TextAlign = HorizontalAlignment.Center;
|
||||
this.lbLogicalBlockSize.Location = new Point(277, 161);
|
||||
this.lbLogicalBlockSize.Margin = new Padding(2, 0, 2, 0);
|
||||
this.lbLogicalBlockSize.MinimumSize = new Size(130, 13);
|
||||
this.lbLogicalBlockSize.Name = "lbLogicalBlockSize";
|
||||
this.lbLogicalBlockSize.Size = new Size(133, 13);
|
||||
this.lbLogicalBlockSize.TabIndex = 44;
|
||||
this.lbLogicalBlockSize.Text = "Logical Block Size:";
|
||||
this.lbLogicalBlockSize.TextAlign = ContentAlignment.TopRight;
|
||||
this.AutoScaleDimensions = new SizeF(6f, 13f);
|
||||
this.AutoScaleMode = AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.Controls.Add((Control) this.tbLogicalBlockSize);
|
||||
this.Controls.Add((Control) this.lbLogicalBlockSize);
|
||||
this.Controls.Add((Control) this.tbVolumeEffectiveDate);
|
||||
this.Controls.Add((Control) this.lbVolumeEffectiveDate);
|
||||
this.Controls.Add((Control) this.tbVolumeExpirationDate);
|
||||
this.Controls.Add((Control) this.lbVolumeExpirationDate);
|
||||
this.Controls.Add((Control) this.tbVolumeModificationDate);
|
||||
this.Controls.Add((Control) this.lbVolumeModificationDate);
|
||||
this.Controls.Add((Control) this.tbVolumeCreationDate);
|
||||
this.Controls.Add((Control) this.lbVloumeCreationDate);
|
||||
this.Controls.Add((Control) this.tbBibliographicFileId);
|
||||
this.Controls.Add((Control) this.lbBibliographicFileId);
|
||||
this.Controls.Add((Control) this.tbAbstractFileId);
|
||||
this.Controls.Add((Control) this.lbAbstractFileId);
|
||||
this.Controls.Add((Control) this.tbCopyrightFileId);
|
||||
this.Controls.Add((Control) this.lbCopyrightFileId);
|
||||
this.Controls.Add((Control) this.tbApplicationId);
|
||||
this.Controls.Add((Control) this.lbApplicationId);
|
||||
this.Controls.Add((Control) this.tbPreparerId);
|
||||
this.Controls.Add((Control) this.lbPreparerId);
|
||||
this.Controls.Add((Control) this.tbPublisherId);
|
||||
this.Controls.Add((Control) this.nbPublisherId);
|
||||
this.Controls.Add((Control) this.tbVolumeSetId);
|
||||
this.Controls.Add((Control) this.lbVolumeSetId);
|
||||
this.Controls.Add((Control) this.tbVolumeNumber);
|
||||
this.Controls.Add((Control) this.lbVolumeNumber);
|
||||
this.Controls.Add((Control) this.tbVolumeSpaceSize);
|
||||
this.Controls.Add((Control) this.lbVolumeSpaceSize);
|
||||
this.Controls.Add((Control) this.tbVolumeId);
|
||||
this.Controls.Add((Control) this.lbVolumeId);
|
||||
this.Controls.Add((Control) this.tbSystemId);
|
||||
this.Controls.Add((Control) this.lbSystemId);
|
||||
this.Margin = new Padding(2);
|
||||
this.Name = nameof (PrimaryVolumeDescriptorViewer);
|
||||
this.Size = new Size(575, 181);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
}
|
||||
}
|
120
Explorer/UserControls/PrimaryVolumeDescriptorViewer.resx
Normal file
120
Explorer/UserControls/PrimaryVolumeDescriptorViewer.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
Loading…
Add table
Add a link
Reference in a new issue