Browse Source

Fixed #365.

pull/469/merge
Lex Li 11 years ago committed by Daniel Grunwald
parent
commit
db1d106379
  1. 7
      ILSpy.BamlDecompiler/CecilTypeResolver.cs
  2. 3
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs
  3. 5
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

7
ILSpy.BamlDecompiler/CecilTypeResolver.cs

@ -39,12 +39,13 @@ namespace ILSpy.BamlDecompiler @@ -39,12 +39,13 @@ namespace ILSpy.BamlDecompiler
public IType GetTypeByAssemblyQualifiedName(string name)
{
int comma = name.IndexOf(',');
int bracket = name.LastIndexOf(']');
int comma = bracket > -1 ? name.IndexOf(',', bracket) : name.IndexOf(',');
if (comma == -1)
throw new ArgumentException("invalid name");
string fullName = name.Substring(0, comma);
string fullName = bracket > -1 ? name.Substring(0, name.IndexOf('[')) : name.Substring(0, comma);
string assemblyName = name.Substring(comma + 1).Trim();
var type = thisAssembly.MainModule.GetType(fullName);

3
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs

@ -131,7 +131,8 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -131,7 +131,8 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
void ParseName(string assemblyQualifiedName, out string name, out string @namespace, out string assembly)
{
int commaSeparator = assemblyQualifiedName.IndexOf(", ");
int bracket = assemblyQualifiedName.LastIndexOf(']');
int commaSeparator = bracket > -1 ? assemblyQualifiedName.IndexOf(", ", bracket) : assemblyQualifiedName.IndexOf(", ");
assembly = "";
if (commaSeparator >= 0) {
assembly = assemblyQualifiedName.Substring(commaSeparator + 2);

5
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

@ -1316,7 +1316,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1316,7 +1316,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
{
reader.ReadInt16();
// Non serve aprire niente, è il default
// Non serve aprire niente, ?il default
}
static void ReadConstructorParametersStart()
@ -1588,7 +1588,8 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1588,7 +1588,8 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
string fullName = reader.ReadString();
assemblyId = (short)(assemblyId & 0xfff);
TypeDeclaration declaration;
int length = fullName.LastIndexOf('.');
int bracket = fullName.IndexOf('[');
int length = bracket > -1 ? fullName.LastIndexOf('.', bracket) : fullName.LastIndexOf('.');
if (length != -1)
{
string name = fullName.Substring(length + 1);

Loading…
Cancel
Save