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

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

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

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

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

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

@ -569,7 +569,7 @@ namespace ICSharpCode.StartPage @@ -569,7 +569,7 @@ namespace ICSharpCode.StartPage
public void RenderSectionAuthorBody(StringBuilder builder)
{
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 @@ -610,7 +610,7 @@ namespace ICSharpCode.StartPage
public void RenderSectionHelpWantedBody(StringBuilder builder)
{
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 +
// Path.DirectorySeparatorChar + ".." +

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

@ -250,8 +250,12 @@ namespace ICSharpCode.Build.Tasks @@ -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();
AppendSwitch(b, "o", realLogFile);
AppendSwitch(b, "f", inputAssembly);
@ -274,6 +278,9 @@ namespace ICSharpCode.Build.Tasks @@ -274,6 +278,9 @@ namespace ICSharpCode.Build.Tasks
AppendSwitch(b, "ruleid", rule);
}
}
#if DEBUG
Console.WriteLine(b.ToString());
#endif
return b.ToString();
}
}

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

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

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

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

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

@ -205,5 +205,18 @@ End Class"); @@ -205,5 +205,18 @@ End Class");
"\tEnd Sub\n" +
"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 @@ @@ -77,10 +77,10 @@
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.CheckBox>
<Name value="mouseWheelZoomCheckBox" />
<Location value="192, 109" />
<Location value="{X=182,Y=109}" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.MouseWheelZoomCheckBoxCheckBox}" />
<TabIndex value="6" />
<Size value="160, 24" />
<Size value="{Width=170, Height=24}" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label>

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

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
<Name value="bracketMatchingStyleComboBox" />
<Anchor value="Bottom, Right" />
<TabIndex value="9" />
<Location value="{X=216,Y=178}" />
<Size value="{Width=168, Height=21}" />
<Location value="{X=226,Y=178}" />
<Size value="{Width=158, Height=21}" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.ComboBox>
@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
<System.Windows.Forms.CheckBox>
<Name value="showBracketHighlighterCheckBox" />
<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}" />
<Anchor value="Top, Left, Right" />
<TabIndex value="8" />

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

@ -71,6 +71,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -71,6 +71,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
[Obsolete]
public class TemplateScript
{
string languageName;
@ -150,7 +151,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -150,7 +151,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
List<FileDescriptionTemplate> files = new List<FileDescriptionTemplate>();
List<TemplateProperty> properties = new List<TemplateProperty>();
List<TemplateScript> scripts = new List<TemplateScript>();
List<TemplateType> customTypes = new List<TemplateType>();
XmlElement fileoptions = null;
@ -244,15 +244,17 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -244,15 +244,17 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
[Obsolete]
public List<TemplateScript> Scripts {
get {
return scripts;
return new List<TemplateScript>();
}
}
[Obsolete]
public bool HasScripts {
get {
return scripts != null && scripts.Count > 0;
return false;
}
}
@ -314,13 +316,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -314,13 +316,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
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()

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

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

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

@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
// </file>
using System;
using System.IO;
using Microsoft.Win32;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
@ -44,6 +46,13 @@ namespace ICSharpCode.SharpDevelop @@ -44,6 +46,13 @@ namespace ICSharpCode.SharpDevelop
};
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)
@ -56,5 +65,33 @@ namespace ICSharpCode.SharpDevelop @@ -56,5 +65,33 @@ namespace ICSharpCode.SharpDevelop
) + "\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 @@ -95,6 +95,9 @@ namespace ICSharpCode.SharpDevelop.Tests
expectedMethodNames.Add("RemoveItem");
expectedMethodNames.Add("SetItem");
methodNames.Sort();
expectedMethodNames.Sort();
Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray());
}

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

@ -9,7 +9,6 @@ using System; @@ -9,7 +9,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Microsoft.Win32;
using ICSharpCode.SharpDevelop.Dom.ReflectionLayer;
@ -111,16 +110,12 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -111,16 +110,12 @@ namespace ICSharpCode.SharpDevelop.Dom
}
string fileName = LookupLocalizedXmlDoc(assemblyLocation);
// Not found -> look in runtime directory.
if (fileName == null) {
string runtimeDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();
fileName = LookupLocalizedXmlDoc(Path.Combine(runtimeDirectory, Path.GetFileName(assemblyLocation)));
}
if (fileName == null) {
// still not found -> look in WinFX reference directory
string referenceDirectory = WinFXReferenceDirectory;
if (!string.IsNullOrEmpty(referenceDirectory)) {
fileName = LookupLocalizedXmlDoc(Path.Combine(referenceDirectory, Path.GetFileName(assemblyLocation)));
// Not found -> look in other directories:
foreach (string testDirectory in XmlDoc.XmlDocLookupDirectories) {
fileName = LookupLocalizedXmlDoc(Path.Combine(testDirectory, Path.GetFileName(assemblyLocation)));
if (fileName != null)
break;
}
}
@ -133,20 +128,6 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -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()
{
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 @@ -18,6 +18,14 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
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>
{
public int HashCode;

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

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

Loading…
Cancel
Save