From fca34904ecfc0367406c5edf93b662f5bdee7343 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Fri, 1 Mar 2024 18:07:45 +0000 Subject: [PATCH] [StructuredStorageExplorer] Hide the OLE Properties displays when switching to a stream that has no properties and when closing a file --- sources/Structured Storage Explorer/MainForm.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sources/Structured Storage Explorer/MainForm.cs b/sources/Structured Storage Explorer/MainForm.cs index ec278265..967f204b 100644 --- a/sources/Structured Storage Explorer/MainForm.cs +++ b/sources/Structured Storage Explorer/MainForm.cs @@ -90,6 +90,11 @@ private void CloseCurrentFile() propertyGrid1.SelectedObject = null; hexEditor.ByteProvider = null; + +#if OLE_PROPERTY + dgvUserDefinedProperties.DataSource = null; + dgvOLEProps.DataSource = null; +#endif } private bool canUpdate = false; @@ -424,6 +429,7 @@ private void treeView1_MouseUp(object sender, MouseEventArgs e) treeView1.SelectedNode = n; + // The tag property contains the underlying CFItem. CFItem target = (CFItem)n.Tag; @@ -435,6 +441,9 @@ private void treeView1_MouseUp(object sender, MouseEventArgs e) exportDataToolStripMenuItem.Enabled = true; #if OLE_PROPERTY + dgvUserDefinedProperties.DataSource = null; + dgvOLEProps.DataSource = null; + if (target.Name == "\u0005SummaryInformation" || target.Name == "\u0005DocumentSummaryInformation") { OLEPropertiesContainer c = ((CFStream)target).AsOLEPropertiesContainer(); @@ -496,12 +505,6 @@ private void treeView1_MouseUp(object sender, MouseEventArgs e) ds2.AcceptChanges(); dgvUserDefinedProperties.DataSource = ds2; } - - - } - else - { - dgvOLEProps.DataSource = null; } #endif }