mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Fix namespaces being stripped from assembly imports
This commit is contained in:
@@ -39,15 +39,15 @@ public class Disassembler
|
|||||||
|
|
||||||
var propOffset = markupTypeSchema.InitializePropertiesOffset;
|
var propOffset = markupTypeSchema.InitializePropertiesOffset;
|
||||||
if (propOffset != uint.MaxValue)
|
if (propOffset != uint.MaxValue)
|
||||||
InsertLabel(propOffset, ExportDirective.GetInitializePropertiesLabel(labelPrefix));
|
InsertLabel(propOffset, ExportDirective.GetInitializePropertiesLabel(labelPrefix));
|
||||||
|
|
||||||
var loclOffset = markupTypeSchema.InitializeLocalsInputOffset;
|
var loclOffset = markupTypeSchema.InitializeLocalsInputOffset;
|
||||||
if (loclOffset != uint.MaxValue)
|
if (loclOffset != uint.MaxValue)
|
||||||
InsertLabel(loclOffset, ExportDirective.GetInitializeLocalsInputLabel(labelPrefix));
|
InsertLabel(loclOffset, ExportDirective.GetInitializeLocalsInputLabel(labelPrefix));
|
||||||
|
|
||||||
var contOffset = markupTypeSchema.InitializeContentOffset;
|
var contOffset = markupTypeSchema.InitializeContentOffset;
|
||||||
if (contOffset != uint.MaxValue)
|
if (contOffset != uint.MaxValue)
|
||||||
InsertLabel(contOffset, ExportDirective.GetInitializeContentLabel(labelPrefix));
|
InsertLabel(contOffset, ExportDirective.GetInitializeContentLabel(labelPrefix));
|
||||||
|
|
||||||
if (markupTypeSchema.InitialEvaluateOffsets != null)
|
if (markupTypeSchema.InitialEvaluateOffsets != null)
|
||||||
{
|
{
|
||||||
@@ -100,11 +100,14 @@ public class Disassembler
|
|||||||
var scheme = uri[..schemeLength];
|
var scheme = uri[..schemeLength];
|
||||||
if (scheme == "assembly")
|
if (scheme == "assembly")
|
||||||
{
|
{
|
||||||
// Assume the URI represents a C# namespace
|
// Assume 'host' is an assembly name and path represents a C# namespace
|
||||||
namespacePrefix = uri.Split('.', '/', '\\', '!')[^1];
|
var assemblyUriParts = uri.Split('/');
|
||||||
|
|
||||||
// Remove the extra assembly info
|
var importedNamespace = assemblyUriParts[^1];
|
||||||
uri = uri.Split(',')[0];
|
namespacePrefix = importedNamespace.Split('.', '/', '\\', '!')[^1];
|
||||||
|
|
||||||
|
System.Reflection.AssemblyName assemblyName = new(assemblyUriParts[^2]);
|
||||||
|
uri = $"{scheme}://{assemblyName.Name}/{importedNamespace}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user