diff --git a/Obsidian/Obsidian.csproj b/Obsidian/Obsidian.csproj index e5092fd..1c72f5a 100644 --- a/Obsidian/Obsidian.csproj +++ b/Obsidian/Obsidian.csproj @@ -1,4 +1,4 @@ - + WinExe @@ -14,8 +14,8 @@ - - + + diff --git a/Obsidian/Shared/WadFileTextPreview.razor b/Obsidian/Shared/WadFileTextPreview.razor index c357653..4c3238c 100644 --- a/Obsidian/Shared/WadFileTextPreview.razor +++ b/Obsidian/Shared/WadFileTextPreview.razor @@ -62,23 +62,16 @@ public async Task PreviewRitobin(Stream stream) { - using MemoryStream textStream = new(); - using (RitobinWriter writer = + using RitobinWriter writer = new( - textStream, this.Hashtable.BinObjects, this.Hashtable.BinClasses, this.Hashtable.BinProperties, - this.Hashtable.BinHashes - )) - { - writer.WritePropertyBin(new(stream)); - } + this.Hashtable.BinHashes, + this.Hashtable.Hashes + ); - textStream.Position = 0; - using StreamReader textReader = new(textStream); - - await this._codeEditor.SetValue(textReader.ReadToEnd()); + await this._codeEditor.SetValue(writer.WritePropertyBin(new(stream))); await MonacoEditorGlobal.SetModelLanguage(await this._codeEditor.GetModel(), "ritobin"); } }