Browse Source

Added CSharpBinding.Tests project.

Add "run in debugger" command to member bookmarks.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@423 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
8fc6327d9f
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  2. 53
      src/AddIns/BackendBindings/CSharpBinding/Test/CSharpBinding.Tests.csproj
  3. 27
      src/AddIns/BackendBindings/CSharpBinding/Test/CSharpBinding.Tests.dll.config
  4. 98
      src/AddIns/BackendBindings/CSharpBinding/Test/ExpressionFinder.cs
  5. 6
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/CSharpDesignerGenerator.cs
  6. 6
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/VBNetDesignerGenerator.cs
  7. 12
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/DesignerLoaderProvider.cs
  8. 4
      src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.dll.config
  9. 42
      src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin
  10. 6
      src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.csproj
  11. 46
      src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitCommands.cs
  12. 68
      src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitTestableCondition.cs
  13. 2
      src/Libraries/NRefactory/Test/Lexer/CSharp/CustomLexerTests.cs
  14. 12
      src/Main/Base/Project/Src/Gui/ContentInterfaces/ICanBeDirty.cs
  15. 12
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/CreateKey.cs
  16. 12
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs
  17. 12
      src/Main/Base/Project/Src/Project/Solution/SolutionPreferences.cs
  18. 2
      src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs
  19. 6
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  20. 7
      src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs
  21. 2
      src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs
  22. 25
      src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs
  23. 8
      src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs
  24. 2
      src/Main/Core/Project/Src/AddInTree/AddInTree.cs
  25. 6
      src/Main/Core/Project/Src/AddInTree/AddInTreeNode.cs
  26. 3
      src/SharpDevelop.WithTests.sln
  27. 2
      src/Tools/CheckFileHeaders/Main.cs

2
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -15,12 +15,14 @@ @@ -15,12 +15,14 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CSharpBinding\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CSharpBinding\</OutputPath>

53
src/AddIns/BackendBindings/CSharpBinding/Test/CSharpBinding.Tests.csproj

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>CSharpBinding.Tests</RootNamespace>
<AssemblyName>CSharpBinding.Tests</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4D0DFCB0-F6FB-469D-AA6F-C7F1D5FD5DE7}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CSharpBinding\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\..\..\..\AddIns\AddIns\BackendBindings\CSharpBinding\</OutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="nunit.framework">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ExpressionFinder.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Project\CSharpBinding.csproj">
<Project>{1F1AC7CD-D154-45BB-8EAF-804CA8055F5A}</Project>
<Name>CSharpBinding</Name>
<Private>False</Private>
</ProjectReference>
<Content Include="CSharpBinding.Tests.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

27
src/AddIns/BackendBindings/CSharpBinding/Test/CSharpBinding.Tests.dll.config

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.Core" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<codeBase version="2.0.0.1" href="../../../../bin/ICSharpCode.Core.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpDevelop" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<codeBase version="2.0.0.1" href="../../../../bin/ICSharpCode.SharpDevelop.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.TextEditor" publicKeyToken="4d61825e8dd49f1a" culture="neutral"/>
<codeBase version="2.0.0.1" href="../../../../bin/ICSharpCode.TextEditor.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="efe927acf176eea2" culture="neutral"/>
<codeBase version="2.0.0.1" href="../../../../bin/ICSharpCode.NRefactory.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="b32731d11ce58905" culture="neutral"/>
<codeBase version="1.2.9.0" href="../../../../bin/log4net.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

98
src/AddIns/BackendBindings/CSharpBinding/Test/ExpressionFinder.cs

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using NUnit.Framework;
using CSharpBinding.Parser;
using ICSharpCode.SharpDevelop.Dom;
namespace CSharpBinding.Tests
{
[TestFixture]
public class ExpressionFinderTests
{
const string document = @"using System;
class Main<T> : BaseType
{
public Color Color { get {} set {}}
Font Font { get {} set {}}
void Method() {
simple += 1;
int a = 0;
((CastTo)castTarget).MethodOnCastExpression(parameter);
int b = 0;
return ((CastTo)castTarget).PropertyOnCastExpression;
}
}";
ExpressionFinder ef;
[SetUp]
public void Init()
{
ef = new ExpressionFinder("test.cs");
}
void FindFull(string location, string expectedExpression, ExpressionContext expectedContext)
{
int pos = document.IndexOf(location);
if (pos < 0) Assert.Fail("location not found in document");
ExpressionResult er = ef.FindFullExpression(document, pos);
Assert.AreEqual(expectedExpression, er.Expression);
Assert.AreEqual(expectedContext.ToString(), er.Context.ToString());
}
[Test]
public void Simple()
{
FindFull("mple += 1", "simple", ExpressionContext.Default);
}
[Test]
public void SimpleBeginningOfExpression()
{
FindFull("simple += 1", "simple", ExpressionContext.Default);
}
[Test]
public void PropertyColor()
{
FindFull("olor { get", "Color", ExpressionContext.Default);
}
[Test]
public void TypeColor()
{
FindFull("olor Color", "Color", ExpressionContext.Type);
}
[Test]
public void PropertyFont()
{
FindFull("ont { get", "Font", ExpressionContext.Default);
}
[Test]
public void TypeFont()
{
FindFull("ont Font", "Font", ExpressionContext.Type);
}
[Test]
public void Method()
{
FindFull("thodOnCastExpression(para", "((CastTo)castTarget).MethodOnCastExpression(parameter)", ExpressionContext.Default);
}
[Test]
public void Property()
{
FindFull("pertyOnCastExpression", "((CastTo)castTarget).PropertyOnCastExpression", ExpressionContext.Default);
}
}
}

6
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/CSharpDesignerGenerator.cs

@ -159,8 +159,10 @@ namespace ICSharpCode.FormDesigner @@ -159,8 +159,10 @@ namespace ICSharpCode.FormDesigner
string param = "";
IAmbience csa = null;
try {
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("CSharp", typeof(IAmbience));
} catch {}
csa = (IAmbience)AddInTree.BuildItem("/SharpDevelop/Workbench/Ambiences/C#", null);
} catch (TreePathNotFoundException) {
LoggingService.Warn("C# ambience not found");
}
for (int i = 0; i < mInfo.GetParameters().Length; ++i) {
ParameterInfo pInfo = mInfo.GetParameters()[i];

6
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/VBNetDesignerGenerator.cs

@ -158,8 +158,10 @@ namespace ICSharpCode.FormDesigner @@ -158,8 +158,10 @@ namespace ICSharpCode.FormDesigner
string param = "";
IAmbience csa = null;
try {
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("VBNet", typeof(IAmbience));
} catch {}
csa = (IAmbience)AddInTree.BuildItem("/SharpDevelop/Workbench/Ambiences/VBNet", null);
} catch (TreePathNotFoundException) {
LoggingService.Warn("VB ambience not found");
}
for (int i = 0; i < mInfo.GetParameters().Length; ++i) {
ParameterInfo pInfo = mInfo.GetParameters()[i];

12
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/DesignerLoaderProvider.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 16.08.2005
* Time: 21:40
*/
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.ComponentModel.Design.Serialization;

4
src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.dll.config

@ -18,6 +18,10 @@ @@ -18,6 +18,10 @@
<assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="efe927acf176eea2" culture="neutral"/>
<codeBase version="2.0.0.1" href="../../../../bin/ICSharpCode.NRefactory.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="b32731d11ce58905" culture="neutral"/>
<codeBase version="1.2.9.0" href="../../../../bin/log4net.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

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

@ -8,7 +8,9 @@ @@ -8,7 +8,9 @@
<Runtime>
<!-- MbUnit is not in the path, so we need to load it manually -->
<Import assembly = "../../../../bin/Tools/MbUnit/MbUnit.GUI.exe"/>
<Import assembly = "MbUnitPad.dll"/>
<Import assembly = "MbUnitPad.dll">
<ConditionEvaluator name = "MbUnitTestable" class = "ICSharpCode.MbUnitPad.MbUnitTestableCondition"/>
</Import>
</Runtime>
<Path name = "/SharpDevelop/Workbench/Pads">
@ -20,6 +22,44 @@ @@ -20,6 +22,44 @@
class = "ICSharpCode.MbUnitPad.MbUnitPadContent"/>
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassMemberContextMenu">
<Include id = "MbUnitTests" insertbefore = "MenuBuilder" item="/SharpDevelop/Pads/ClassBrowser/MemberContextMenu/MbUnitTestMenu"/>
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassBookmarkContextMenu">
<Include id = "MbUnitTests" insertbefore = "MenuBuilder" item="/SharpDevelop/Pads/ClassBrowser/ClassContextMenu/MbUnitTestMenu"/>
</Path>
<Path name = "/SharpDevelop/Pads/ClassBrowser/MemberContextMenu">
<Condition name = "MbUnitTestable">
<MenuItem id="MbUnitTestMenu" type="Menu" label="Unit Testing" icon="PadIcons.MbUnitTest" insertbefore="MenuBuilder">
<MenuItem id = "RunInPad"
label = "Run in unit test pad"
icon = "PadIcons.MbUnitTest"
class = "ICSharpCode.MbUnitPad.RunTestInPadCommand"/>
<MenuItem id = "RunWithDebugger"
label = "Run in console with debugger"
icon = "Icons.16x16.RunProgramIcon"
class = "ICSharpCode.MbUnitPad.RunTestWithDebuggerCommand"/>
</MenuItem>
</Condition>
</Path>
<Path name = "/SharpDevelop/Pads/ClassBrowser/ClassContextMenu">
<Condition name = "MbUnitTestable">
<MenuItem id="MbUnitTestMenu" type="Menu" label="Unit Testing" icon="PadIcons.MbUnitTest" insertbefore="MenuBuilder">
<MenuItem id = "RunInPad"
label = "Run in unit test pad"
icon = "PadIcons.MbUnitTest"
class = "ICSharpCode.MbUnitPad.RunTestInPadCommand"/>
<MenuItem id = "RunWithDebugger"
label = "Run in console with debugger"
icon = "Icons.16x16.RunProgramIcon"
class = "ICSharpCode.MbUnitPad.RunTestWithDebuggerCommand"/>
</MenuItem>
</Condition>
</Path>
<Path name = "/SharpDevelop/Pads/MbUnitPad/Toolbar">
<Condition name = "CombineOpen" iscombineopen="True" action="Disable">
<ToolbarItem id = "Reload"

6
src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.csproj

@ -45,6 +45,7 @@ @@ -45,6 +45,7 @@
<Compile Include="Src\TestTreeView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\MbUnitTestableCondition.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
@ -57,6 +58,11 @@ @@ -57,6 +58,11 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project>
<Name>ICSharpCode.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

46
src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitCommands.cs

@ -6,8 +6,12 @@ @@ -6,8 +6,12 @@
// </file>
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using MbUnit.Forms;
@ -58,4 +62,46 @@ namespace ICSharpCode.MbUnitPad @@ -58,4 +62,46 @@ namespace ICSharpCode.MbUnitPad
}
}
}
public class RunTestInPadCommand : AbstractMenuCommand
{
public override void Run()
{
IMember m = MbUnitTestableCondition.GetMember(Owner);
IClass c = (m != null) ? m.DeclaringType : MbUnitTestableCondition.GetClass(Owner);
MessageService.ShowMessage("Not implemented");
}
}
public class RunTestWithDebuggerCommand : AbstractMenuCommand
{
public override void Run()
{
if (!DebuggerService.IsDebuggerLoaded || DebuggerService.CurrentDebugger.IsDebugging) {
MessageService.ShowMessage("The debugger is currently busy.");
return;
}
IMember m = MbUnitTestableCondition.GetMember(Owner);
IClass c = (m != null) ? m.DeclaringType : MbUnitTestableCondition.GetClass(Owner);
if (m != null) {
MessageService.ShowMessage("Running single tests is not implemented, run the test fixture instead.");
return;
}
IProject project = c.ProjectContent.Project;
if (project.Build().Errors.Count > 0) {
return;
}
string mbUnitDir = Path.GetDirectoryName(typeof(ReflectorTreeView).Assembly.Location);
ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(mbUnitDir, "MbUnit.Cons.exe"));
string assemblyPath = project.OutputAssemblyFullPath;
StringBuilder sb = new StringBuilder();
sb.Append("\"/filter-type:" + c.FullyQualifiedName + "\"");
sb.Append(" \"/assembly-path:" + Path.GetDirectoryName(assemblyPath) + "\"");
sb.Append(" \"" + assemblyPath + "\"");
startInfo.Arguments = sb.ToString();
startInfo.WorkingDirectory = mbUnitDir;
LoggingService.Info("Run " + startInfo.FileName + " " + startInfo.Arguments);
DebuggerService.CurrentDebugger.Start(startInfo);
}
}
}

68
src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitTestableCondition.cs

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.MbUnitPad
{
/// <summary>
/// Supplies a "Unit test" menu item if the class is a test fixture.
/// </summary>
public class MbUnitTestableCondition : IConditionEvaluator
{
public static IMember GetMember(object caller)
{
MemberNode memberNode = caller as MemberNode;
if (memberNode != null) {
return memberNode.Member;
} else {
ClassMemberBookmark mbookmark = caller as ClassMemberBookmark;
if (mbookmark != null) {
return mbookmark.Member;
}
}
return null;
}
public static IClass GetClass(object caller)
{
ClassNode classNode = caller as ClassNode;
if (classNode != null) {
return classNode.Class;
} else {
ClassBookmark bookmark = caller as ClassBookmark;
if (bookmark != null) {
return bookmark.Class;
}
}
return null;
}
public bool IsValid(object caller, Condition condition)
{
IMember m = GetMember(caller);
IClass c = (m != null) ? m.DeclaringType : GetClass(caller);
StringComparer nameComparer = c.ProjectContent.Language.NameComparer;
string attributeName = (m != null) ? "Test" : "TestFixture";
foreach (IAttribute attribute in (m ?? (IDecoration)c).Attributes) {
if (nameComparer.Equals(attribute.Name, attributeName)
|| nameComparer.Equals(attribute.Name, attributeName + "Attribute"))
{
return true;
}
}
return false;
}
}
}

2
src/Libraries/NRefactory/Test/Lexer/CSharp/CustomLexerTests.cs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email=""/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>

12
src/Main/Base/Project/Src/Gui/ContentInterfaces/ICanBeDirty.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 19.08.2005
* Time: 18:25
*/
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;

12
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/CreateKey.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 20.08.2005
* Time: 10:47
*/
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;

12
src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 19.08.2005
* Time: 15:12
*/
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;

12
src/Main/Base/Project/Src/Project/Solution/SolutionPreferences.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 19.08.2005
* Time: 12:09
*/
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;

2
src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.Core @@ -62,7 +62,7 @@ namespace ICSharpCode.Core
}
if (defaultAmbience == null) {
string language = PropertyService.Get(ambienceProperty, "C#");
IAmbience ambience = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem(language, null);
IAmbience ambience = (IAmbience)AddInTree.BuildItem("/SharpDevelop/Workbench/Ambiences/" + language, null);
if (ambience == null) {
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Services.AmbienceService.AmbienceNotFoundError}");
return null;

6
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -47,6 +47,12 @@ namespace ICSharpCode.Core @@ -47,6 +47,12 @@ namespace ICSharpCode.Core
}
}
public virtual IProject Project {
get {
return null;
}
}
public List<Dictionary<string, IClass>> ClassLists {
get {
if (classLists.Count == 0) {

7
src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs

@ -55,6 +55,13 @@ namespace ICSharpCode.Core @@ -55,6 +55,13 @@ namespace ICSharpCode.Core
get;
}
/// <summary>
/// Gets the project for this project content. Returns null for reflection project contents.
/// </summary>
IProject Project {
get;
}
string GetXmlDocumentation(string memberTag);
void AddClassToNamespaceList(IClass addClass);

2
src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.Core @@ -35,7 +35,7 @@ namespace ICSharpCode.Core
IProject project;
public IProject Project {
public override IProject Project {
get {
return project;
}

25
src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

@ -115,16 +115,21 @@ namespace ICSharpCode.Core @@ -115,16 +115,21 @@ namespace ICSharpCode.Core
lookupDirectory = Path.GetDirectoryName(itemFileName);
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += AssemblyResolve;
try {
assembly = Assembly.ReflectionOnlyLoadFrom(itemFileName);
if (assembly != null) {
contents[itemFileName] = new ReflectionProjectContent(assembly);
contents[assembly.FullName] = contents[itemFileName];
#if DEBUG
how = "ReflectionOnly";
#endif
return contents[itemFileName];
try {
if (File.Exists(itemFileName)) {
assembly = Assembly.ReflectionOnlyLoadFrom(itemFileName);
if (assembly != null) {
contents[itemFileName] = new ReflectionProjectContent(assembly);
contents[assembly.FullName] = contents[itemFileName];
#if DEBUG
how = "ReflectionOnly";
#endif
return contents[itemFileName];
}
}
} catch (FileNotFoundException) {
// ignore and try loading with LoadGACAssembly
}
} catch (FileNotFoundException) {
try {
assembly = LoadGACAssembly(itemInclude, true);
if (assembly != null) {
@ -136,7 +141,7 @@ namespace ICSharpCode.Core @@ -136,7 +141,7 @@ namespace ICSharpCode.Core
return contents[itemInclude];
}
} catch (Exception e) {
LoggingService.Debug("Can't load assembly '" + itemInclude + "' : " + e.Message);
LoggingService.Warn("Can't load assembly '" + itemInclude + "' : " + e.Message);
}
} catch (BadImageFormatException) {
LoggingService.Warn("BadImageFormat: " + itemInclude);

8
src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs

@ -32,16 +32,16 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -32,16 +32,16 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
{
this.currentClass = currentClass;
try {
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("C#", this);
csa = (IAmbience)AddInTree.BuildItem("/SharpDevelop/Workbench/Ambiences/C#", this);
csa.ConversionFlags = ConversionFlags.ShowAccessibility | ConversionFlags.ShowModifiers | ConversionFlags.QualifiedNamesOnlyForReturnTypes | ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames;
} catch (Exception) {
} catch (TreePathNotFoundException) {
LoggingService.Warn("CSharpAmbience not found -- is the C# backend binding loaded???");
}
try {
vba = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("VBNET", this);
vba = (IAmbience)AddInTree.BuildItem("/SharpDevelop/Workbench/Ambiences/VBNet", this);
vba.ConversionFlags = ConversionFlags.ShowAccessibility | ConversionFlags.ShowModifiers | ConversionFlags.QualifiedNamesOnlyForReturnTypes | ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames;
} catch (Exception) {
} catch (TreePathNotFoundException) {
LoggingService.Warn("VBNet ambience not found -- is the VB.NET backend binding loaded???");
}
}

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

@ -113,7 +113,7 @@ namespace ICSharpCode.Core @@ -113,7 +113,7 @@ namespace ICSharpCode.Core
string parent = path.Substring(0, pos);
string child = path.Substring(pos + 1);
AddInTreeNode node = GetTreeNode(parent);
return node.BuildChildItem(child, caller);
return node.BuildChildItem(child, caller, BuildItems(path, caller, false));
}
/// <summary>

6
src/Main/Core/Project/Src/AddInTree/AddInTreeNode.cs

@ -152,14 +152,14 @@ namespace ICSharpCode.Core @@ -152,14 +152,14 @@ namespace ICSharpCode.Core
return items;
}
public object BuildChildItem(string childItemID, object caller)
public object BuildChildItem(string childItemID, object caller, ArrayList subItems)
{
foreach (Codon codon in codons) {
if (codon.Id == childItemID) {
return codon.BuildItem(caller, null);
return codon.BuildItem(caller, subItems);
}
}
return null;
throw new TreePathNotFoundException(childItemID);
}
}
}

3
src/SharpDevelop.WithTests.sln

@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backends", "Backends", "{FE @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backends", "Backends", "{FE
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpBinding.Tests", "AddIns\BackendBindings\CSharpBinding\Test\CSharpBinding.Tests.csproj", "{4D0DFCB0-F6FB-469D-AA6F-C7F1D5FD5DE7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILAsmBinding", "AddIns\BackendBindings\ILAsmBinding\Project\ILAsmBinding.csproj", "{6e59af58-f635-459a-9a35-c9ac41c00339}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBNetBinding", "AddIns\BackendBindings\VBNetBinding\Project\VBNetBinding.csproj", "{BF38FB72-B380-4196-AF8C-95749D726C61}"
@ -179,6 +181,7 @@ Global @@ -179,6 +181,7 @@ Global
{1F1AC7CD-D154-45BB-8EAF-804CA8055F5A} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{BF38FB72-B380-4196-AF8C-95749D726C61} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{6e59af58-f635-459a-9a35-c9ac41c00339} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{4D0DFCB0-F6FB-469D-AA6F-C7F1D5FD5DE7} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{4B8F0F98-8BE1-402B-AA8B-C8D548577B38} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{7D5C266F-D6FF-4D14-B315-0C0FC6C4EF51} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{64A3E5E6-90BF-47F6-94DF-68C94B62C817} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}

2
src/Tools/CheckFileHeaders/Main.cs

@ -51,6 +51,8 @@ namespace CheckFileHeaders @@ -51,6 +51,8 @@ namespace CheckFileHeaders
continue;
if (subdir.EndsWith("Libraries\\log4net"))
continue;
if (subdir.EndsWith("Libraries\\NUnit.Framework"))
continue;
if (Path.GetFullPath(subdir).EndsWith("src\\Tools"))
continue;
// Disabled addins:

Loading…
Cancel
Save