void InitializeXaml() { typeFullNameToBamlFile = new Dictionary <string, BamlResourceProjectFile>(StringComparer.OrdinalIgnoreCase); foreach (var xamlFile in Files.OfType <BamlResourceProjectFile>()) { hasXamlClasses = true; if (!string.IsNullOrEmpty(xamlFile.TypeFullName) && !xamlFile.IsSatelliteFile) { typeFullNameToBamlFile[xamlFile.TypeFullName] = xamlFile; } } if (hasXamlClasses) { ExtraAssemblyReferences.Add("WindowsBase"); ExtraAssemblyReferences.Add("PresentationCore"); ExtraAssemblyReferences.Add("PresentationFramework"); if (!Options.Module.IsClr1x && !Options.Module.IsClr20) { ExtraAssemblyReferences.Add("System.Xaml"); } } if (hasXamlClasses || ReferencesWPFClasses()) { ProjectTypeGuids.Add(new Guid("60DC8134-EBA5-43B8-BCC9-BB4BC16C2548")); if (Options.Decompiler.GenericGuid == DecompilerConstants.LANGUAGE_VISUALBASIC) { ProjectTypeGuids.Add(new Guid("F184B08F-C81C-45F6-A57F-5ABD9991F28F")); } else if (Options.Decompiler.GenericGuid == DecompilerConstants.LANGUAGE_CSHARP) { ProjectTypeGuids.Add(new Guid("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC")); } } }
public void OnWrite() { string asmName = !(Options.Module.Assembly is null) && Options.Module.IsManifestModule ? Options.Module.Assembly.Name : null; foreach (var bamlFile in Files.OfType <BamlResourceProjectFile>()) { foreach (var asmRef in bamlFile.AssemblyReferences) { if (!(asmName is null) && !StringComparer.Ordinal.Equals(asmName, asmRef.Name)) { ExtraAssemblyReferences.Add(asmRef.Name); } } } }