From 6bee31a6b64371aabbe859e1d601823e13406b8f Mon Sep 17 00:00:00 2001 From: alcexhim Date: Thu, 11 Dec 2014 10:29:34 -0500 Subject: [PATCH] Update DataFormat/ObjectModel properties details when file properties dialog is shown --- .../Internal/FilePropertiesDialogImpl.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Dialogs/FileSystem/Internal/FilePropertiesDialogImpl.cs b/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Dialogs/FileSystem/Internal/FilePropertiesDialogImpl.cs index ef9dd93f..946a494f 100644 --- a/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Dialogs/FileSystem/Internal/FilePropertiesDialogImpl.cs +++ b/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Dialogs/FileSystem/Internal/FilePropertiesDialogImpl.cs @@ -36,11 +36,27 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs.FileSystem.Internal sc.Enabled = true; sc.Visible = true; + cmdGeneralInformationDataFormatChange.Enabled = false; IFileSystemObject fso = mvarSelectedObjects[0]; if (fso is File) { File file = (fso as File); txtFileName.Text = file.Name; + + Accessors.MemoryAccessor ma = new Accessors.MemoryAccessor(file.GetDataAsByteArray()); + DataFormatReference[] dfrs = UniversalEditor.Common.Reflection.GetAvailableDataFormats(ma); + if (dfrs.Length > 0) + { + DataFormatReference dfr = dfrs[0]; + txtGeneralInformationDataFormat.Text = dfr.Title; + + ObjectModelReference[] omrs = UniversalEditor.Common.Reflection.GetAvailableObjectModels(dfr); + if (omrs.Length > 0) + { + txtGeneralInformationObjectModel.Text = omrs[0].Title; + cmdGeneralInformationDataFormatChange.Enabled = true; + } + } txtGeneralInformationSize.Text = PrettyPrintFileSize(file.Size); } else if (fso is Folder)