Browse Source

Merge pull request #2895 from ElektroKill/fix/resx-writer-memorystream

Fix `ResXResourceWriter` support for `MemoryStream` resource element
pull/2934/head
Daniel Grunwald 2 years ago committed by GitHub
parent
commit
7eb13159f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      ICSharpCode.Decompiler/Util/ResXResourceWriter.cs

7
ICSharpCode.Decompiler/Util/ResXResourceWriter.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2018 Daniel Grunwald
// Copyright (c) 2018 Daniel Grunwald
// This file is based on the Mono implementation of ResXResourceWriter.
// It is modified to add support for "ResourceSerializedObject" values.
//
@ -263,6 +263,11 @@ namespace ICSharpCode.Decompiler.Util @@ -263,6 +263,11 @@ namespace ICSharpCode.Decompiler.Util
WriteBytes(name, value.GetType(), (byte[])value, comment);
return;
}
if (value is MemoryStream memoryStream)
{
WriteBytes(name, null, memoryStream.ToArray(), comment);
return;
}
if (value is ResourceSerializedObject rso)
{
var bytes = rso.GetBytes();

Loading…
Cancel
Save