Browse Source

TypeFinder in XamlDesigner Addin did not load the Referenced DLL's, so the Type finder could not find the Controls

-> For Example DocumentView in XamlDesigner Example Project did not find AvalonEdit Component!
pull/52/head
jkuehner 12 years ago
parent
commit
1a87bc5516
  1. 21
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs

21
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs

@ -21,6 +21,27 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -21,6 +21,27 @@ namespace ICSharpCode.WpfDesign.AddIn
MyTypeFinder f = new MyTypeFinder();
f.file = file;
f.ImportFrom(CreateWpfTypeFinder());
var pc = MyTypeFinder.GetProjectContent(file);
foreach (var referencedProjectContent in pc.ThreadSafeGetReferencedContents()) {
try{
string fileName = null;
if (referencedProjectContent is ParseProjectContent)
{
var prj = ((ParseProjectContent)referencedProjectContent).Project as AbstractProject;
if (prj != null)
fileName = prj.OutputAssemblyFullPath;
}
else if (referencedProjectContent is ReflectionProjectContent)
{
fileName = ((ReflectionProjectContent) referencedProjectContent).AssemblyLocation;
}
var assembly = Assembly.LoadFrom(fileName);
f.RegisterAssembly(assembly);
}
catch (Exception ex)
{}
}
return f;
}

Loading…
Cancel
Save