Browse Source

Fixed CodeDOM output bug which prevented the forms desinger from working.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@268 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 20 years ago
parent
commit
1738db8864
  1. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/NRefactoryDesignerLoader.cs
  2. 5
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/TypeResolutionService.cs
  3. 4
      src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/NRefactoryDesignerLoader.cs

@ -101,8 +101,8 @@ namespace ICSharpCode.FormDesigner @@ -101,8 +101,8 @@ namespace ICSharpCode.FormDesigner
CodeDOMVisitor visitor = new CodeDOMVisitor();
visitor.Visit(p.CompilationUnit, null);
// // output generated CodeDOM to the console :
// provider.GenerateCodeFromCompileUnit(visitor.codeCompileUnit, Console.Out, null);
// output generated CodeDOM to the console :
provider.GenerateCodeFromCompileUnit(visitor.codeCompileUnit, Console.Out, null);
return visitor.codeCompileUnit;
}

5
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/TypeResolutionService.cs

@ -52,6 +52,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -52,6 +52,7 @@ namespace ICSharpCode.FormDesigner.Services
if (name == null || name.Length == 0) {
return null;
}
try {
Assembly lastAssembly = null;
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) {
Type t = asm.GetType(name, throwOnError);
@ -87,6 +88,10 @@ namespace ICSharpCode.FormDesigner.Services @@ -87,6 +88,10 @@ namespace ICSharpCode.FormDesigner.Services
}
return type;
} catch (Exception e) {
Console.WriteLine(e);
}
return null;
}
public void ReferenceAssembly(AssemblyName name)

4
src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs

@ -206,8 +206,8 @@ namespace ICSharpCode.NRefactory.Parser @@ -206,8 +206,8 @@ namespace ICSharpCode.NRefactory.Parser
codeTypeDeclaration.IsStruct = typeDeclaration.Type == Types.Struct;
if (typeDeclaration.BaseTypes != null) {
foreach (object o in typeDeclaration.BaseTypes) {
codeTypeDeclaration.BaseTypes.Add(new CodeTypeReference(o.ToString()));
foreach (TypeReference typeRef in typeDeclaration.BaseTypes) {
codeTypeDeclaration.BaseTypes.Add(new CodeTypeReference(typeRef.Type));
}
}

Loading…
Cancel
Save