Browse Source

Fixed code completion for project references.

Added support for AddIn dependencies and conflicts to ICSharpCode.Core.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@794 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
49040ea269
  1. 9
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 79
      data/schemas/AddIn.xsd
  3. 3
      data/templates/project/CSharp/SharpDevelopAddin.xpt
  4. 3
      data/templates/project/CSharp/SharpDevelopMacro.xpt
  5. 2
      doc/technotes/ConditionList.html
  6. 2
      doc/technotes/DoozerList.html
  7. 8
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin
  8. 7
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  9. 7
      src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin
  10. 7
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin
  11. 9
      src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin
  12. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/DesignerResourceService.cs
  13. 7
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
  14. 2
      src/AddIns/Misc/AddinScout/Project/Src/AddInScoutCommand.cs
  15. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
  16. 10
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin
  17. 7
      src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin
  18. 7
      src/AddIns/Misc/NAntAddIn/Project/NAnt.addin
  19. 3
      src/AddIns/Misc/NAntAddIn/Project/Src/Gui/NAntPadContent.cs
  20. 2
      src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs
  21. 7
      src/AddIns/Misc/StartPage/Project/StartPage.addin
  22. 7
      src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin
  23. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  24. 14
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs
  25. 18
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  26. 6
      src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs
  27. 2
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs
  28. 5
      src/Main/Core/Project/ICSharpCode.Core.csproj
  29. 41
      src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
  30. 149
      src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs
  31. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/AbstractCheckableMenuCommand.cs
  32. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/AbstractMenuCommand.cs
  33. 99
      src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs
  34. 62
      src/Main/Core/Project/Src/AddInTree/AddInTree.cs
  35. 4
      src/Main/Core/Project/Src/Services/PropertyService/Properties.cs
  36. 12
      src/Tools/BuildAddinDocumentation/BuildAddinDocumentation.sln

9
AddIns/ICSharpCode.SharpDevelop.addin

@ -1,9 +1,12 @@
<AddIn name = "SharpDevelop Core" <AddIn name = "SharpDevelop"
author = "Mike Krueger" author = "Mike Krueger"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "SharpDevelop core module" description = "SharpDevelop main module">
version = "1.0.0">
<Manifest>
<Identity name = "SharpDevelop" version = "@EntryAssemblyVersion"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly=":ICSharpCode.SharpDevelop"/> <Import assembly=":ICSharpCode.SharpDevelop"/>

79
data/schemas/AddIn.xsd

@ -2,28 +2,57 @@
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Ivo Kovacka (Kovacka) --> <!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Ivo Kovacka (Kovacka) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.icsharpcode.net/2005/addin" xmlns="http://www.icsharpcode.net/2005/addin"> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.icsharpcode.net/2005/addin" xmlns="http://www.icsharpcode.net/2005/addin">
<xs:complexType name="AddIn"> <xs:complexType name="AddIn">
<xs:choice maxOccurs="unbounded">
<xs:element ref="Path" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="Runtime" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
<xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="author" type="xs:string" use="required" /> <xs:attribute name="author" type="xs:string" use="required" />
<xs:attribute name="copyright" type="xs:string" use="required" /> <xs:attribute name="copyright" type="xs:string" use="optional" />
<xs:attribute name="url" type="xs:anyURI" use="required" /> <xs:attribute name="url" type="xs:anyURI" use="optional" />
<xs:attribute name="description" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" use="optional" />
<xs:attribute name="version" type="xs:string" use="required" /> <xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="Manifest">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Identity">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="Dependency" type="AddInReference"/>
<xs:element name="Conflict" type="AddInReference"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element ref="Path"/>
<xs:element name="Runtime">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Import" type="Import"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Include">
<xs:complexType>
<xs:attribute name="file" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType> </xs:complexType>
<xs:element name="AddIn" type="AddIn" /> <xs:element name="AddIn" type="AddIn" />
<xs:complexType name="AddInReference">
<xs:attribute name="addin" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:string" use="optional" />
</xs:complexType>
<xs:complexType name="Import"> <xs:complexType name="Import">
<xs:attribute name="assembly" type="xs:string" use="required" /> <xs:attribute name="assembly" type="xs:string" use="required" />
<xs:choice maxOccurs="unbounded">
<xs:element name="Doozer" type="CustomDoozerOrCondition" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="ConditionEvaluator" type="CustomDoozerOrCondition" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
</xs:complexType> </xs:complexType>
<xs:element name="Import" type="Import" /> <xs:complexType name="CustomDoozerOrCondition">
<xs:complexType name="Runtime"> <xs:attribute name="name" type="xs:string" use="required" />
<xs:sequence> <xs:attribute name="class" type="xs:string" use="required" />
<xs:element ref="Import" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType> </xs:complexType>
<xs:element name="Runtime" type="Runtime" />
<xs:complexType name="Path"> <xs:complexType name="Path">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="Condition" /> <xs:element ref="Condition" />
@ -77,8 +106,8 @@
<xs:element name="Condition" type="Condition"> <xs:element name="Condition" type="Condition">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
A Condition can disable or exclude items in the AddInTree. A Condition can disable or exclude items in the AddInTree.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:complexType name="ComplexCondition"> <xs:complexType name="ComplexCondition">
@ -118,8 +147,8 @@
<xs:element name="ComplexCondition" type="ComplexCondition"> <xs:element name="ComplexCondition" type="ComplexCondition">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
A Condition that combines multiple conditions with the operators And, Or and Not. A Condition that combines multiple conditions with the operators And, Or and Not.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:complexType name="ComplexConditionBody"> <xs:complexType name="ComplexConditionBody">
@ -137,22 +166,22 @@
<xs:attribute name="id" type="xs:string" use="required"> <xs:attribute name="id" type="xs:string" use="required">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
The name used to identify the codon in the AddInTree. The name used to identify the codon in the AddInTree.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="insertbefore" type="xs:string" use="optional"> <xs:attribute name="insertbefore" type="xs:string" use="optional">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
The id of another codon in the same path. This codon will be placed before the other codon. The id of another codon in the same path. This codon will be placed before the other codon.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="insertafter" type="xs:string" use="optional"> <xs:attribute name="insertafter" type="xs:string" use="optional">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
The id of another codon in the same path. This codon will be placed after the other codon. The id of another codon in the same path. This codon will be placed after the other codon.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
</xs:complexType> </xs:complexType>
@ -829,4 +858,4 @@
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
</xs:schema> </xs:schema>

3
data/templates/project/CSharp/SharpDevelopAddin.xpt

@ -38,8 +38,7 @@
author = "${USER}" author = "${USER}"
copyright = "GNU General Public License" copyright = "GNU General Public License"
url = "" url = ""
description = "TODO: Put description here" description = "TODO: Put description here">
version = "1.0.0">
<Runtime> <Runtime>
<Import assembly = "${ProjectName}.dll"/> <Import assembly = "${ProjectName}.dll"/>

3
data/templates/project/CSharp/SharpDevelopMacro.xpt

@ -38,8 +38,7 @@
author = "${USER}" author = "${USER}"
copyright = "GNU General Public License" copyright = "GNU General Public License"
url = "" url = ""
description = "TODO: Put description here" description = "TODO: Put description here">
version = "1.0.0">
<Runtime> <Runtime>
<Import assembly = "${ProjectName}.dll"/> <Import assembly = "${ProjectName}.dll"/>

2
doc/technotes/ConditionList.html

@ -5,7 +5,7 @@
</head><body> </head><body>
<h1>Condition List</h1> <h1>Condition List</h1>
<p class="notice">This file was generated by the tool 'BuildAddinDocumentation'. <p class="notice">This file was generated by the tool 'BuildAddinDocumentation'.
It is based on SharpDevelop 2.0.0.597.</p> It is based on SharpDevelop 2.0.0.783.</p>
<ul> <ul>
<li><a href="#ActiveContentExtension">ActiveContentExtension</a> <li><a href="#ActiveContentExtension">ActiveContentExtension</a>
<li><a href="#ActiveViewContentUntitled">ActiveViewContentUntitled</a> <li><a href="#ActiveViewContentUntitled">ActiveViewContentUntitled</a>

2
doc/technotes/DoozerList.html

@ -5,7 +5,7 @@
</head><body> </head><body>
<h1>Doozer List</h1> <h1>Doozer List</h1>
<p class="notice">This file was generated by the tool 'BuildAddinDocumentation'. <p class="notice">This file was generated by the tool 'BuildAddinDocumentation'.
It is based on SharpDevelop 2.0.0.597.</p> It is based on SharpDevelop 2.0.0.783.</p>
<ul> <ul>
<li><a href="#Class">Class</a> <li><a href="#Class">Class</a>
<li><a href="#CodeCompletionBinding">CodeCompletionBinding</a> <li><a href="#CodeCompletionBinding">CodeCompletionBinding</a>

8
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin

@ -2,8 +2,12 @@
author = "Daniel Grunwald" author = "Daniel Grunwald"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Binding for the Boo language" description = "Binding for the Boo language">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.BooBinding"/>
<Dependency addin = "ICSharpCode.FormDesigner"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "../../DisplayBindings/FormDesigner/FormDesigner.dll"/> <Import assembly = "../../DisplayBindings/FormDesigner/FormDesigner.dll"/>

7
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -2,8 +2,11 @@
author = "Mike Krueger" author = "Mike Krueger"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Backing binding for C#" description = "Backing binding for C#">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.CSharpBinding"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "CSharpBinding.dll"/> <Import assembly = "CSharpBinding.dll"/>

7
src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin

@ -2,8 +2,11 @@
author = "Mike Krueger" author = "Mike Krueger"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Binding for IL ASM" description = "Binding for IL ASM">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.ILAsmBinding"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "ILAsmBinding.dll"/> <Import assembly = "ILAsmBinding.dll"/>

7
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin

@ -2,8 +2,11 @@
author = "Mike Krueger, Markus Palme" author = "Mike Krueger, Markus Palme"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "SharpDevelop VB.NET language binding" description = "SharpDevelop VB.NET language binding">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.VBNetBinding"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "VBNetBinding.dll"/> <Import assembly = "VBNetBinding.dll"/>

9
src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin

@ -2,11 +2,14 @@
author = "Mike Krueger" author = "Mike Krueger"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "SharpDevelop Form Designer" description = "SharpDevelop Form Designer">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.FormDesigner"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly="FormDesigner.dll"/> <Import assembly = "FormDesigner.dll"/>
<Import assembly = ":ICSharpCode.SharpDevelop"/> <Import assembly = ":ICSharpCode.SharpDevelop"/>
</Runtime> </Runtime>

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/DesignerResourceService.cs

@ -168,8 +168,8 @@ namespace ICSharpCode.FormDesigner.Services
IProject GetProject() IProject GetProject()
{ {
if (_project == null) if (_project == null && ProjectService.OpenSolution != null)
_project = ProjectService.GetProject(FileName); _project = ProjectService.OpenSolution.FindProjectContainingFile(FileName);
return _project; return _project;
} }

7
src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin

@ -2,8 +2,11 @@
author = "Matt Ward" author = "Matt Ward"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Xml Editor" description = "Xml Editor">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.XmlEditor"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "XmlEditor.dll"> <Import assembly = "XmlEditor.dll">

2
src/AddIns/Misc/AddinScout/Project/Src/AddInScoutCommand.cs

@ -7,7 +7,7 @@
using System; using System;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop; using ICSharpCode.Core;
namespace AddInScout namespace AddInScout
{ {

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin

@ -1,4 +1,8 @@
<AddIn name="SharpDevelop Debugger" author="David Srbecký" copyright="GPL" url="" description="SharpDevelop Managed Debugger" version="0.1.0.0"> <AddIn name="SharpDevelop Debugger" author="David Srbecký" copyright="GPL" url="" description="SharpDevelop Managed Debugger">
<Manifest>
<Identity name = "ICSharpCode.Debugger"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly="Debugger.AddIn.dll"/> <Import assembly="Debugger.AddIn.dll"/>
</Runtime> </Runtime>

10
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin

@ -1,10 +1,12 @@
<AddIn name = "Help 2.0 Environment for SharpDevelop" <AddIn name = "Dynamic help pad for SharpDevelop"
author = "Mathias Simmack" author = "Mathias Simmack"
copyright = "Copyright (c) 2005" copyright = "Copyright (c) 2005"
url = "unknown" description = "integrates Microsoft's Help 2.0 Environment">
description = "integrates Microsoft's Help 2.0 Environment"
version = "2.0.0.3">
<Manifest>
<Identity name = "ICSharpCode.HtmlHelp2"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly="HtmlHelp2.dll"/> <Import assembly="HtmlHelp2.dll"/>
</Runtime> </Runtime>

7
src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin

@ -2,8 +2,11 @@
author = "Daniel Grunwald" author = "Daniel Grunwald"
copyright = "GNU General Public License" copyright = "GNU General Public License"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Integrated MbUnit test runner for #Develop" description = "Integrated MbUnit test runner for #Develop">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.MbUnitPad"/>
</Manifest>
<Runtime> <Runtime>
<!-- MbUnit is not in the path, so we need to load it manually --> <!-- MbUnit is not in the path, so we need to load it manually -->

7
src/AddIns/Misc/NAntAddIn/Project/NAnt.addin

@ -2,9 +2,12 @@
author = "Matt Ward" author = "Matt Ward"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net/" url = "http://www.icsharpcode.net/"
description = "NAnt integration for SharpDevelop." description = "NAnt integration for SharpDevelop.">
version = "1.0">
<Manifest>
<Identity name = "ICSharpCode.NAntAddIn"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly = "NAntAddIn.dll"> <Import assembly = "NAntAddIn.dll">
<ConditionEvaluator name = "IsNAntRunning" class = "ICSharpCode.NAntAddIn.IsNAntRunningCondition"/> <ConditionEvaluator name = "IsNAntRunning" class = "ICSharpCode.NAntAddIn.IsNAntRunningCondition"/>

3
src/AddIns/Misc/NAntAddIn/Project/Src/Gui/NAntPadContent.cs

@ -211,7 +211,8 @@ namespace ICSharpCode.NAntAddIn.Gui
void AddBuildFile(string fileName) void AddBuildFile(string fileName)
{ {
IProject project = ProjectService.GetProject(fileName); if (ProjectService.OpenSolution == null) return;
IProject project = ProjectService.OpenSolution.FindProjectContainingFile(fileName);
if (project != null) { if (project != null) {
treeView.AddBuildFile(project.Name, fileName); treeView.AddBuildFile(project.Name, fileName);
} }

2
src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs

@ -6,7 +6,7 @@
// </file> // </file>
using System; using System;
using ICSharpCode.SharpDevelop; using ICSharpCode.Core;
namespace Plugins.RegExpTk { namespace Plugins.RegExpTk {

7
src/AddIns/Misc/StartPage/Project/StartPage.addin

@ -2,8 +2,11 @@
author = "Georg Brandl" author = "Georg Brandl"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "VS like Start Page for #develop" description = "VS like Start Page for #develop">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.StartPage"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly="StartPage.dll"/> <Import assembly="StartPage.dll"/>

7
src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin

@ -2,8 +2,11 @@
author = "Mike Krueger" author = "Mike Krueger"
copyright = "GPL" copyright = "GPL"
url = "http://www.icsharpcode.net" url = "http://www.icsharpcode.net"
description = "Subversion plugin" description = "Subversion plugin">
version = "1.0.0">
<Manifest>
<Identity name = "ICSharpCode.Svn"/>
</Manifest>
<Runtime> <Runtime>
<Import assembly="SubversionAddIn.dll"/> <Import assembly="SubversionAddIn.dll"/>

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -756,4 +756,4 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project> </Project>

14
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs

@ -67,14 +67,12 @@ namespace ICSharpCode.SharpDevelop.Project
void TreeViewDrawNode(object sender, DrawTreeNodeEventArgs e) void TreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
{ {
if (e.DrawDefault) { AbstractProjectBrowserTreeNode node = e.Node as AbstractProjectBrowserTreeNode;
AbstractProjectBrowserTreeNode node = e.Node as AbstractProjectBrowserTreeNode; if (node != null) {
if (node != null) { Image img = node.Overlay;
Image img = node.Overlay; if (img != null) {
if (img != null) { Graphics g = e.Graphics;
Graphics g = e.Graphics; g.DrawImageUnscaled(img, e.Bounds.X - img.Width, e.Bounds.Bottom - img.Height);
g.DrawImageUnscaled(img, e.Bounds.X - img.Width, e.Bounds.Bottom - img.Height);
}
} }
} }
} }

18
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -37,12 +37,18 @@ namespace ICSharpCode.SharpDevelop.Project
} }
} }
public static IProject GetProject(string filename) /// <summary>
/// Gets an open project by the name of the project file.
/// </summary>
public static IProject GetProject(string projectFilename)
{ {
if (openSolution == null) if (openSolution == null) return null;
return null; foreach (IProject project in openSolution.Projects) {
else if (FileUtility.IsEqualFileName(project.FileName, projectFilename)) {
return openSolution.FindProjectContainingFile(filename); return project;
}
}
return null;
} }
static bool initialized; static bool initialized;
@ -165,7 +171,7 @@ namespace ICSharpCode.SharpDevelop.Project
if (fileName == null) { if (fileName == null) {
return; return;
} }
CurrentProject = GetProject(fileName) ?? CurrentProject; CurrentProject = OpenSolution.FindProjectContainingFile(fileName) ?? CurrentProject;
} }
/// <summary> /// <summary>

6
src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs

@ -392,7 +392,11 @@ namespace ICSharpCode.SharpDevelop.Gui
GotoRegion(m.Region, m.DeclaringType.CompilationUnit.FileName); GotoRegion(m.Region, m.DeclaringType.CompilationUnit.FileName);
} else if (tag is FileLineReference) { } else if (tag is FileLineReference) {
FileLineReference flref = (FileLineReference)tag; FileLineReference flref = (FileLineReference)tag;
FileService.JumpToFilePosition(flref.FileName, flref.Line - 1, flref.Column); if (flref.Line <= 0) {
FileService.OpenFile(flref.FileName);
} else {
FileService.JumpToFilePosition(flref.FileName, flref.Line - 1, flref.Column);
}
} else { } else {
throw new NotImplementedException("Unknown tag: " + tag); throw new NotImplementedException("Unknown tag: " + tag);
} }

2
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs

@ -220,7 +220,7 @@ namespace SearchAndReplace
} }
} }
} }
public class BackToNormalView : ICSharpCode.SharpDevelop.AbstractMenuCommand public class BackToNormalView : AbstractMenuCommand
{ {
public override void Run() public override void Run()
{ {

5
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -137,9 +137,14 @@
<Compile Include="Src\AddInTree\AddIn\DefaultDoozers\IncludeDoozer.cs" /> <Compile Include="Src\AddInTree\AddIn\DefaultDoozers\IncludeDoozer.cs" />
<Compile Include="Src\Services\LoggingService\LoggingService.cs" /> <Compile Include="Src\Services\LoggingService\LoggingService.cs" />
<Compile Include="Src\Util\ClipboardWrapper.cs" /> <Compile Include="Src\Util\ClipboardWrapper.cs" />
<Compile Include="Src\AddInTree\AddIn\Manifest.cs" />
<Compile Include="Src\AddInTree\AddIn\AddInReference.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Src\Services\LoggingService" /> <Folder Include="Src\Services\LoggingService" />
<Content Include="..\..\..\..\data\schemas\AddIn.xsd">
<Link>Src\AddInTree\AddIn\AddIn.xsd</Link>
</Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project> </Project>

41
src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs

@ -17,11 +17,13 @@ namespace ICSharpCode.Core
/// </summary> /// </summary>
public class AddIn public class AddIn
{ {
Properties properties = new Properties(); Properties properties = new Properties();
List<Runtime> runtimes = new List<Runtime>(); List<Runtime> runtimes = new List<Runtime>();
string addInFileName = null; string addInFileName = null;
AddInManifest manifest = new AddInManifest();
Dictionary<string, ExtensionPath> paths = new Dictionary<string, ExtensionPath>(); Dictionary<string, ExtensionPath> paths = new Dictionary<string, ExtensionPath>();
internal bool enabled = true;
static bool hasShownErrorMessage = false; static bool hasShownErrorMessage = false;
public object CreateObject(string className) public object CreateObject(string className)
@ -47,12 +49,30 @@ namespace ICSharpCode.Core
} }
} }
public Version Version {
get {
return manifest.PrimaryVersion;
}
}
public string FileName { public string FileName {
get { get {
return addInFileName; return addInFileName;
} }
} }
public string Name {
get {
return properties["name"];
}
}
public AddInManifest Manifest {
get {
return manifest;
}
}
public Dictionary<string, ExtensionPath> Paths { public Dictionary<string, ExtensionPath> Paths {
get { get {
return paths; return paths;
@ -65,12 +85,18 @@ namespace ICSharpCode.Core
} }
} }
public bool Enabled {
get {
return enabled;
}
}
AddIn() AddIn()
{ {
} }
static void SetupAddIn(XmlTextReader reader, AddIn addIn, string hintPath) static void SetupAddIn(XmlTextReader reader, AddIn addIn, string hintPath)
{ {
while (reader.Read()) { while (reader.Read()) {
if (reader.NodeType == XmlNodeType.Element && reader.IsStartElement()) { if (reader.NodeType == XmlNodeType.Element && reader.IsStartElement()) {
switch (reader.LocalName) { switch (reader.LocalName) {
@ -114,6 +140,9 @@ namespace ICSharpCode.Core
ExtensionPath.SetUp(extensionPath, reader, "Path"); ExtensionPath.SetUp(extensionPath, reader, "Path");
} }
break; break;
case "Manifest":
addIn.Manifest.ReadManifestSection(reader, hintPath);
break;
default: default:
throw new AddInLoadException("Unknown root path node:" + reader.LocalName); throw new AddInLoadException("Unknown root path node:" + reader.LocalName);
} }
@ -143,6 +172,8 @@ namespace ICSharpCode.Core
switch (reader.LocalName) { switch (reader.LocalName) {
case "AddIn": case "AddIn":
addIn.properties = Properties.ReadFromAttributes(reader); addIn.properties = Properties.ReadFromAttributes(reader);
if (!addIn.properties.Contains("name"))
throw new ApplicationException("<AddIn>-node must specify the name attribute.");
SetupAddIn(reader, addIn, hintPath); SetupAddIn(reader, addIn, hintPath);
break; break;
default: default:

149
src/Main/Core/Project/Src/AddInTree/AddIn/AddInReference.cs

@ -0,0 +1,149 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 21.11.2005
* Time: 18:01
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
namespace ICSharpCode.Core
{
/// <summary>
/// Represents a versioned reference to an AddIn. Used by <see cref="AddInManifest"/>.
/// </summary>
public class AddInReference
{
string name;
Version minimumVersion;
Version maximumVersion;
public Version MinimumVersion {
get {
return minimumVersion;
}
}
public Version MaximumVersion {
get {
return maximumVersion;
}
}
public string Name {
get {
return name;
}
}
/// <returns>Returns true when the reference is valid.</returns>
public bool Check(Dictionary<string, Version> addIns, out Version versionFound)
{
if (addIns.TryGetValue(name, out versionFound)) {
return CompareVersion(versionFound, minimumVersion) >= 0
&& CompareVersion(versionFound, maximumVersion) <= 0;
} else {
return false;
}
}
/// <summary>
/// Compares two versions and ignores unspecified fields (unlike Version.CompareTo)
/// </summary>
/// <returns>-1 if a &lt; b, 0 if a == b, 1 if a &gt; b</returns>
int CompareVersion(Version a, Version b)
{
if (a.Major != b.Major) {
return a.Major > b.Major ? 1 : -1;
}
if (a.Minor != b.Minor) {
return a.Minor > b.Minor ? 1 : -1;
}
if (a.Build < 0 || b.Build < 0)
return 0;
if (a.Build != b.Build) {
return a.Build > b.Build ? 1 : -1;
}
if (a.Revision < 0 || b.Revision < 0)
return 0;
if (a.Revision != b.Revision) {
return a.Revision > b.Revision ? 1 : -1;
}
return 0;
}
public static AddInReference Create(Properties properties, string hintPath)
{
AddInReference reference = new AddInReference(properties["addin"]);
string version = properties["version"];
if (version != null && version.Length > 0) {
int pos = version.IndexOf('-');
if (pos > 0) {
reference.minimumVersion = ParseVersion(version.Substring(0, pos), hintPath);
reference.maximumVersion = ParseVersion(version.Substring(pos + 1), hintPath);
} else {
reference.maximumVersion = reference.minimumVersion = ParseVersion(version, hintPath);
}
}
return reference;
}
static Version entryVersion;
internal static Version ParseVersion(string version, string hintPath)
{
if (version == null || version.Length == 0)
return new Version(0,0,0,0);
if (version.StartsWith("@")) {
if (version == "@EntryAssemblyVersion") {
if (entryVersion == null)
entryVersion = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
return entryVersion;
}
string fileName = Path.Combine(hintPath, version.Substring(1));
FileVersionInfo info = FileVersionInfo.GetVersionInfo(fileName);
return new Version(info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart);
} else {
return new Version(version);
}
}
public AddInReference(string name) : this(name, new Version(0,0,0,0), new Version(int.MaxValue, int.MaxValue)) { }
public AddInReference(string name, Version specificVersion) : this(name, specificVersion, specificVersion) { }
public AddInReference(string name, Version minimumVersion, Version maximumVersion)
{
if (name == null) throw new ArgumentNullException("name");
if (name.Length == 0) throw new ArgumentException("name cannot be an empty string", "name");
if (minimumVersion == null) throw new ArgumentNullException("minimumVersion");
if (maximumVersion == null) throw new ArgumentNullException("maximumVersion");
this.minimumVersion = minimumVersion;
this.maximumVersion = maximumVersion;
this.name = name;
}
public override string ToString()
{
if (minimumVersion.ToString() == "0.0.0.0") {
if (maximumVersion.Major == int.MaxValue) {
return name;
} else {
return name + ", version <" + maximumVersion.ToString();
}
} else {
if (maximumVersion.Major == int.MaxValue) {
return name + ", version >" + minimumVersion.ToString();
} else if (minimumVersion == maximumVersion) {
return name + ", version " + minimumVersion.ToString();
} else {
return name + ", version " + minimumVersion.ToString() + "-" + maximumVersion.ToString();
}
}
}
}
}

4
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/AbstractCheckableMenuCommand.cs

@ -10,9 +10,7 @@ using System.Collections;
using System.CodeDom.Compiler; using System.CodeDom.Compiler;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; namespace ICSharpCode.Core
namespace ICSharpCode.SharpDevelop
{ {
public abstract class AbstractCheckableMenuCommand : AbstractMenuCommand, ICheckableMenuCommand public abstract class AbstractCheckableMenuCommand : AbstractMenuCommand, ICheckableMenuCommand
{ {

4
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/AbstractMenuCommand.cs

@ -10,9 +10,7 @@ using System.Collections;
using System.CodeDom.Compiler; using System.CodeDom.Compiler;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; namespace ICSharpCode.Core
namespace ICSharpCode.SharpDevelop
{ {
public abstract class AbstractMenuCommand : AbstractCommand, IMenuCommand public abstract class AbstractMenuCommand : AbstractCommand, IMenuCommand
{ {

99
src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs

@ -0,0 +1,99 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 21.11.2005
* Time: 17:20
*/
using System;
using System.Collections.Generic;
using System.Xml;
namespace ICSharpCode.Core
{
/// <summary>
/// Stores information about the manifest of an AddIn.
/// </summary>
public class AddInManifest
{
List<AddInReference> dependencies = new List<AddInReference>();
List<AddInReference> conflicts = new List<AddInReference>();
Dictionary<string, Version> identities = new Dictionary<string, Version>();
Version primaryVersion;
public Version PrimaryVersion {
get {
return primaryVersion;
}
}
public Dictionary<string, Version> Identities {
get {
return identities;
}
}
public List<AddInReference> Dependencies {
get {
return dependencies;
}
}
public List<AddInReference> Conflicts {
get {
return conflicts;
}
}
void AddIdentity(string name, string version, string hintPath)
{
if (name.Length == 0)
throw new AddInLoadException("Identity needs a name");
foreach (char c in name) {
if (!char.IsLetterOrDigit(c) && c != '.' && c != '_') {
throw new AddInLoadException("Identity name contains invalid character: '" + c + "'");
}
}
Version v = AddInReference.ParseVersion(version, hintPath);
if (primaryVersion == null)
primaryVersion = v;
identities.Add(name, v);
}
public void ReadManifestSection(XmlReader reader, string hintPath)
{
if (reader.AttributeCount != 0) {
throw new AddInLoadException("Manifest node cannot have attributes.");
}
if (reader.IsEmptyElement) {
throw new AddInLoadException("Manifest node cannot be empty.");
}
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.EndElement:
if (reader.LocalName == "Manifest") {
return;
}
break;
case XmlNodeType.Element:
string nodeName = reader.LocalName;
Properties properties = Properties.ReadFromAttributes(reader);
switch (nodeName) {
case "Identity":
AddIdentity(properties["name"], properties["version"], hintPath);
break;
case "Dependency":
dependencies.Add(AddInReference.Create(properties, hintPath));
break;
case "Conflict":
conflicts.Add(AddInReference.Create(properties, hintPath));
break;
default:
throw new AddInLoadException("Unknown node in Manifest section:" + nodeName);
}
break;
}
}
}
}
}

62
src/Main/Core/Project/Src/AddInTree/AddInTree.cs

@ -203,11 +203,71 @@ namespace ICSharpCode.Core
// } // }
// } // }
// } // }
// used by Load(): disables an addin and removes it from the dictionaries.
static void DisableAddin(AddIn addIn, Dictionary<string, Version> dict, Dictionary<string, AddIn> addInDict)
{
addIn.enabled = false;
foreach (string name in addIn.Manifest.Identities.Keys) {
dict.Remove(name);
addInDict.Remove(name);
}
}
public static void Load() public static void Load()
{ {
List<string> addInFiles = FileUtility.SearchDirectory(defaultCoreDirectory, "*.addin"); List<string> addInFiles = FileUtility.SearchDirectory(defaultCoreDirectory, "*.addin");
List<AddIn> list = new List<AddIn>();
Dictionary<string, Version> dict = new Dictionary<string, Version>();
Dictionary<string, AddIn> addInDict = new Dictionary<string, AddIn>();
foreach (string fileName in addInFiles) { foreach (string fileName in addInFiles) {
InsertAddIn(AddIn.Load(fileName)); AddIn addIn = AddIn.Load(fileName);
foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) {
if (dict.ContainsKey(pair.Key)) {
MessageService.ShowError("Name '" + pair.Key + "' is used by " +
"'" + addInDict[pair.Key].FileName + "' and '" + fileName + "'");
addIn.enabled = false;
} else {
dict.Add(pair.Key, pair.Value);
addInDict.Add(pair.Key, addIn);
}
}
list.Add(addIn);
}
checkDependencies:
for (int i = 0; i < list.Count; i++) {
AddIn addIn = list[i];
if (!addIn.Enabled) continue;
Version versionFound;
foreach (AddInReference reference in addIn.Manifest.Conflicts) {
if (reference.Check(dict, out versionFound)) {
MessageService.ShowError(addIn.Name + " conflicts with " + reference.ToString()
+ " and has been disabled.");
DisableAddin(addIn, dict, addInDict);
goto checkDependencies; // after removing one addin, others could break
}
}
foreach (AddInReference reference in addIn.Manifest.Dependencies) {
if (!reference.Check(dict, out versionFound)) {
if (versionFound != null) {
MessageService.ShowError(addIn.Name + " has not been loaded because it requires "
+ reference.ToString() + ", but version "
+ versionFound.ToString() + " is installed.");
} else {
MessageService.ShowError(addIn.Name + " has not been loaded because it requires "
+ reference.ToString() + ".");
}
DisableAddin(addIn, dict, addInDict);
goto checkDependencies; // after removing one addin, others could break
}
}
}
foreach (AddIn addIn in list) {
if (addIn.Enabled) {
InsertAddIn(addIn);
}
} }
} }
} }

4
src/Main/Core/Project/Src/Services/PropertyService/Properties.cs

@ -111,7 +111,7 @@ namespace ICSharpCode.Core
return properties; return properties;
} }
public void ReadProperties(XmlTextReader reader, string endElement) public void ReadProperties(XmlReader reader, string endElement)
{ {
if (reader.IsEmptyElement) { if (reader.IsEmptyElement) {
return; return;
@ -141,7 +141,7 @@ namespace ICSharpCode.Core
} }
} }
ArrayList ReadArray(XmlTextReader reader) ArrayList ReadArray(XmlReader reader)
{ {
if (reader.IsEmptyElement) if (reader.IsEmptyElement)
return new ArrayList(0); return new ArrayList(0);

12
src/Tools/BuildAddinDocumentation/BuildAddinDocumentation.sln

@ -1,6 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.589 # SharpDevelop 2.0.0.783
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildAddinDocumentation", "BuildAddinDocumentation.csproj", "{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildAddinDocumentation", "BuildAddinDocumentation.csproj", "{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}.Release|Any CPU.Build.0 = Release|Any CPU
{211887B2-E9E4-45A4-BE16-6CEA4A7E00F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal EndGlobal

Loading…
Cancel
Save