Code cleanup and reformatting.

This commit is contained in:
2018-07-31 00:14:45 +01:00
parent 978ea811a0
commit ebde6d67e1
5 changed files with 758 additions and 772 deletions

View File

@@ -28,9 +28,10 @@
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
using System; using System;
using Eto;
using Eto.Forms; using Eto.Forms;
using Eto.Drawing;
namespace CICMMetadataEditor.Desktop namespace CICMMetadataEditor.Desktop
{ {
@@ -39,7 +40,7 @@ namespace CICMMetadataEditor.Desktop
[STAThread] [STAThread]
static void Main(string[] args) static void Main(string[] args)
{ {
new Application(Eto.Platform.Detect).Run(new dlgMetadata()); new Application(Platform.Detect).Run(new dlgMetadata());
} }
} }
} }

View File

@@ -58,7 +58,7 @@ namespace CICMMetadataEditor
class TargetOsEntry class TargetOsEntry
{ {
public string name { get; set; } public string name { get; set; }
public string version { get; set; } public string version { get; set; }
} }
} }

View File

@@ -41,16 +41,13 @@ namespace CICMMetadataEditor
{ {
public class dlgBlockMedia : Dialog public class dlgBlockMedia : Dialog
{ {
// Non-editable fields ChecksumType[] checksums;
ChecksumType[] checksums; ChecksumType[] contentChks;
ChecksumType[] contentChks; DumpHardwareType dumpHwIter;
DumpHardwareType dumpHwIter; bool editingDumpHw;
bool editingDumpHw; bool editingPartition;
FileSystemType filesystemIter;
bool editingPartition; ObservableCollection<StringEntry> lstAdditionalInformation;
FileSystemType filesystemIter;
ObservableCollection<StringEntry> lstAdditionalInformation;
ObservableCollection<DumpType> lstAta; ObservableCollection<DumpType> lstAta;
ObservableCollection<DumpType> lstCID; ObservableCollection<DumpType> lstCID;
ObservableCollection<DumpType> lstCSD; ObservableCollection<DumpType> lstCSD;
@@ -70,11 +67,10 @@ namespace CICMMetadataEditor
ObservableCollection<DumpType> lstUSBDescriptors; ObservableCollection<DumpType> lstUSBDescriptors;
public BlockMediaType Metadata; public BlockMediaType Metadata;
public bool Modified; public bool Modified;
PartitionType partitionIter;
PartitionType partitionIter; ScansType scans;
ScansType scans; TapePartitionType[] tapeInformation;
TapePartitionType[] tapeInformation; BlockSizeType[] variableBlockSize;
BlockSizeType[] variableBlockSize;
public dlgBlockMedia() public dlgBlockMedia()
{ {
@@ -150,9 +146,9 @@ namespace CICMMetadataEditor
treeDumpHardware.Columns.Add(new GridColumn treeDumpHardware.Columns.Add(new GridColumn
{ {
DataCell = DataCell =
new TextBoxCell {Binding = Binding.Property<DumpHardwareType, string>(r => r.Manufacturer)}, new TextBoxCell {Binding = Binding.Property<DumpHardwareType, string>(r => r.Manufacturer)},
HeaderText = "Manufacturer" HeaderText = "Manufacturer"
}); });
treeDumpHardware.Columns.Add(new GridColumn treeDumpHardware.Columns.Add(new GridColumn
{ {
@@ -595,65 +591,66 @@ namespace CICMMetadataEditor
treeAdditionalInformation.DataStore = lstAdditionalInformation; treeAdditionalInformation.DataStore = lstAdditionalInformation;
treeAdditionalInformation.AllowMultipleSelection = false; treeAdditionalInformation.AllowMultipleSelection = false;
txtImage.ToolTip = "This is the disk image containing this media."; txtImage.ToolTip = "This is the disk image containing this media.";
txtFormat.ToolTip = "This is the format of the disk image."; txtFormat.ToolTip = "This is the format of the disk image.";
txtOffset.ToolTip = "Byte offset where the media dump starts in the disk image."; txtOffset.ToolTip = "Byte offset where the media dump starts in the disk image.";
txtSize.ToolTip = "Size of the disk dump."; txtSize.ToolTip = "Size of the disk dump.";
txtManufacturer.ToolTip = "Disk manufacturer."; txtManufacturer.ToolTip = "Disk manufacturer.";
txtModel.ToolTip = "Disk model."; txtModel.ToolTip = "Disk model.";
txtSerial.ToolTip = "Disk serial number."; txtSerial.ToolTip = "Disk serial number.";
txtFirmware.ToolTip = "Disk firmware revision."; txtFirmware.ToolTip = "Disk firmware revision.";
txtInterface.ToolTip = "Disk interface."; txtInterface.ToolTip = "Disk interface.";
txtCopyProtection.ToolTip = "Disk copy protection."; txtCopyProtection.ToolTip = "Disk copy protection.";
txtMediaType.ToolTip = "Disk type."; txtMediaType.ToolTip = "Disk type.";
txtMediaSubtype.ToolTip = "Disk subtype."; txtMediaSubtype.ToolTip = "Disk subtype.";
chkSequence.ToolTip = "If checked means this disk is one in a sequence of several."; chkSequence.ToolTip = "If checked means this disk is one in a sequence of several.";
txtMediaTitle.ToolTip = "Title of disk."; txtMediaTitle.ToolTip = "Title of disk.";
spSequence.ToolTip = "Number of this disk in the sequence."; spSequence.ToolTip = "Number of this disk in the sequence.";
spTotalMedia.ToolTip = "How many disks make the sequence."; spTotalMedia.ToolTip = "How many disks make the sequence.";
spSide.ToolTip = "On flippy disks, which side of the disk is represented by this dump."; spSide.ToolTip = "On flippy disks, which side of the disk is represented by this dump.";
spLayer.ToolTip = "On PTP layered disks, which layer of the side of the disk is represented by this dump."; spLayer.ToolTip =
txtBlocks.ToolTip = "How many individual blocks (sectors) are in this dump."; "On PTP layered disks, which layer of the side of the disk is represented by this dump.";
txtBlocks.ToolTip = "How many individual blocks (sectors) are in this dump.";
spPhysicalBlockSize.ToolTip = "Size of the biggest physical block in bytes."; spPhysicalBlockSize.ToolTip = "Size of the biggest physical block in bytes.";
spLogicalBlockSize.ToolTip = "Size of the biggest logical block in bytes."; spLogicalBlockSize.ToolTip = "Size of the biggest logical block in bytes.";
spCylinders.ToolTip = "Cylinders of disk."; spCylinders.ToolTip = "Cylinders of disk.";
spHeads.ToolTip = "Heads of disk."; spHeads.ToolTip = "Heads of disk.";
spSectors.ToolTip = "Sectors per track of disk."; spSectors.ToolTip = "Sectors per track of disk.";
chkDimensions.ToolTip = "If checked, physical dimensions of disk are known."; chkDimensions.ToolTip = "If checked, physical dimensions of disk are known.";
chkRound.ToolTip = "If checked, disk is physicaly round."; chkRound.ToolTip = "If checked, disk is physicaly round.";
spDiameter.ToolTip = "Diameter in milimeters of disk."; spDiameter.ToolTip = "Diameter in milimeters of disk.";
spHeight.ToolTip = "Height in milimeters of disk."; spHeight.ToolTip = "Height in milimeters of disk.";
spWidth.ToolTip = "Width in milimeters of disk."; spWidth.ToolTip = "Width in milimeters of disk.";
spThickness.ToolTip = "Thickness in milimeters of disk."; spThickness.ToolTip = "Thickness in milimeters of disk.";
chkATA.ToolTip = "If checked, disk dump contains ATA(PI) IDENTIFY information."; chkATA.ToolTip = "If checked, disk dump contains ATA(PI) IDENTIFY information.";
} }
public void FillFields() public void FillFields()
{ {
if(Metadata == null) return; if(Metadata == null) return;
txtImage.Text = Metadata.Image.Value; txtImage.Text = Metadata.Image.Value;
txtFormat.Text = Metadata.Image.format; txtFormat.Text = Metadata.Image.format;
if(Metadata.Image.offsetSpecified) txtOffset.Text = Metadata.Image.offset.ToString(); if(Metadata.Image.offsetSpecified) txtOffset.Text = Metadata.Image.offset.ToString();
txtSize.Text = Metadata.Size.ToString(); txtSize.Text = Metadata.Size.ToString();
checksums = Metadata.Checksums; checksums = Metadata.Checksums;
contentChks = Metadata.ContentChecksums; contentChks = Metadata.ContentChecksums;
if(Metadata.Sequence != null) if(Metadata.Sequence != null)
{ {
lblMediaTitle.Visible = true; lblMediaTitle.Visible = true;
txtMediaTitle.Visible = true; txtMediaTitle.Visible = true;
lblSequence.Visible = true; lblSequence.Visible = true;
spSequence.Visible = true; spSequence.Visible = true;
lblTotalMedia.Visible = true; lblTotalMedia.Visible = true;
spTotalMedia.Visible = true; spTotalMedia.Visible = true;
lblSide.Visible = true; lblSide.Visible = true;
spSide.Visible = true; spSide.Visible = true;
lblLayer.Visible = true; lblLayer.Visible = true;
spLayer.Visible = true; spLayer.Visible = true;
chkSequence.Checked = true; chkSequence.Checked = true;
txtMediaTitle.Text = Metadata.Sequence.MediaTitle; txtMediaTitle.Text = Metadata.Sequence.MediaTitle;
spSequence.Value = Metadata.Sequence.MediaSequence; spSequence.Value = Metadata.Sequence.MediaSequence;
spTotalMedia.Value = Metadata.Sequence.TotalMedia; spTotalMedia.Value = Metadata.Sequence.TotalMedia;
if(Metadata.Sequence.SideSpecified) spSide.Value = Metadata.Sequence.Side; if(Metadata.Sequence.SideSpecified) spSide.Value = Metadata.Sequence.Side;
if(Metadata.Sequence.LayerSpecified) spLayer.Value = Metadata.Sequence.Layer; if(Metadata.Sequence.LayerSpecified) spLayer.Value = Metadata.Sequence.Layer;
} }
@@ -663,12 +660,12 @@ namespace CICMMetadataEditor
if(Metadata.Serial != null) txtSerial.Text = Metadata.Serial; if(Metadata.Serial != null) txtSerial.Text = Metadata.Serial;
if(Metadata.Firmware != null) txtFirmware.Text = Metadata.Firmware; if(Metadata.Firmware != null) txtFirmware.Text = Metadata.Firmware;
if(Metadata.Interface != null) txtInterface.Text = Metadata.Interface; if(Metadata.Interface != null) txtInterface.Text = Metadata.Interface;
spPhysicalBlockSize.Value = Metadata.PhysicalBlockSize; spPhysicalBlockSize.Value = Metadata.PhysicalBlockSize;
spLogicalBlockSize.Value = Metadata.LogicalBlockSize; spLogicalBlockSize.Value = Metadata.LogicalBlockSize;
txtBlocks.Text = Metadata.LogicalBlocks.ToString(); txtBlocks.Text = Metadata.LogicalBlocks.ToString();
variableBlockSize = Metadata.VariableBlockSize; variableBlockSize = Metadata.VariableBlockSize;
tapeInformation = Metadata.TapeInformation; tapeInformation = Metadata.TapeInformation;
scans = Metadata.Scans; scans = Metadata.Scans;
if(Metadata.ATA?.Identify != null) if(Metadata.ATA?.Identify != null)
{ {
chkATA.Checked = true; chkATA.Checked = true;
@@ -721,14 +718,11 @@ namespace CICMMetadataEditor
if(Metadata.PCMCIA.Compliance != null) txtCompliance.Text = Metadata.PCMCIA.Compliance; if(Metadata.PCMCIA.Compliance != null) txtCompliance.Text = Metadata.PCMCIA.Compliance;
if(Metadata.PCMCIA.ManufacturerCodeSpecified) if(Metadata.PCMCIA.ManufacturerCodeSpecified)
txtMfgCode.Text = txtMfgCode.Text = $"0x{Metadata.PCMCIA.ManufacturerCode:X4}";
$"0x{Metadata.PCMCIA.ManufacturerCode:X4}";
if(Metadata.PCMCIA.CardCodeSpecified) if(Metadata.PCMCIA.CardCodeSpecified)
txtCardCode.Text = $"0x{Metadata.PCMCIA.CardCode:X4}"; txtCardCode.Text = $"0x{Metadata.PCMCIA.CardCode:X4}";
if(Metadata.PCMCIA.Manufacturer != null) if(Metadata.PCMCIA.Manufacturer != null) txtPCMCIAManufacturer.Text = Metadata.PCMCIA.Manufacturer;
txtPCMCIAManufacturer.Text = Metadata.PCMCIA.Manufacturer; if(Metadata.PCMCIA.ProductName != null) txtPCMCIAProductName.Text = Metadata.PCMCIA.ProductName;
if(Metadata.PCMCIA.ProductName != null)
txtPCMCIAProductName.Text = Metadata.PCMCIA.ProductName;
if(Metadata.PCMCIA.AdditionalInformation != null) if(Metadata.PCMCIA.AdditionalInformation != null)
{ {
lblAdditionalInformation.Visible = true; lblAdditionalInformation.Visible = true;
@@ -830,7 +824,7 @@ namespace CICMMetadataEditor
} }
if(Metadata.CopyProtection != null) txtCopyProtection.Text = Metadata.CopyProtection; if(Metadata.CopyProtection != null) txtCopyProtection.Text = Metadata.CopyProtection;
if(Metadata.Dimensions != null) if(Metadata.Dimensions != null)
{ {
chkDimensions.Checked = true; chkDimensions.Checked = true;
if(Metadata.Dimensions.DiameterSpecified) if(Metadata.Dimensions.DiameterSpecified)
@@ -1045,28 +1039,30 @@ namespace CICMMetadataEditor
} }
protected void OnBtnEditFilesystemClicked(object sender, EventArgs e) protected void OnBtnEditFilesystemClicked(object sender, EventArgs e)
{/* {
if(treeFilesystems.SelectedItem == null) return; /*
if(treeFilesystems.SelectedItem == null) return;
filesystemIter = (FileSystemType)treeFilesystems.SelectedItem; filesystemIter = (FileSystemType)treeFilesystems.SelectedItem;
dlgFilesystem _dlgFilesystem = new dlgFilesystem {Metadata = filesystemIter}; dlgFilesystem _dlgFilesystem = new dlgFilesystem {Metadata = filesystemIter};
_dlgFilesystem.FillFields(); _dlgFilesystem.FillFields();
_dlgFilesystem.ShowModal(this); _dlgFilesystem.ShowModal(this);
if(!_dlgFilesystem.Modified) return; if(!_dlgFilesystem.Modified) return;
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Remove(filesystemIter); ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Remove(filesystemIter);
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/ ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/
} }
protected void OnBtnAddFilesystemClicked(object sender, EventArgs e) protected void OnBtnAddFilesystemClicked(object sender, EventArgs e)
{/* {
dlgFilesystem _dlgFilesystem = new dlgFilesystem(); /*
_dlgFilesystem.ShowModal(this); dlgFilesystem _dlgFilesystem = new dlgFilesystem();
_dlgFilesystem.ShowModal(this);
if(_dlgFilesystem.Modified) if(_dlgFilesystem.Modified)
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/ ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/
} }
protected void OnChkDumpHardwareToggled(object sender, EventArgs e) protected void OnChkDumpHardwareToggled(object sender, EventArgs e)

File diff suppressed because it is too large Load Diff

View File

@@ -41,23 +41,20 @@ namespace CICMMetadataEditor
{ {
public class dlgOpticalDisc : Dialog public class dlgOpticalDisc : Dialog
{ {
// Non-editable fields ChecksumType[] checksums;
ChecksumType[] checksums; DumpHardwareType dumpHwIter;
DumpHardwareType dumpHwIter; bool editingDumpHw;
bool editingDumpHw; bool editingPartition;
FileSystemType filesystemIter;
bool editingPartition; ObservableCollection<DumpType> lstADIP;
FileSystemType filesystemIter; ObservableCollection<DumpType> lstATIP;
ObservableCollection<DumpType> lstADIP; ObservableCollection<DumpType> lstBCA;
ObservableCollection<DumpType> lstATIP; ObservableCollection<DumpType> lstCDText;
ObservableCollection<DumpType> lstBCA; ObservableCollection<DumpType> lstCMI;
ObservableCollection<DumpType> lstCDText; ObservableCollection<DumpType> lstDCB;
ObservableCollection<DumpType> lstCMI; ObservableCollection<DumpType> lstDDS;
ObservableCollection<DumpType> lstDCB; ObservableCollection<DumpType> lstDI;
ObservableCollection<DumpType> lstDDS; ObservableCollection<DumpType> lstDMI;
ObservableCollection<DumpType> lstDI;
ObservableCollection<DumpType> lstDMI;
ObservableCollection<DumpHardwareType> lstDumpHw; ObservableCollection<DumpHardwareType> lstDumpHw;
ObservableCollection<DumpType> lstLastRMD; ObservableCollection<DumpType> lstLastRMD;
ObservableCollection<SectorsType> lstLayers; ObservableCollection<SectorsType> lstLayers;
@@ -82,9 +79,8 @@ namespace CICMMetadataEditor
public bool Modified; public bool Modified;
PartitionType partitionIter; PartitionType partitionIter;
ScansType scans; ScansType scans;
TrackType trackIter;
TrackType trackIter; XboxType xbox;
XboxType xbox;
public dlgOpticalDisc() public dlgOpticalDisc()
{ {
@@ -156,9 +152,9 @@ namespace CICMMetadataEditor
treeDumpHardware.Columns.Add(new GridColumn treeDumpHardware.Columns.Add(new GridColumn
{ {
DataCell = DataCell =
new TextBoxCell {Binding = Binding.Property<DumpHardwareType, string>(r => r.Manufacturer)}, new TextBoxCell {Binding = Binding.Property<DumpHardwareType, string>(r => r.Manufacturer)},
HeaderText = "Manufacturer" HeaderText = "Manufacturer"
}); });
treeDumpHardware.Columns.Add(new GridColumn treeDumpHardware.Columns.Add(new GridColumn
{ {
@@ -643,7 +639,7 @@ namespace CICMMetadataEditor
#endregion Set mould text table #endregion Set mould text table
#region Set layer type combo box #region Set layer type combo box
cmbLayerType = new EnumDropDown<LayersTypeType>(); cmbLayerType = new EnumDropDown<LayersTypeType>();
stkLayers.Items.Add(new StackLayoutItem {Control = cmbLayerType}); stkLayers.Items.Add(new StackLayoutItem {Control = cmbLayerType});
#endregion Set layer type combo box #endregion Set layer type combo box
@@ -841,39 +837,40 @@ namespace CICMMetadataEditor
spSequence.ToolTip = "Number of this disc in the sequence."; spSequence.ToolTip = "Number of this disc in the sequence.";
spTotalMedia.ToolTip = "How many diskc make the sequence."; spTotalMedia.ToolTip = "How many diskc make the sequence.";
spSide.ToolTip = "On double sided discs, which side of the disc is represented by this dump."; spSide.ToolTip = "On double sided discs, which side of the disc is represented by this dump.";
spLayer.ToolTip = "On PTP layered discs, which layer of the side of the disc is represented by this dump."; spLayer.ToolTip =
chkDimensions.ToolTip = "If checked, physical dimensions of disk are known."; "On PTP layered discs, which layer of the side of the disc is represented by this dump.";
chkRound.ToolTip = "If checked, disk is physicaly round."; chkDimensions.ToolTip = "If checked, physical dimensions of disk are known.";
spDiameter.ToolTip = "Diameter in milimeters of disk."; chkRound.ToolTip = "If checked, disk is physicaly round.";
spHeight.ToolTip = "Height in milimeters of disk."; spDiameter.ToolTip = "Diameter in milimeters of disk.";
spWidth.ToolTip = "Width in milimeters of disk."; spHeight.ToolTip = "Height in milimeters of disk.";
spThickness.ToolTip = "Thickness in milimeters of disk."; spWidth.ToolTip = "Width in milimeters of disk.";
spThickness.ToolTip = "Thickness in milimeters of disk.";
} }
public void FillFields() public void FillFields()
{ {
if(Metadata == null) return; if(Metadata == null) return;
txtImage.Text = Metadata.Image.Value; txtImage.Text = Metadata.Image.Value;
txtFormat.Text = Metadata.Image.format; txtFormat.Text = Metadata.Image.format;
if(Metadata.Image.offsetSpecified) txtOffset.Text = Metadata.Image.offset.ToString(); if(Metadata.Image.offsetSpecified) txtOffset.Text = Metadata.Image.offset.ToString();
txtSize.Text = Metadata.Size.ToString(); txtSize.Text = Metadata.Size.ToString();
if(Metadata.Sequence != null) if(Metadata.Sequence != null)
{ {
lblDiscTitle.Visible = true; lblDiscTitle.Visible = true;
lblDiscTitle.Visible = true; lblDiscTitle.Visible = true;
lblSequence.Visible = true; lblSequence.Visible = true;
spSequence.Visible = true; spSequence.Visible = true;
lblTotalMedia.Visible = true; lblTotalMedia.Visible = true;
spTotalMedia.Visible = true; spTotalMedia.Visible = true;
lblSide.Visible = true; lblSide.Visible = true;
spSide.Visible = true; spSide.Visible = true;
lblLayer.Visible = true; lblLayer.Visible = true;
spLayer.Visible = true; spLayer.Visible = true;
chkSequence.Checked = true; chkSequence.Checked = true;
txtDiscTitle.Text = Metadata.Sequence.MediaTitle; txtDiscTitle.Text = Metadata.Sequence.MediaTitle;
spSequence.Value = Metadata.Sequence.MediaSequence; spSequence.Value = Metadata.Sequence.MediaSequence;
spTotalMedia.Value = Metadata.Sequence.TotalMedia; spTotalMedia.Value = Metadata.Sequence.TotalMedia;
if(Metadata.Sequence.SideSpecified) spSide.Value = Metadata.Sequence.Side; if(Metadata.Sequence.SideSpecified) spSide.Value = Metadata.Sequence.Side;
if(Metadata.Sequence.LayerSpecified) spLayer.Value = Metadata.Sequence.Layer; if(Metadata.Sequence.LayerSpecified) spLayer.Value = Metadata.Sequence.Layer;
} }
@@ -921,11 +918,11 @@ namespace CICMMetadataEditor
treeMouldTexts.DataStore = lstMouldTexts; treeMouldTexts.DataStore = lstMouldTexts;
} }
if(Metadata.DiscType != null) txtDiscType.Text = Metadata.DiscType; if(Metadata.DiscType != null) txtDiscType.Text = Metadata.DiscType;
if(Metadata.DiscSubType != null) txtDiscSubtype.Text = Metadata.DiscSubType; if(Metadata.DiscSubType != null) txtDiscSubtype.Text = Metadata.DiscSubType;
if(Metadata.OffsetSpecified) txtWriteOffset.Text = Metadata.Offset.ToString(); if(Metadata.OffsetSpecified) txtWriteOffset.Text = Metadata.Offset.ToString();
txtMediaTracks.Text = Metadata.Tracks[0].ToString(); txtMediaTracks.Text = Metadata.Tracks[0].ToString();
txtMediaSessions.Text = Metadata.Sessions.ToString(); txtMediaSessions.Text = Metadata.Sessions.ToString();
if(Metadata.CopyProtection != null) txtCopyProtection.Text = Metadata.CopyProtection; if(Metadata.CopyProtection != null) txtCopyProtection.Text = Metadata.CopyProtection;
if(Metadata.Dimensions != null) if(Metadata.Dimensions != null)
@@ -1182,9 +1179,9 @@ namespace CICMMetadataEditor
txtPartitionType.Text = partitionIter.Type; txtPartitionType.Text = partitionIter.Type;
txtPartitionName.Text = partitionIter.Name; txtPartitionName.Text = partitionIter.Name;
txtPartitionDescription.Text = partitionIter.Description; txtPartitionDescription.Text = partitionIter.Description;
treeFilesystems.DataStore = partitionIter.FileSystems != null treeFilesystems.DataStore = partitionIter.FileSystems != null
? new ObservableCollection<FileSystemType>(partitionIter.FileSystems) ? new ObservableCollection<FileSystemType>(partitionIter.FileSystems)
: new ObservableCollection<FileSystemType>(); : new ObservableCollection<FileSystemType>();
btnCancelPartition.Visible = true; btnCancelPartition.Visible = true;
btnApplyPartition.Visible = true; btnApplyPartition.Visible = true;
btnRemovePartition.Visible = false; btnRemovePartition.Visible = false;
@@ -1271,28 +1268,30 @@ namespace CICMMetadataEditor
} }
protected void OnBtnEditFilesystemClicked(object sender, EventArgs e) protected void OnBtnEditFilesystemClicked(object sender, EventArgs e)
{/* {
if(treeFilesystems.SelectedItem == null) return; /*
if(treeFilesystems.SelectedItem == null) return;
filesystemIter = (FileSystemType)treeFilesystems.SelectedItem; filesystemIter = (FileSystemType)treeFilesystems.SelectedItem;
dlgFilesystem _dlgFilesystem = new dlgFilesystem {Metadata = filesystemIter}; dlgFilesystem _dlgFilesystem = new dlgFilesystem {Metadata = filesystemIter};
_dlgFilesystem.FillFields(); _dlgFilesystem.FillFields();
_dlgFilesystem.ShowModal(this); _dlgFilesystem.ShowModal(this);
if(!_dlgFilesystem.Modified) return; if(!_dlgFilesystem.Modified) return;
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Remove(filesystemIter); ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Remove(filesystemIter);
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/ ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/
} }
protected void OnBtnAddFilesystemClicked(object sender, EventArgs e) protected void OnBtnAddFilesystemClicked(object sender, EventArgs e)
{/* {
dlgFilesystem _dlgFilesystem = new dlgFilesystem(); /*
_dlgFilesystem.ShowModal(this); dlgFilesystem _dlgFilesystem = new dlgFilesystem();
_dlgFilesystem.ShowModal(this);
if(_dlgFilesystem.Modified) if(_dlgFilesystem.Modified)
((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/ ((ObservableCollection<FileSystemType>)treeFilesystems.DataStore).Add(_dlgFilesystem.Metadata);*/
} }
protected void OnBtnCancelTrackClicked(object sender, EventArgs e) protected void OnBtnCancelTrackClicked(object sender, EventArgs e)
@@ -1309,27 +1308,27 @@ namespace CICMMetadataEditor
protected void OnBtnApplyTrackClicked(object sender, EventArgs e) protected void OnBtnApplyTrackClicked(object sender, EventArgs e)
{ {
string file = trackIter.Image.Value; string file = trackIter.Image.Value;
long filesize = trackIter.Size; long filesize = trackIter.Size;
string fileformat = trackIter.Image.format; string fileformat = trackIter.Image.format;
long fileoffset = trackIter.Image.offset; long fileoffset = trackIter.Image.offset;
ChecksumType[] checksums = trackIter.Checksums; ChecksumType[] checksums = trackIter.Checksums;
SubChannelType subchannel = trackIter.SubChannel; SubChannelType subchannel = trackIter.SubChannel;
TrackTypeTrackType trackType = TrackTypeTrackType trackType =
(TrackTypeTrackType)Enum.Parse(typeof(TrackTypeTrackType), cmbTrackType.Text); (TrackTypeTrackType)Enum.Parse(typeof(TrackTypeTrackType), cmbTrackType.Text);
lstTracks.Remove(trackIter); lstTracks.Remove(trackIter);
trackIter = new TrackType trackIter = new TrackType
{ {
AccoustID = txtAcoustID.Text, AccoustID = txtAcoustID.Text,
BytesPerSector = int.Parse(txtBytesPerSector.Text), BytesPerSector = int.Parse(txtBytesPerSector.Text),
Checksums = checksums, Checksums = checksums,
EndMSF = txtMSFEnd.Text, EndMSF = txtMSFEnd.Text,
EndSector = long.Parse(txtTrackEnd.Text), EndSector = long.Parse(txtTrackEnd.Text),
Image = Image =
new ImageType {format = fileformat, offset = fileoffset, offsetSpecified = true, Value = file}, new ImageType {format = fileformat, offset = fileoffset, offsetSpecified = true, Value = file},
Sequence = Sequence =
new TrackSequenceType new TrackSequenceType
{ {
Session = int.Parse(txtSessionSequence.Text), Session = int.Parse(txtSessionSequence.Text),