Browse Source

Merge Merged SD 2.2 revision 2603:2624 to trunk.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2625 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
374929cef6
  1. 3
      data/templates/file/CSharp/CSharp.UnitTest.xft
  2. 1
      data/templates/file/VBNet/VBNet.UnitTest.xft
  3. 9
      data/templates/project/VBNet/Direct3DProject.xpt
  4. 4
      src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs
  5. 9
      src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs
  6. 4
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs
  7. 16
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/SpecialNodesInserter.cs
  8. 13
      src/Libraries/NRefactory/Test/Output/SpecialOutputVisitor.cs
  9. 4
      src/Main/Base/Project/Resources/GeneralTextEditorPanel.xfrm
  10. 6
      src/Main/Base/Project/Resources/MarkersTextEditorPanel.xfrm
  11. 15
      src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs
  12. 3
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
  13. 37
      src/Main/Base/Project/Src/Services/ParserService/DomHostCallback.cs
  14. 3
      src/Main/Base/Test/CollectionClassOverridesTestFixture.cs
  15. 29
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/ReflectionProjectContent.cs
  16. 8
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs
  17. 3
      src/Main/StartUp/Project/Dialogs/SplashScreen.cs

3
data/templates/file/CSharp/CSharp.UnitTest.xft

@ -50,8 +50,9 @@
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#} <File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
<% if (ConditionalClass) { %>#if TEST <% if (ConditionalClass) { %>#if TEST
<% } %> <% } %>
using NUnit.Framework;
using System; using System;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {

1
data/templates/file/VBNet/VBNet.UnitTest.xft

@ -42,6 +42,7 @@
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET} <File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports NUnit.Framework Imports NUnit.Framework
Imports NUnit.Framework.SyntaxHelpers
<TestFixture> _ <TestFixture> _
Public Class ${ClassName} Public Class ${ClassName}

9
data/templates/project/VBNet/Direct3DProject.xpt

@ -41,11 +41,14 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<StartupObject>${StandardNamespace}.MainClass</StartupObject>
</PropertyGroup> </PropertyGroup>
<Files> <Files>
<File name="MainClass.vb"><![CDATA[${StandardHeader.VBNET} <File name="MainClass.vb"><![CDATA[${StandardHeader.VBNET}
Imports System.ComponentModel
' This is the main class of my Direct3D application ' This is the main class of my Direct3D application
Public Class MainClass Public Class MainClass
Inherits Form Inherits Form
@ -104,7 +107,7 @@ Public Class MainClass
' This method renders the scene ' This method renders the scene
Protected Overridable Sub Render() Protected Overridable Sub Render()
If Not device Is Nothing If Not device Is Nothing Then
device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0) device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0)
device.BeginScene() device.BeginScene()
@ -131,7 +134,7 @@ Public Class MainClass
Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs) Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs)
MyBase.OnKeyPress(e) MyBase.OnKeyPress(e)
If AscW(e.KeyChar) = CInt(Keys.Escape) If AscW(e.KeyChar) = CInt(Keys.Escape) Then
Close() Close()
End If End If
End Sub End Sub
@ -140,7 +143,7 @@ Public Class MainClass
Shared Sub Main() Shared Sub Main()
Dim mainClass As New MainClass() Dim mainClass As New MainClass()
If Not mainClass.InitializeGraphics() If Not mainClass.InitializeGraphics() Then
MessageBox.Show("Error while initializing Direct3D") MessageBox.Show("Error while initializing Direct3D")
Return Return
End If End If

4
src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs

@ -569,7 +569,7 @@ namespace ICSharpCode.StartPage
public void RenderSectionAuthorBody(StringBuilder builder) public void RenderSectionAuthorBody(StringBuilder builder)
{ {
try { try {
builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.Contributors\" width=\"100%\" height=\"1400\" />"); builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/Contributors.ashx\" width=\"100%\" height=\"1400\" />");
// //
// //
// //
@ -610,7 +610,7 @@ namespace ICSharpCode.StartPage
public void RenderSectionHelpWantedBody(StringBuilder builder) public void RenderSectionHelpWantedBody(StringBuilder builder)
{ {
try { try {
builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.FeaturesYouCouldHelpUsWith\" width=\"100%\" height=\"1000\" />"); builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/FeaturesWeSolicitHelpFor.ashx\" width=\"100%\" height=\"1000\" />");
// //
// string html = ConvertXml.ConvertToString(Application.StartupPath + // string html = ConvertXml.ConvertToString(Application.StartupPath +
// Path.DirectorySeparatorChar + ".." + // Path.DirectorySeparatorChar + ".." +

9
src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs

@ -250,8 +250,12 @@ namespace ICSharpCode.Build.Tasks
} }
} }
protected override string GenerateResponseFileCommands() //protected override string GenerateResponseFileCommands()
protected override string GenerateCommandLineCommands()
{ {
// using a response file fails when the a path contains spaces, but using the command line
// works fine (FxCop bug?)
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
AppendSwitch(b, "o", realLogFile); AppendSwitch(b, "o", realLogFile);
AppendSwitch(b, "f", inputAssembly); AppendSwitch(b, "f", inputAssembly);
@ -274,6 +278,9 @@ namespace ICSharpCode.Build.Tasks
AppendSwitch(b, "ruleid", rule); AppendSwitch(b, "ruleid", rule);
} }
} }
#if DEBUG
Console.WriteLine(b.ToString());
#endif
return b.ToString(); return b.ToString();
} }
} }

4
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -220,6 +220,10 @@ namespace ICSharpCode.TextEditor
physicalXPos = PaintLinePart(g, lineNumber, column, firstFolding.StartColumn, lineRectangle, physicalXPos); physicalXPos = PaintLinePart(g, lineNumber, column, firstFolding.StartColumn, lineRectangle, physicalXPos);
column = firstFolding.EndColumn; column = firstFolding.EndColumn;
lineNumber = firstFolding.EndLine; lineNumber = firstFolding.EndLine;
if (lineNumber >= textArea.Document.TotalNumberOfLines) {
Debug.Assert(false, "Folding ends after document end");
break;
}
ColumnRange selectionRange2 = textArea.SelectionManager.GetSelectionAtLine(lineNumber); ColumnRange selectionRange2 = textArea.SelectionManager.GetSelectionAtLine(lineNumber);
bool drawSelected = ColumnRange.WholeColumn.Equals(selectionRange2) || firstFolding.StartColumn >= selectionRange2.StartColumn && firstFolding.EndColumn <= selectionRange2.EndColumn; bool drawSelected = ColumnRange.WholeColumn.Equals(selectionRange2) || firstFolding.StartColumn >= selectionRange2.StartColumn && firstFolding.EndColumn <= selectionRange2.EndColumn;

16
src/Libraries/NRefactory/Project/Src/PrettyPrinter/SpecialNodesInserter.cs

@ -71,13 +71,23 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
available = enumerator.MoveNext(); available = enumerator.MoveNext();
} }
AttributedNode currentAttributedNode;
/// <summary> /// <summary>
/// Writes all specials up to the start position of the node. /// Writes all specials up to the start position of the node.
/// </summary> /// </summary>
public void AcceptNodeStart(INode node) public void AcceptNodeStart(INode node)
{ {
if (node is AttributedNode) {
currentAttributedNode = node as AttributedNode;
if (currentAttributedNode.Attributes.Count == 0) {
AcceptPoint(node.StartLocation);
currentAttributedNode = null;
}
} else {
AcceptPoint(node.StartLocation); AcceptPoint(node.StartLocation);
} }
}
/// <summary> /// <summary>
/// Writes all specials up to the end position of the node. /// Writes all specials up to the end position of the node.
@ -87,6 +97,12 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
visitor.ForceWriteInPreviousLine = true; visitor.ForceWriteInPreviousLine = true;
AcceptPoint(node.EndLocation); AcceptPoint(node.EndLocation);
visitor.ForceWriteInPreviousLine = false; visitor.ForceWriteInPreviousLine = false;
if (currentAttributedNode != null) {
if (node == currentAttributedNode.Attributes[currentAttributedNode.Attributes.Count - 1]) {
AcceptPoint(currentAttributedNode.StartLocation);
currentAttributedNode = null;
}
}
} }
/// <summary> /// <summary>

13
src/Libraries/NRefactory/Test/Output/SpecialOutputVisitor.cs

@ -205,5 +205,18 @@ End Class");
"\tEnd Sub\n" + "\tEnd Sub\n" +
"End Class"); "End Class");
} }
[Test]
public void ConditionalAttribute()
{
TestProgram("class A\n" +
"{\n" +
"\t#if TEST\n" +
"\t[MyAttribute()]\n" +
"\t#endif\n" +
"\tpublic int Field;\n" +
"}\n" +
"#end if");
}
} }
} }

4
src/Main/Base/Project/Resources/GeneralTextEditorPanel.xfrm

@ -77,10 +77,10 @@
</System.Windows.Forms.ComboBox> </System.Windows.Forms.ComboBox>
<System.Windows.Forms.CheckBox> <System.Windows.Forms.CheckBox>
<Name value="mouseWheelZoomCheckBox" /> <Name value="mouseWheelZoomCheckBox" />
<Location value="192, 109" /> <Location value="{X=182,Y=109}" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.MouseWheelZoomCheckBoxCheckBox}" /> <Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.MouseWheelZoomCheckBoxCheckBox}" />
<TabIndex value="6" /> <TabIndex value="6" />
<Size value="160, 24" /> <Size value="{Width=170, Height=24}" />
<Anchor value="Top, Left, Right" /> <Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox> </System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label> <System.Windows.Forms.Label>

6
src/Main/Base/Project/Resources/MarkersTextEditorPanel.xfrm

@ -16,8 +16,8 @@
<Name value="bracketMatchingStyleComboBox" /> <Name value="bracketMatchingStyleComboBox" />
<Anchor value="Bottom, Right" /> <Anchor value="Bottom, Right" />
<TabIndex value="9" /> <TabIndex value="9" />
<Location value="{X=216,Y=178}" /> <Location value="{X=226,Y=178}" />
<Size value="{Width=168, Height=21}" /> <Size value="{Width=158, Height=21}" />
<DropDownStyle value="DropDownList" /> <DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox> </System.Windows.Forms.ComboBox>
<System.Windows.Forms.ComboBox> <System.Windows.Forms.ComboBox>
@ -48,7 +48,7 @@
<System.Windows.Forms.CheckBox> <System.Windows.Forms.CheckBox>
<Name value="showBracketHighlighterCheckBox" /> <Name value="showBracketHighlighterCheckBox" />
<Location value="{X=8,Y=179}" /> <Location value="{X=8,Y=179}" />
<Size value="{Width=208, Height=24}" /> <Size value="{Width=228, Height=24}" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.Markers.HiglightBracketCheckBox}" /> <Text value="${res:Dialog.Options.IDEOptions.TextEditor.Markers.HiglightBracketCheckBox}" />
<Anchor value="Top, Left, Right" /> <Anchor value="Top, Left, Right" />
<TabIndex value="8" /> <TabIndex value="8" />

15
src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs

@ -71,6 +71,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} }
} }
[Obsolete]
public class TemplateScript public class TemplateScript
{ {
string languageName; string languageName;
@ -150,7 +151,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
List<FileDescriptionTemplate> files = new List<FileDescriptionTemplate>(); List<FileDescriptionTemplate> files = new List<FileDescriptionTemplate>();
List<TemplateProperty> properties = new List<TemplateProperty>(); List<TemplateProperty> properties = new List<TemplateProperty>();
List<TemplateScript> scripts = new List<TemplateScript>();
List<TemplateType> customTypes = new List<TemplateType>(); List<TemplateType> customTypes = new List<TemplateType>();
XmlElement fileoptions = null; XmlElement fileoptions = null;
@ -244,15 +244,17 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} }
} }
[Obsolete]
public List<TemplateScript> Scripts { public List<TemplateScript> Scripts {
get { get {
return scripts; return new List<TemplateScript>();
} }
} }
[Obsolete]
public bool HasScripts { public bool HasScripts {
get { get {
return scripts != null && scripts.Count > 0; return false;
} }
} }
@ -314,13 +316,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
this.files.Add(new FileDescriptionTemplate((XmlElement)filenode, Path.GetDirectoryName(filename))); this.files.Add(new FileDescriptionTemplate((XmlElement)filenode, Path.GetDirectoryName(filename)));
} }
} }
// load scripts (if any)
XmlNodeList scriptList = doc.DocumentElement.SelectNodes("Script");
foreach (XmlElement scriptElement in scriptList) {
this.scripts.Add(new TemplateScript(scriptElement));
}
} }
static FileTemplate() static FileTemplate()

3
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -245,7 +245,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} }
} }
[Conditional("DEBUG")]
internal static void WarnObsoleteNode(XmlElement element, string message) internal static void WarnObsoleteNode(XmlElement element, string message)
{ {
MessageService.ShowWarning("Obsolete node <" + element.Name + MessageService.ShowWarning("Obsolete node <" + element.Name +
@ -253,7 +252,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
"':\n" + message); "':\n" + message);
} }
[Conditional("DEBUG")]
internal static void WarnObsoleteAttribute(XmlElement element, string attribute, string message) internal static void WarnObsoleteAttribute(XmlElement element, string attribute, string message)
{ {
MessageService.ShowWarning("Obsolete attribute <" + element.Name + MessageService.ShowWarning("Obsolete attribute <" + element.Name +
@ -262,7 +260,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
"':\n" + message); "':\n" + message);
} }
[Conditional("DEBUG")]
internal static void WarnAttributeMissing(XmlElement element, string attribute) internal static void WarnAttributeMissing(XmlElement element, string attribute)
{ {
MessageService.ShowWarning("Missing attribute <" + element.Name + MessageService.ShowWarning("Missing attribute <" + element.Name +

37
src/Main/Base/Project/Src/Services/ParserService/DomHostCallback.cs

@ -6,6 +6,8 @@
// </file> // </file>
using System; using System;
using System.IO;
using Microsoft.Win32;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
@ -44,6 +46,13 @@ namespace ICSharpCode.SharpDevelop
}; };
HostCallback.InitializeCodeGeneratorOptions = AmbienceService.InitializeCodeGeneratorOptions; HostCallback.InitializeCodeGeneratorOptions = AmbienceService.InitializeCodeGeneratorOptions;
string dir = WinFXReferenceDirectory;
if (!string.IsNullOrEmpty(dir))
XmlDoc.XmlDocLookupDirectories.Add(dir);
dir = XNAReferenceDirectory;
if (!string.IsNullOrEmpty(dir))
XmlDoc.XmlDocLookupDirectories.Add(dir);
} }
static void ShowAssemblyLoadError(string fileName, string include, string message) static void ShowAssemblyLoadError(string fileName, string include, string message)
@ -56,5 +65,33 @@ namespace ICSharpCode.SharpDevelop
) + "\r\n" + message + "\r\n" ) + "\r\n" + message + "\r\n"
); );
} }
static string WinFXReferenceDirectory {
get {
RegistryKey k = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Communication Foundation");
if (k == null)
return null;
object o = k.GetValue("ReferenceInstallPath");
k.Close();
if (o == null)
return null;
else
return o.ToString();
}
}
static string XNAReferenceDirectory {
get {
RegistryKey k = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\XNA\Game Studio Express\v1.0");
if (k == null)
return null;
object o = k.GetValue("InstallPath");
k.Close();
if (o == null)
return null;
else
return Path.Combine(o.ToString(), @"References\Windows\x86");
}
}
} }
} }

3
src/Main/Base/Test/CollectionClassOverridesTestFixture.cs

@ -95,6 +95,9 @@ namespace ICSharpCode.SharpDevelop.Tests
expectedMethodNames.Add("RemoveItem"); expectedMethodNames.Add("RemoveItem");
expectedMethodNames.Add("SetItem"); expectedMethodNames.Add("SetItem");
methodNames.Sort();
expectedMethodNames.Sort();
Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray()); Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray());
} }

29
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/ReflectionProjectContent.cs

@ -9,7 +9,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using Microsoft.Win32;
using ICSharpCode.SharpDevelop.Dom.ReflectionLayer; using ICSharpCode.SharpDevelop.Dom.ReflectionLayer;
@ -111,16 +110,12 @@ namespace ICSharpCode.SharpDevelop.Dom
} }
string fileName = LookupLocalizedXmlDoc(assemblyLocation); string fileName = LookupLocalizedXmlDoc(assemblyLocation);
// Not found -> look in runtime directory.
if (fileName == null) { if (fileName == null) {
string runtimeDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(); // Not found -> look in other directories:
fileName = LookupLocalizedXmlDoc(Path.Combine(runtimeDirectory, Path.GetFileName(assemblyLocation))); foreach (string testDirectory in XmlDoc.XmlDocLookupDirectories) {
} fileName = LookupLocalizedXmlDoc(Path.Combine(testDirectory, Path.GetFileName(assemblyLocation)));
if (fileName == null) { if (fileName != null)
// still not found -> look in WinFX reference directory break;
string referenceDirectory = WinFXReferenceDirectory;
if (!string.IsNullOrEmpty(referenceDirectory)) {
fileName = LookupLocalizedXmlDoc(Path.Combine(referenceDirectory, Path.GetFileName(assemblyLocation)));
} }
} }
@ -133,20 +128,6 @@ namespace ICSharpCode.SharpDevelop.Dom
} }
} }
static string WinFXReferenceDirectory {
get {
RegistryKey k = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Communication Foundation");
if (k == null)
return null;
object o = k.GetValue("ReferenceInstallPath");
k.Close();
if (o == null)
return null;
else
return o.ToString();
}
}
public void InitializeSpecialClasses() public void InitializeSpecialClasses()
{ {
if (GetClassInternal(VoidClass.VoidName, 0, Language) != null) { if (GetClassInternal(VoidClass.VoidName, 0, Language) != null) {

8
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs

@ -18,6 +18,14 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary> /// </summary>
public sealed class XmlDoc : IDisposable public sealed class XmlDoc : IDisposable
{ {
static readonly List<string> xmlDocLookupDirectories = new List<string>(
new string[] { System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() }
);
public static IList<string> XmlDocLookupDirectories {
get { return xmlDocLookupDirectories; }
}
struct IndexEntry : IComparable<IndexEntry> struct IndexEntry : IComparable<IndexEntry>
{ {
public int HashCode; public int HashCode;

3
src/Main/StartUp/Project/Dialogs/SplashScreen.cs

@ -32,9 +32,6 @@ namespace ICSharpCode.SharpDevelop
public SplashScreenForm() public SplashScreenForm()
{ {
#if !DEBUG
TopMost = true;
#endif
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
ShowInTaskbar = false; ShowInTaskbar = false;

Loading…
Cancel
Save