diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj b/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj
index 1fe7b06954..e508de3598 100644
--- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj
+++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj
@@ -1,13 +1,13 @@
-
- $(PrepareForRunDependsOn);MyPostBuildTarget
-
-
-
-
-
-
-
-
-
+
+ $(PrepareForRunDependsOn);MyPostBuildTarget
+
+
+
+
+
+
+
+
+
diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs
index e2e4d334be..6b15d670c8 100644
--- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs
+++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs
@@ -165,7 +165,7 @@ namespace Grunwald.BooBinding.CodeCompletion
c.Attributes = DefaultAttribute.EmptyAttributeList;
} else {
foreach (AST.Attribute a in node.Attributes) {
- c.Attributes.Add(new DefaultAttribute(a.Name));
+ c.Attributes.Add(new DefaultAttribute(new AttributeReturnType(a.Name)));
}
}
c.Documentation = node.Documentation;
diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs
index cf52600e0e..588500d9d1 100644
--- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs
+++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs
@@ -40,7 +40,7 @@ namespace VBNetBinding
DefaultClass c = new DefaultClass(cu, ns + ".MyProject");
c.ClassType = ClassType.Module;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Partial | ModifierEnum.Sealed | ModifierEnum.Synthetic;
- c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
+ c.Attributes.Add(new DefaultAttribute(CreateTypeRef(cu, "Microsoft.VisualBasic.HideModuleNameAttribute")));
// we need to use GetClassReturnType instead of DefaultReturnType because we need
// a reference to the compound class.
@@ -71,22 +71,22 @@ namespace VBNetBinding
DefaultClass c = new DefaultClass(cu, ns + ".MyApplication");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed | ModifierEnum.Partial | ModifierEnum.Synthetic;
- c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
+ c.Attributes.Add(new DefaultAttribute(CreateTypeRef(cu, "Microsoft.VisualBasic.HideModuleNameAttribute")));
switch (project.OutputType) {
case OutputType.WinExe:
- c.BaseTypes.Add(CreateBaseType(cu, "Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase"));
+ c.BaseTypes.Add(CreateTypeRef(cu, "Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase"));
break;
case OutputType.Exe:
- c.BaseTypes.Add(CreateBaseType(cu, "Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase"));
+ c.BaseTypes.Add(CreateTypeRef(cu, "Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase"));
break;
default:
- c.BaseTypes.Add(CreateBaseType(cu, "Microsoft.VisualBasic.ApplicationServices.ApplicationBase"));
+ c.BaseTypes.Add(CreateTypeRef(cu, "Microsoft.VisualBasic.ApplicationServices.ApplicationBase"));
break;
}
return c;
}
- static IReturnType CreateBaseType(ICompilationUnit cu, string fullName)
+ static IReturnType CreateTypeRef(ICompilationUnit cu, string fullName)
{
return new GetClassReturnType(cu.ProjectContent, fullName, 0);
}
@@ -96,8 +96,8 @@ namespace VBNetBinding
DefaultClass c = new DefaultClass(cu, ns + ".MyComputer");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed | ModifierEnum.Partial | ModifierEnum.Synthetic;
- c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
- c.BaseTypes.Add(CreateBaseType(cu, "Microsoft.VisualBasic.Devices.Computer"));
+ c.Attributes.Add(new DefaultAttribute(CreateTypeRef(cu, "Microsoft.VisualBasic.HideModuleNameAttribute")));
+ c.BaseTypes.Add(CreateTypeRef(cu, "Microsoft.VisualBasic.Devices.Computer"));
return c;
}
@@ -106,7 +106,7 @@ namespace VBNetBinding
DefaultClass c = new MyFormsClass(cu, ns + ".MyForms");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed | ModifierEnum.Synthetic;
- c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
+ c.Attributes.Add(new DefaultAttribute(CreateTypeRef(cu, "Microsoft.VisualBasic.HideModuleNameAttribute")));
return c;
}
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/PostBuildEvent.proj b/src/AddIns/BackendBindings/WixBinding/Project/PostBuildEvent.proj
deleted file mode 100644
index 06ca69151d..0000000000
--- a/src/AddIns/BackendBindings/WixBinding/Project/PostBuildEvent.proj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- $(PrepareForRunDependsOn);MyPostBuildTarget
-
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
index 937947ee83..3904f5b4d7 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
+++ b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
@@ -6,13 +6,12 @@
-
+
+
-
-
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj
index 621d4dae5f..9548193430 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj
+++ b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj
@@ -221,7 +221,6 @@
ICSharpCode.TextEditor
False
-
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}
FormsDesigner
@@ -249,11 +248,6 @@
ICSharpCode.SharpDevelop.Dom
False
-
- {6B717BD1-CD5E-498C-A42E-9E6A4584DC48}
- XmlEditor
- False
-
{8035765F-D51F-4A0C-A746-2FD100E19419}
@@ -261,6 +255,12 @@
False
+
+
+ {6B717BD1-CD5E-498C-A42E-9E6A4584DC48}
+ XmlEditor
+ False
+
+
-
\ No newline at end of file
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/Configuration/AssemblyInfo.cs b/src/AddIns/BackendBindings/XamlBinding/Project/Configuration/AssemblyInfo.cs
new file mode 100644
index 0000000000..c2fa172629
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/Configuration/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System.Reflection;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle("XamlBinding")]
+[assembly: AssemblyDescription("Provides XAML integration in code-completion")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlClassReturnType.cs b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlClassReturnType.cs
new file mode 100644
index 0000000000..1cfc23e876
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlClassReturnType.cs
@@ -0,0 +1,42 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using ICSharpCode.SharpDevelop.Dom;
+
+namespace XamlBinding
+{
+ ///
+ /// Description of XamlClassReturnType.
+ ///
+ public class XamlClassReturnType : ProxyReturnType
+ {
+ XamlCompilationUnit compilationUnit;
+ string xmlNamespace;
+ string className;
+
+ public XamlClassReturnType(XamlCompilationUnit compilationUnit, string xmlNamespace, string className)
+ {
+ if (compilationUnit == null)
+ throw new ArgumentNullException("compilationUnit");
+
+ this.compilationUnit = compilationUnit;
+ this.xmlNamespace = xmlNamespace ?? "";
+ this.className = className ?? "";
+ }
+
+ public override IReturnType BaseType {
+ get {
+ return compilationUnit.FindType(xmlNamespace, className);
+ }
+ }
+
+ public override string Name {
+ get { return className; }
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs
new file mode 100644
index 0000000000..96e7f1c4ec
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs
@@ -0,0 +1,77 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using ICSharpCode.SharpDevelop.Dom;
+
+namespace XamlBinding
+{
+ ///
+ /// Description of XamlCompilationUnit.
+ ///
+ public class XamlCompilationUnit : DefaultCompilationUnit
+ {
+ public XamlCompilationUnit(IProjectContent projectContent) : base(projectContent)
+ {
+ }
+
+ public IReturnType CreateType(string xmlNamespace, string className)
+ {
+ if (xmlNamespace.StartsWith("clr-namespace:")) {
+ return CreateClrNamespaceType(xmlNamespace, className);
+ } else {
+ return new XamlClassReturnType(this, xmlNamespace, className);
+ }
+ }
+
+ IReturnType CreateClrNamespaceType(string xmlNamespace, string className)
+ {
+ string namespaceName = xmlNamespace.Substring("clr-namespace:".Length);
+ int pos = namespaceName.IndexOf(';');
+ if (pos >= 0) {
+ // we expect that the target type is also a reference of the project, so we
+ // can ignore the assembly part after the ;
+ namespaceName = namespaceName.Substring(0, pos);
+ }
+ return new GetClassReturnType(this.ProjectContent, namespaceName + "." + className, 0);
+ }
+
+ public IReturnType FindType(string xmlNamespace, string className)
+ {
+ if (xmlNamespace.StartsWith("clr-namespace:")) {
+ return CreateClrNamespaceType(xmlNamespace, className);
+ } else {
+ IReturnType type = FindTypeInAssembly(this.ProjectContent, xmlNamespace, className);
+ if (type != null)
+ return type;
+ foreach (IProjectContent p in this.ProjectContent.ReferencedContents) {
+ type = FindTypeInAssembly(this.ProjectContent, xmlNamespace, className);
+ if (type != null)
+ return type;
+ }
+ return null;
+ }
+ }
+
+ static IReturnType FindTypeInAssembly(IProjectContent projectContent, string xmlNamespace, string className)
+ {
+ foreach (IAttribute att in projectContent.GetAssemblyAttributes()) {
+ if (att.PositionalArguments.Count == 2
+ && att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute")
+ {
+ string namespaceName = att.PositionalArguments[1] as string;
+ if (xmlNamespace.Equals(att.PositionalArguments[0]) && namespaceName != null) {
+ IClass c = projectContent.GetClass(namespaceName + "." + className, 0, LanguageProperties.CSharp, false);
+ if (c != null)
+ return c.DefaultReturnType;
+ }
+ }
+ }
+ return null;
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlParser.cs b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlParser.cs
new file mode 100644
index 0000000000..a2d82d66a5
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlParser.cs
@@ -0,0 +1,130 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Xml;
+using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Dom;
+
+namespace XamlBinding
+{
+ ///
+ /// Parses xaml files to partial classes for the Dom.
+ ///
+ public class XamlParser : IParser
+ {
+ string[] lexerTags;
+
+ public string[] LexerTags {
+ get {
+ return lexerTags;
+ }
+ set {
+ lexerTags = value;
+ }
+ }
+
+ public LanguageProperties Language {
+ get {
+ return LanguageProperties.CSharp;
+ }
+ }
+
+ public bool CanParse(string fileName)
+ {
+ return Path.GetExtension(fileName).Equals(".xaml", StringComparison.OrdinalIgnoreCase);
+ }
+
+ public bool CanParse(ICSharpCode.SharpDevelop.Project.IProject project)
+ {
+ return false;
+ }
+
+ const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml";
+
+ public ICompilationUnit Parse(IProjectContent projectContent, string fileName, string fileContent)
+ {
+ XamlCompilationUnit cu = new XamlCompilationUnit(projectContent);
+ try {
+ using (XmlTextReader r = new XmlTextReader(new StringReader(fileContent))) {
+ r.Read();
+ r.MoveToContent();
+ DomRegion classStart = new DomRegion(r.LineNumber, r.LinePosition);
+ string className = r.GetAttribute("Class", XamlNamespace);
+ if (string.IsNullOrEmpty(className)) {
+ LoggingService.Debug("XamlParser: returning empty cu because root element has no Class attribute");
+ } else {
+ DefaultClass c = new DefaultClass(cu, className);
+ c.Modifiers = ModifierEnum.Partial;
+ c.Region = classStart;
+ c.BaseTypes.Add(TypeFromXmlNode(cu, r));
+ cu.Classes.Add(c);
+
+ DefaultMethod initializeComponent = new DefaultMethod(
+ "InitializeComponent",
+ projectContent.SystemTypes.Void,
+ ModifierEnum.Public | ModifierEnum.Synthetic,
+ classStart, DomRegion.Empty,
+ c);
+ c.Methods.Add(initializeComponent);
+
+ ParseXamlElement(cu, c, r);
+ if (r.NodeType == XmlNodeType.EndElement) {
+ r.Read();
+ c.Region = new DomRegion(classStart.BeginLine, classStart.BeginColumn, r.LineNumber, r.LinePosition);
+ }
+ }
+ }
+ } catch (XmlException ex) {
+ LoggingService.Debug("XamlParser exception: " + ex.ToString());
+ cu.ErrorsDuringCompile = true;
+ }
+ return cu;
+ }
+
+ IReturnType TypeFromXmlNode(XamlCompilationUnit cu, XmlReader r)
+ {
+ return cu.CreateType(r.NamespaceURI, r.Name);
+ }
+
+ void ParseXamlElement(XamlCompilationUnit cu, DefaultClass c, XmlTextReader r)
+ {
+ Debug.Assert(r.NodeType == XmlNodeType.Element);
+ string name = r.GetAttribute("Name", XamlNamespace) ?? r.GetAttribute("Name");
+ if (!string.IsNullOrEmpty(name)) {
+ DefaultField field = new DefaultField(
+ TypeFromXmlNode(cu, r),
+ name,
+ ModifierEnum.Internal,
+ new DomRegion(r.LineNumber, r.LinePosition),
+ c);
+ c.Fields.Add(field);
+ }
+
+ if (r.IsEmptyElement)
+ return;
+ do {
+ r.Read();
+ if (r.NodeType == XmlNodeType.Element) {
+ ParseXamlElement(cu, c, r);
+ }
+ } while (r.NodeType != XmlNodeType.EndElement);
+ }
+
+ public IExpressionFinder CreateExpressionFinder(string fileName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IResolver CreateResolver()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.addin b/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.addin
new file mode 100644
index 0000000000..bab5b263cc
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.addin
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.csproj b/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.csproj
new file mode 100644
index 0000000000..3c1ff599df
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/Project/XamlBinding.csproj
@@ -0,0 +1,79 @@
+
+
+ {7C96B65D-28A5-4F28-A35B-8D83CE831EE8}
+ Debug
+ AnyCPU
+ Library
+ XamlBinding
+ XamlBinding
+ ..\..\..\..\..\AddIns\AddIns\BackendBindings\XamlBinding
+ False
+ False
+ 4
+ false
+
+
+ true
+ Full
+ True
+ DEBUG;TRACE
+ False
+
+
+ False
+ None
+ False
+ TRACE
+
+
+ False
+ Auto
+ 4194304
+ AnyCPU
+ 4096
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+ Configuration\GlobalAssemblyInfo.cs
+
+
+
+
+
+
+ {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}
+ ICSharpCode.TextEditor
+ False
+
+
+ {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}
+ NRefactory
+ False
+
+
+ {2748AD25-9C63-4E12-877B-4DCE96FBED54}
+ ICSharpCode.SharpDevelop
+ False
+
+
+ {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}
+ ICSharpCode.Core
+ False
+
+
+ {924EE450-603D-49C1-A8E5-4AFAA31CE6F3}
+ ICSharpCode.SharpDevelop.Dom
+ False
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/PostBuildEvent.proj b/src/AddIns/DisplayBindings/FormsDesigner/Project/PostBuildEvent.proj
index c1acc58a95..6fdd106a55 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/PostBuildEvent.proj
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/PostBuildEvent.proj
@@ -1,11 +1,13 @@
-
- $(PrepareForRunDependsOn);MyPostBuildTarget
-
-
-
-
-
-
-
+
+ $(PrepareForRunDependsOn);MyPostBuildTarget
+
+
+
+
+
+
+
+
+
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs
index 13a693a0aa..1bf594584b 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs
@@ -101,11 +101,15 @@ namespace ICSharpCode.FormsDesigner.Gui
goto isDesignComponent;
}
foreach (IAttribute attr in subClass.Attributes) {
- if (attr.Name == "DesignTimeVisibleAttribute"
- || attr.Name == "System.ComponentModel.DesignTimeVisibleAttribute")
+ if (attr.AttributeType.FullyQualifiedName == "System.ComponentModel.DesignTimeVisibleAttribute")
{
- // TODO: Check value of attribute (make IAttribute store at least simple values like bool's and typeof's)
- goto isDesignComponent;
+ if (attr.PositionalArguments.Count == 1 && attr.PositionalArguments[0] is bool) {
+ if ((bool)attr.PositionalArguments[0]) {
+ goto isDesignComponent;
+ }
+ } else {
+ goto isDesignComponent;
+ }
}
}
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/PostBuildEvent.proj b/src/AddIns/DisplayBindings/XmlEditor/Project/PostBuildEvent.proj
new file mode 100644
index 0000000000..656932139c
--- /dev/null
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/PostBuildEvent.proj
@@ -0,0 +1,13 @@
+
+
+ $(PrepareForRunDependsOn);MyPostBuildTarget
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
index af1cff1745..1c8204c614 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
@@ -25,14 +25,14 @@
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj
index f6b9af441b..6d4bb856e5 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj
@@ -106,8 +106,9 @@
+
- Always
+ Never
@@ -167,4 +168,5 @@
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
index 4a8e7832c3..1310ec7033 100644
--- a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
+++ b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
@@ -5,12 +5,10 @@
-
+
-
-
diff --git a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj
index ecd378e215..2d65ee098e 100644
--- a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj
+++ b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj
@@ -99,7 +99,6 @@
ICSharpCode.TextEditor
False
-
{1F261725-6318-4434-A1B1-6C70CE4CD324}
UnitTesting
@@ -112,5 +111,4 @@
-
\ No newline at end of file
diff --git a/src/AddIns/Misc/CodeCoverage/Project/PostBuildEvent.proj b/src/AddIns/Misc/CodeCoverage/Project/PostBuildEvent.proj
deleted file mode 100644
index 84236543e4..0000000000
--- a/src/AddIns/Misc/CodeCoverage/Project/PostBuildEvent.proj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- $(PrepareForRunDependsOn);MyPostBuildTarget
-
-
-
-
-
-
diff --git a/src/AddIns/Misc/UnitTesting/PostBuildEvent.proj b/src/AddIns/Misc/UnitTesting/PostBuildEvent.proj
new file mode 100644
index 0000000000..656932139c
--- /dev/null
+++ b/src/AddIns/Misc/UnitTesting/PostBuildEvent.proj
@@ -0,0 +1,13 @@
+
+
+ $(PrepareForRunDependsOn);MyPostBuildTarget
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AddIns/Misc/UnitTesting/Src/TestClass.cs b/src/AddIns/Misc/UnitTesting/Src/TestClass.cs
index 74913b0c48..12629fdfdd 100644
--- a/src/AddIns/Misc/UnitTesting/Src/TestClass.cs
+++ b/src/AddIns/Misc/UnitTesting/Src/TestClass.cs
@@ -53,7 +53,7 @@ namespace ICSharpCode.UnitTesting
if (nameComparer != null) {
TestAttributeName testAttributeName = new TestAttributeName("TestFixture", nameComparer);
foreach (IAttribute attribute in c.Attributes) {
- if (testAttributeName.IsEqual(attribute.Name)) {
+ if (testAttributeName.IsEqual(attribute.AttributeType.FullyQualifiedName)) {
return true;
}
}
diff --git a/src/AddIns/Misc/UnitTesting/Src/TestMethod.cs b/src/AddIns/Misc/UnitTesting/Src/TestMethod.cs
index ab41945969..f2c8e191c1 100644
--- a/src/AddIns/Misc/UnitTesting/Src/TestMethod.cs
+++ b/src/AddIns/Misc/UnitTesting/Src/TestMethod.cs
@@ -114,7 +114,7 @@ namespace ICSharpCode.UnitTesting
if (nameComparer != null) {
TestAttributeName testAttribute = new TestAttributeName("Test", nameComparer);
foreach (IAttribute attribute in member.Attributes) {
- if (testAttribute.IsEqual(attribute.Name)) {
+ if (testAttribute.IsEqual(attribute.AttributeType.FullyQualifiedName)) {
IMethod method = (IMethod)member;
if (method.Parameters.Count == 0) {
return true;
diff --git a/src/AddIns/Misc/UnitTesting/UnitTesting.csproj b/src/AddIns/Misc/UnitTesting/UnitTesting.csproj
index fcc24f6311..cdbdbe55b1 100644
--- a/src/AddIns/Misc/UnitTesting/UnitTesting.csproj
+++ b/src/AddIns/Misc/UnitTesting/UnitTesting.csproj
@@ -54,8 +54,9 @@
+
- Always
+ Never
@@ -123,4 +124,5 @@
+
\ No newline at end of file
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
index 44ffd84c05..9e7e278e8c 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
@@ -275,12 +275,6 @@ namespace ICSharpCode.TextEditor
Caret.Position = textView.GetLogicalColumn(Caret.Line, Caret.DesiredColumn + (int)(VirtualTop.X * textView.WideSpaceWidth));
}
- [Obsolete("Use the parameterless version")]
- public void SetCaretToDesiredColumn(int caretLine)
- {
- Caret.Position = textView.GetLogicalColumn(Caret.Line, Caret.DesiredColumn + (int)(VirtualTop.X * textView.WideSpaceWidth));
- }
-
public void OptionsChanged()
{
UpdateMatchingBracket();
diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
index c05c1f24ee..1c6823a9f4 100644
--- a/src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
+++ b/src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
@@ -29,6 +29,7 @@ namespace ICSharpCode.Core
public object CreateObject(string className)
{
+ LoadDependencies();
foreach (Runtime runtime in runtimes) {
object o = runtime.CreateInstance(className);
if (o != null) {
@@ -44,6 +45,37 @@ namespace ICSharpCode.Core
return null;
}
+ public void LoadRuntimeAssemblies()
+ {
+ LoadDependencies();
+ foreach (Runtime runtime in runtimes) {
+ runtime.Load();
+ }
+ }
+
+ bool dependenciesLoaded;
+
+ void LoadDependencies()
+ {
+ if (!dependenciesLoaded) {
+ dependenciesLoaded = true;
+ foreach (AddInReference r in manifest.Dependencies) {
+ if (r.RequirePreload) {
+ bool found = false;
+ foreach (AddIn addIn in AddInTree.AddIns) {
+ if (addIn.Manifest.Identities.ContainsKey(r.Name)) {
+ found = true;
+ addIn.LoadRuntimeAssemblies();
+ }
+ }
+ if (!found) {
+ throw new AddInLoadException("Cannot load run-time dependency for " + r.ToString());
+ }
+ }
+ }
+ }
+ }
+
public override string ToString()
{
return "[AddIn: " + Name + "]";
diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs
index 3cb4e668b7..1a056b42c4 100644
--- a/src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs
+++ b/src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs
@@ -20,6 +20,7 @@ namespace ICSharpCode.Core
string name;
Version minimumVersion;
Version maximumVersion;
+ bool requirePreload;
public Version MinimumVersion {
get {
@@ -33,6 +34,11 @@ namespace ICSharpCode.Core
}
}
+ public bool RequirePreload {
+ get { return requirePreload; }
+ }
+
+
public string Name {
get {
return name;
@@ -92,16 +98,8 @@ namespace ICSharpCode.Core
} else {
reference.maximumVersion = reference.minimumVersion = ParseVersion(version, hintPath);
}
-
- if (reference.Name == "SharpDevelop") {
- // HACK: SD 2.1 AddIns work with SharpDevelop 2.2
- // Because some 2.1 AddIns restrict themselves to SD 2.1, we extend the
- // supported SD range.
- if (reference.maximumVersion == new Version("2.1")) {
- reference.maximumVersion = new Version("2.2");
- }
- }
}
+ reference.requirePreload = string.Equals(properties["requirePreload"], "true", StringComparison.OrdinalIgnoreCase);
return reference;
}
diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
index ab9cdaf553..c88f21b3bb 100644
--- a/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
+++ b/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
@@ -47,46 +47,54 @@ namespace ICSharpCode.Core
}
}
- public Assembly LoadedAssembly {
- get {
- if (!isAssemblyLoaded) {
- LoggingService.Info("Loading addin " + assembly);
+ ///
+ /// Force loading the runtime assembly now.
+ ///
+ public void Load()
+ {
+ if (!isAssemblyLoaded) {
+ LoggingService.Info("Loading addin " + assembly);
- isAssemblyLoaded = true;
+ isAssemblyLoaded = true;
- try {
- if (assembly[0] == ':') {
- loadedAssembly = System.Reflection.Assembly.Load(assembly.Substring(1));
- } else if (assembly[0] == '$') {
- int pos = assembly.IndexOf('/');
- if (pos < 0)
- throw new ApplicationException("Expected '/' in path beginning with '$'!");
- string referencedAddIn = assembly.Substring(1, pos - 1);
- foreach (AddIn addIn in AddInTree.AddIns) {
- if (addIn.Enabled && addIn.Manifest.Identities.ContainsKey(referencedAddIn)) {
- string assemblyFile = Path.Combine(Path.GetDirectoryName(addIn.FileName),
- assembly.Substring(pos + 1));
- loadedAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
- break;
- }
- }
- if (loadedAssembly == null) {
- throw new FileNotFoundException("Could not find referenced AddIn " + referencedAddIn);
+ try {
+ if (assembly[0] == ':') {
+ loadedAssembly = System.Reflection.Assembly.Load(assembly.Substring(1));
+ } else if (assembly[0] == '$') {
+ int pos = assembly.IndexOf('/');
+ if (pos < 0)
+ throw new ApplicationException("Expected '/' in path beginning with '$'!");
+ string referencedAddIn = assembly.Substring(1, pos - 1);
+ foreach (AddIn addIn in AddInTree.AddIns) {
+ if (addIn.Enabled && addIn.Manifest.Identities.ContainsKey(referencedAddIn)) {
+ string assemblyFile = Path.Combine(Path.GetDirectoryName(addIn.FileName),
+ assembly.Substring(pos + 1));
+ loadedAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
+ break;
}
- } else {
- loadedAssembly = System.Reflection.Assembly.LoadFrom(Path.Combine(hintPath, assembly));
}
-
- #if DEBUG
- // preload assembly to provoke FileLoadException if dependencies are missing
- loadedAssembly.GetExportedTypes();
- #endif
- } catch (FileNotFoundException ex) {
- MessageService.ShowError("The addin '" + assembly + "' could not be loaded:\n" + ex.ToString());
- } catch (FileLoadException ex) {
- MessageService.ShowError("The addin '" + assembly + "' could not be loaded:\n" + ex.ToString());
+ if (loadedAssembly == null) {
+ throw new FileNotFoundException("Could not find referenced AddIn " + referencedAddIn);
+ }
+ } else {
+ loadedAssembly = System.Reflection.Assembly.LoadFrom(Path.Combine(hintPath, assembly));
}
+
+ #if DEBUG
+ // preload assembly to provoke FileLoadException if dependencies are missing
+ loadedAssembly.GetExportedTypes();
+ #endif
+ } catch (FileNotFoundException ex) {
+ MessageService.ShowError("The addin '" + assembly + "' could not be loaded:\n" + ex.ToString());
+ } catch (FileLoadException ex) {
+ MessageService.ShowError("The addin '" + assembly + "' could not be loaded:\n" + ex.ToString());
}
+ }
+ }
+
+ public Assembly LoadedAssembly {
+ get {
+ Load(); // load the assembly, if not already done
return loadedAssembly;
}
}
diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj
index 305f9f02eb..3b312fbf13 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj
+++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj
@@ -62,6 +62,7 @@
+
diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs
index 4a84570cf8..ce23e3204f 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs
+++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs
@@ -6,6 +6,7 @@
//
using System;
+using System.Collections;
using System.Collections.Generic;
using System.IO;
@@ -36,8 +37,13 @@ namespace ICSharpCode.SharpDevelop.Dom
static void AddAttributes(IProjectContent pc, IList list, CustomAttributeCollection attributes)
{
foreach (CustomAttribute att in attributes) {
- DefaultAttribute a = new DefaultAttribute(att.Constructor.DeclaringType.FullName);
- // TODO: add only attributes marked "important", and include attribute arguments
+ DefaultAttribute a = new DefaultAttribute(CreateType(pc, null, att.Constructor.DeclaringType));
+ foreach (object o in att.ConstructorParameters) {
+ a.PositionalArguments.Add(o);
+ }
+ foreach (DictionaryEntry entry in att.Properties) {
+ a.NamedArguments.Add(entry.Key.ToString(), entry.Value);
+ }
list.Add(a);
}
}
@@ -127,6 +133,7 @@ namespace ICSharpCode.SharpDevelop.Dom
AssemblyDefinition assembly, ProjectContentRegistry registry)
: base(fullName, fileName, referencedAssemblies, registry)
{
+ AddAttributes(this, this.AssemblyCompilationUnit.Attributes, assembly.CustomAttributes);
foreach (ModuleDefinition module in assembly.Modules) {
AddTypes(module.Types);
}
diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CtrlSpaceResolveHelper.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CtrlSpaceResolveHelper.cs
index 686b4e4d4b..4fb9034d17 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CtrlSpaceResolveHelper.cs
+++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CtrlSpaceResolveHelper.cs
@@ -152,12 +152,6 @@ namespace ICSharpCode.SharpDevelop.Dom
}
}
- [Obsolete()]
- public static ResolveResult GetResultFromDeclarationLine(IClass callingClass, IMethodOrProperty callingMember, int caretLine, int caretColumn, string expression)
- {
- return GetResultFromDeclarationLine(callingClass, callingMember, caretLine, caretColumn, new ExpressionResult(expression));
- }
-
public static ResolveResult GetResultFromDeclarationLine(IClass callingClass, IMethodOrProperty callingMember, int caretLine, int caretColumn, ExpressionResult expressionResult)
{
string expression = expressionResult.Expression;
diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/AttributeReturnType.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/AttributeReturnType.cs
new file mode 100644
index 0000000000..dcea853eb7
--- /dev/null
+++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/AttributeReturnType.cs
@@ -0,0 +1,32 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+
+namespace ICSharpCode.SharpDevelop.Dom
+{
+ ///
+ /// Description of AttributeReturnType.
+ ///
+ public class AttributeReturnType : ProxyReturnType
+ {
+ string name;
+
+ public AttributeReturnType(string name)
+ {
+ this.name = name;
+ }
+
+ public override string Name {
+ get { return name; }
+ }
+
+ public override IReturnType BaseType {
+ get { return null; }
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultAttribute.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultAttribute.cs
index 7af148071f..2aa73c933f 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultAttribute.cs
+++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultAttribute.cs
@@ -14,65 +14,45 @@ namespace ICSharpCode.SharpDevelop.Dom
{
public static readonly IList EmptyAttributeList = new List().AsReadOnly();
- string name;
- List positionalArguments;
- SortedList namedArguments;
+ IReturnType attributeType;
+ IList