diff --git a/CICMMetadataEditor/CICMMetadataEditor/dlgMetadata.xeto.cs b/CICMMetadataEditor/CICMMetadataEditor/dlgMetadata.xeto.cs index 0ddbc4f..8f4cf30 100644 --- a/CICMMetadataEditor/CICMMetadataEditor/dlgMetadata.xeto.cs +++ b/CICMMetadataEditor/CICMMetadataEditor/dlgMetadata.xeto.cs @@ -83,7 +83,104 @@ namespace CICMMetadataEditor { XamlReader.Load(this); - LoadData(); + cmbReleaseType = new EnumDropDown(); + stkReleaseType.Items.Add(new StackLayoutItem {Control = cmbReleaseType, Expand = true}); + + treeKeywords.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, + HeaderText = "Keyword" + }); + treeBarcodes.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.code)}, + HeaderText = "Barcode" + }); + treeBarcodes.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell + { + Binding = Binding.Property(r => r.type).Convert(v => v.ToString()) + }, + HeaderText = "Type" + }); + treeCategories.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, + HeaderText = "Category" + }); + treeSubcategories.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, + HeaderText = "Subcategory" + }); + treeLanguages.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, + HeaderText = "Language" + }); + treeOses.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.name)}, + HeaderText = "Name" + }); + treeOses.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.version)}, + HeaderText = "Version" + }); + treeArchitectures.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, + HeaderText = "Architecture" + }); + treeDiscs.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.path)}, + HeaderText = "File" + }); + treeDisks.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(r => r.path)}, + HeaderText = "File" + }); + + treeKeywords.AllowMultipleSelection = false; + treeBarcodes.AllowMultipleSelection = false; + treeCategories.AllowMultipleSelection = false; + treeSubcategories.AllowMultipleSelection = false; + treeLanguages.AllowMultipleSelection = false; + treeOses.AllowMultipleSelection = false; + treeArchitectures.AllowMultipleSelection = false; + treeDiscs.AllowMultipleSelection = false; + treeDisks.AllowMultipleSelection = false; + + txtDeveloper.ToolTip = "Who developed the application."; + txtPublisher.ToolTip = "Who published the application."; + txtAuthor.ToolTip = "Author of the audiovisual media."; + txtPerformer.ToolTip = "Performer of the audiovisual media."; + txtName.ToolTip = "Application name."; + txtVersion.ToolTip = "Application version."; + txtPartNumber.ToolTip = "Part number of the application distribution."; + txtSerialNumber.ToolTip = + "Serial number of the application distribution. Not to be confused with serial number required to install."; + + lstBarcodeTypes = new ObservableCollection(); + lstLanguageTypes = new ObservableCollection(); + lstArchitecturesTypes = new ObservableCollection(); + lstFilesForMedia = new ObservableCollection(); + + //cmbBarcodes.ItemTextBinding = Binding.Property(r => r.str); + cmbBarcodes.DataStore = lstBarcodeTypes; + cmbLanguages.DataStore = lstLanguageTypes; + cmbArchitectures.DataStore = lstArchitecturesTypes; + cmbFilesForNewDisc.DataStore = lstFilesForMedia; + cmbFilesForNewDisk.DataStore = lstFilesForMedia; + + FillBarcodeCombo(); + FillLanguagesCombo(); + FillArchitecturesCombo(); + FillFilesCombos(); } protected void OnAboutClicked(object sender, EventArgs e) @@ -180,9 +277,6 @@ namespace CICMMetadataEditor { modified = false; - cmbReleaseType = new EnumDropDown(); - stkReleaseType.Items.Add(new StackLayoutItem {Control = cmbReleaseType, Expand = true}); - lstKeywords = new ObservableCollection(); lstBarcodes = new ObservableCollection(); lstCategories = new ObservableCollection(); @@ -193,64 +287,6 @@ namespace CICMMetadataEditor lstDiscs = new ObservableCollection(); lstDisks = new ObservableCollection(); - treeKeywords.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, - HeaderText = "Keyword" - }); - treeBarcodes.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.code)}, - HeaderText = "Barcode" - }); - treeBarcodes.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell - { - Binding = Binding.Property(r => r.type).Convert(v => v.ToString()) - }, - HeaderText = "Type" - }); - treeCategories.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, - HeaderText = "Category" - }); - treeSubcategories.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, - HeaderText = "Subcategory" - }); - treeLanguages.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, - HeaderText = "Language" - }); - treeOses.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.name)}, - HeaderText = "Name" - }); - treeOses.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.version)}, - HeaderText = "Version" - }); - treeArchitectures.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.str)}, - HeaderText = "Architecture" - }); - treeDiscs.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.path)}, - HeaderText = "File" - }); - treeDisks.Columns.Add(new GridColumn - { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.path)}, - HeaderText = "File" - }); treeKeywords.DataStore = lstKeywords; treeBarcodes.DataStore = lstBarcodes; @@ -262,42 +298,23 @@ namespace CICMMetadataEditor treeDiscs.DataStore = lstDiscs; treeDisks.DataStore = lstDisks; - treeKeywords.AllowMultipleSelection = false; - treeBarcodes.AllowMultipleSelection = false; - treeCategories.AllowMultipleSelection = false; - treeSubcategories.AllowMultipleSelection = false; - treeLanguages.AllowMultipleSelection = false; - treeOses.AllowMultipleSelection = false; - treeArchitectures.AllowMultipleSelection = false; - treeDiscs.AllowMultipleSelection = false; - treeDisks.AllowMultipleSelection = false; - - lstBarcodeTypes = new ObservableCollection(); - lstLanguageTypes = new ObservableCollection(); - lstArchitecturesTypes = new ObservableCollection(); - lstFilesForMedia = new ObservableCollection(); - - //cmbBarcodes.ItemTextBinding = Binding.Property(r => r.str); - cmbBarcodes.DataStore = lstBarcodeTypes; - cmbLanguages.DataStore = lstLanguageTypes; - cmbArchitectures.DataStore = lstArchitecturesTypes; - cmbFilesForNewDisc.DataStore = lstFilesForMedia; - cmbFilesForNewDisk.DataStore = lstFilesForMedia; - - FillBarcodeCombo(); - FillLanguagesCombo(); - FillArchitecturesCombo(); - FillFilesCombos(); - - txtDeveloper.ToolTip = "Who developed the application."; - txtPublisher.ToolTip = "Who published the application."; - txtAuthor.ToolTip = "Author of the audiovisual media."; - txtPerformer.ToolTip = "Performer of the audiovisual media."; - txtName.ToolTip = "Application name."; - txtVersion.ToolTip = "Application version."; - txtPartNumber.ToolTip = "Part number of the application distribution."; - txtSerialNumber.ToolTip = - "Serial number of the application distribution. Not to be confused with serial number required to install."; + txtDeveloper.Text = ""; + txtPublisher.Text = ""; + txtAuthor.Text = ""; + txtPerformer.Text = ""; + txtName.Text = ""; + txtVersion.Text = ""; + chkKnownReleaseType.Checked = false; + cldReleaseDate.Value = DateTime.UtcNow; + chkReleaseDate.Checked = false; + txtPartNumber.Text = ""; + txtSerialNumber.Text = ""; + txtNewKeyword.Text = ""; + txtNewBarcode.Text = ""; + txtNewCategory.Text = ""; + txtNewSubcategory.Text = ""; + txtNewOsName.Text = ""; + txtNewOsVersion.Text = ""; FillFields(); } @@ -330,7 +347,7 @@ namespace CICMMetadataEditor */ } - public void FillFields() + void FillFields() { if(metadata == null) return;