private void OpenResourceEntry(TreeNode node) { if (node == null) { return; } var resourceEntry = node.Tag as FileFormats.Archive.ResourceEntry; if (resourceEntry == null) { return; } var type = _Archive.ResourceTypes.SingleOrDefault(r => r.Id == resourceEntry.TypeId); if (type == default(FileFormats.Archive.ResourceType)) { throw new KeyNotFoundException(); } RemoveControl(); var viewer = ResourceViewerFactory.Create(type.Name, resourceEntry); ((Form)viewer).TopLevel = false; ((Form)viewer).FormBorderStyle = FormBorderStyle.None; ((Form)viewer).Dock = DockStyle.Fill; ((Form)viewer).Enabled = true; _SplitContainer.Panel2.Controls.Add(((Form)viewer)); viewer.LoadResourceEntry(resourceEntry, node.Text, _Archive.Endian); viewer.Show(); }
protected override void OnClosing(CancelEventArgs e) { ResourceViewerFactory.Dispose(); Properties.Settings.Default.Save(); base.OnClosing(e); }