From 3a9f30812a0f8a524fd1dd999909db52064818e2 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Mon, 30 Nov 2015 11:23:59 -0500 Subject: [PATCH] Start to work on WinHelp-specific part of BPlusFileSystem --- .../Help/Compiled/WinHelp/HLPDataFormat.cs | 41 +++++++++++++++++++ .../Help/Compiled/CompiledHelpObjectModel.cs | 18 ++++++++ .../UniversalEditor.Plugins.Microsoft.csproj | 2 + 3 files changed, 61 insertions(+) create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/Help/Compiled/WinHelp/HLPDataFormat.cs create mode 100644 CSharp/Plugins/UniversalEditor.Plugins.Microsoft/ObjectModels/Help/Compiled/CompiledHelpObjectModel.cs diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/Help/Compiled/WinHelp/HLPDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/Help/Compiled/WinHelp/HLPDataFormat.cs new file mode 100644 index 00000000..02a0b56a --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/Help/Compiled/WinHelp/HLPDataFormat.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using UniversalEditor.DataFormats.FileSystem.BPlus; +using UniversalEditor.ObjectModels.FileSystem; + +using UniversalEditor.ObjectModels.Help.Compiled; + +namespace UniversalEditor.DataFormats.Help.Compiled.WinHelp +{ + /// + /// The Windows Help (WinHelp) HLP data format. Much of the framework for reading these files is contained in BPlusFileSystemDataFormat, since the container file format + /// itself is remarkably generic (albeit unused, as far as I can tell, apart from WinHelp files), but WinHelp-specific stuff is here. + /// + public class HLPDataFormat : BPlusFileSystemDataFormat + { + protected override void BeforeLoadInternal(Stack objectModels) + { + base.BeforeLoadInternal(objectModels); + objectModels.Push(new FileSystemObjectModel()); + } + protected override void AfterLoadInternal(Stack objectModels) + { + base.AfterLoadInternal(objectModels); + + FileSystemObjectModel fsom = (objectModels.Pop() as FileSystemObjectModel); + CompiledHelpObjectModel help = (objectModels.Pop() as CompiledHelpObjectModel); + } + protected override void BeforeSaveInternal(Stack objectModels) + { + base.BeforeSaveInternal(objectModels); + + CompiledHelpObjectModel help = (objectModels.Pop() as CompiledHelpObjectModel); + FileSystemObjectModel fsom = new FileSystemObjectModel(); + + objectModels.Push(fsom); + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/ObjectModels/Help/Compiled/CompiledHelpObjectModel.cs b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/ObjectModels/Help/Compiled/CompiledHelpObjectModel.cs new file mode 100644 index 00000000..d6636760 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/ObjectModels/Help/Compiled/CompiledHelpObjectModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Help.Compiled +{ + public class CompiledHelpObjectModel : ObjectModel + { + public override void Clear() + { + } + + public override void CopyTo(ObjectModel where) + { + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/UniversalEditor.Plugins.Microsoft.csproj b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/UniversalEditor.Plugins.Microsoft.csproj index d2d686de..354d7ad6 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/UniversalEditor.Plugins.Microsoft.csproj +++ b/CSharp/Plugins/UniversalEditor.Plugins.Microsoft/UniversalEditor.Plugins.Microsoft.csproj @@ -60,6 +60,7 @@ + @@ -67,6 +68,7 @@ +