private void ChangeFile(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { try { Packages.PackedFileDescriptor pfd = null; if (lblist.SelectedIndex >= 0) { pfd = (Packages.PackedFileDescriptor)lblist.Items[lblist.SelectedIndex]; } else { pfd = new Packages.PackedFileDescriptor(); } pfd.Group = Convert.ToUInt32(this.tbgroup.Text, 16); pfd.Instance = Convert.ToUInt32(this.tbinstance.Text, 16); pfd.SubType = Convert.ToUInt32(this.tbsubtype.Text, 16); pfd.Type = Convert.ToUInt32(this.tbtype.Text, 16); if (lblist.SelectedIndex >= 0) { lblist.Items[lblist.SelectedIndex] = pfd; try { RefFileItem rfi = (RefFileItem)pfd; rfi.Skin = null; } catch {} } else { lblist.Items.Add(pfd); } } catch (Exception ex) { Helper.ExceptionMessage(Localization.Manager.GetString("errconvert"), ex); } }
/// <summary> /// Unserializes a BinaryStream into the Attributes of this Instance /// </summary> /// <param name="reader">The Stream that contains the FileData</param> protected override void Unserialize(System.IO.BinaryReader reader) { id = reader.ReadUInt32(); type = (Data.MetaData.IndexTypes)reader.ReadUInt32(); items = new Interfaces.Files.IPackedFileDescriptor[reader.ReadUInt32()]; for (int i = 0; i < items.Length; i++) { RefFileItem pfd = new RefFileItem(this); pfd.Type = reader.ReadUInt32(); pfd.Group = reader.ReadUInt32(); pfd.Instance = reader.ReadUInt32(); if (type == Data.MetaData.IndexTypes.ptLongFileIndex) { pfd.SubType = reader.ReadUInt32(); } /*Interfaces.Files.IPackedFileDescriptor ppfd = Package.FindFile(pfd.Type, pfd.SubType, pfd.Group, pfd.Instance); * if (ppfd!=null) items[i]=ppfd; * else*/items[i] = pfd; } }