Browse Source

Merged SD 2.1 r 2432:2454 to trunk.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2455 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
bf5104aba6
  1. 4
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 24
      data/templates/project/AddInWritingHelp.txt
  3. 2
      data/templates/project/CSharp/SharpDevelopAddin.xpt
  4. 2
      data/templates/project/CSharp/SharpDevelopCustomTool.xpt
  5. 2
      data/templates/project/CSharp/SharpDevelopMacro.xpt
  6. 2
      data/templates/project/VBNet/SharpDevelopAddin.xpt
  7. 2
      data/templates/project/VBNet/SharpDevelopMacro.xpt
  8. 1
      src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/CodeCompletionData.boo
  9. 9
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BuildOptions.cs
  10. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
  11. 3
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs
  12. 9
      src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/ApplicationSettingsPanel.cs
  13. 24
      src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/CompilerParametersPanel.cs
  14. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/TypeEditors/ContentEditor.cs
  15. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs
  16. 2
      src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.VisualBasic.targets
  17. 32
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs
  18. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs
  19. 2
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/KeywordList.txt
  20. 2
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs
  21. 1493
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  22. 20
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  23. 4
      src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs
  24. 45
      src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs
  25. 56
      src/Main/Base/Project/Src/Gui/Dialogs/AbstractOptionPanel.cs
  26. 22
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  27. 18
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs
  28. 10
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildEvents.cs
  29. 15
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs
  30. 4
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs
  31. 21
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
  32. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceNode.cs
  33. 4
      src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs
  34. 43
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs
  35. 17
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/CompoundClass.cs
  36. 12
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryResolver.cs

4
AddIns/ICSharpCode.SharpDevelop.addin

@ -623,6 +623,10 @@ @@ -623,6 +623,10 @@
</Path>
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ReferenceNode">
<MenuItem id = "RefreshReference"
icon = "Icons.16x16.BrowserRefresh"
label = "${res:AddIns.HtmlHelp2.Refresh}"
class = "ICSharpCode.SharpDevelop.Project.Commands.RefreshReference"/>
<MenuItem id = "Remove"
label = "${res:Global.RemoveButtonText}"
icon = "Icons.16x16.DeleteIcon"

24
data/templates/project/AddInWritingHelp.txt

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
You have created a new SharpDevelop AddIn project.
We would like to point out that there are three locations where you can get information on how
to write SharpDevelop AddIns:
- http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.AddInWritingTutorials
- The folder "doc/techtones" in the SharpDevelop source code download
- You can ask questions about AddIn development in the SharpDevelop forum:
http://community.sharpdevelop.net/forums/
The next steps:
- First, you have to add references to the SharpDevelop assemblies.
An AddIn will work with the SharpDevelop version it was compiled for, or later service releases.
You might want to compile against SharpDevelop 2.1.0.2429 (the first final release of SharpDevelop 2.1)
to ensure your AddIn runs with all 2.1.x versions.
- Include a <Manifest> section to your .addin for use with the SharpDevelop AddIn Manager.
See SharpDevelop/doc/technotes/AddInManager.rtf for more information.
- Once have published your AddIn on the Internet, please add it to the SharpDevelop wiki to let other users know!
http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.ThirdPartyAddIns
This file serves as a reminder for you on how to find information on SharpDevelop AddIn development, you can
remove it from your project if you don't need it anymore.

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

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.addin"/>
<Open filename = "AddInWritingHelp.txt"/>
</Actions>
<Project language = "C#">
@ -155,6 +156,7 @@ public class TestPad : AbstractPadContent @@ -155,6 +156,7 @@ public class TestPad : AbstractPadContent
}
]]></File>
<File name="Configuration/AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AddInWritingHelp.txt" src="..\AddInWritingHelp.txt"/>
</Files>
</Project>
</Template>

2
data/templates/project/CSharp/SharpDevelopCustomTool.xpt

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.addin"/>
<Open filename = "AddInWritingHelp.txt"/>
</Actions>
<Project language="C#">
@ -185,6 +186,7 @@ namespace ${StandardNamespace} @@ -185,6 +186,7 @@ namespace ${StandardNamespace}
]]></File>
<File name="FileTemplate.xft" src="SharpDevelopCustomToolTemplate.xft.xml" binary="true" CopyToOutputDirectory="Always"/>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AddInWritingHelp.txt" src="..\AddInWritingHelp.txt"/>
</Files>
</Project>
</Template>

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

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.addin"/>
<Open filename = "AddInWritingHelp.txt"/>
</Actions>
<Project language="C#">
@ -98,6 +99,7 @@ namespace ${StandardNamespace} @@ -98,6 +99,7 @@ namespace ${StandardNamespace}
}
]]></File>
<File name="Configuration/AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AddInWritingHelp.txt" src="..\AddInWritingHelp.txt"/>
</Files>
</Project>
</Template>

2
data/templates/project/VBNet/SharpDevelopAddin.xpt

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.addin"/>
<Open filename = "AddInWritingHelp.txt"/>
</Actions>
<Project language="VBNet">
@ -145,6 +146,7 @@ Public Class TestPad @@ -145,6 +146,7 @@ Public Class TestPad
End Class
]]></File>
<File name="Configuration/AssemblyInfo.vb" src="DefaultAssemblyInfo.vb"/>
<File name="AddInWritingHelp.txt" src="..\AddInWritingHelp.txt"/>
</Files>
</Project>
</Template>

2
data/templates/project/VBNet/SharpDevelopMacro.xpt

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.addin"/>
<Open filename = "AddInWritingHelp.txt"/>
</Actions>
<Project language="VBNet">
@ -96,6 +97,7 @@ Inherits AbstractMenuCommand @@ -96,6 +97,7 @@ Inherits AbstractMenuCommand
End Class
]]></File>
<File name="Configuration/AssemblyInfo.vb" src="DefaultAssemblyInfo.vb"/>
<File name="AddInWritingHelp.txt" src="..\AddInWritingHelp.txt"/>
</Files>
</Project>
</Template>

1
src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/CodeCompletionData.boo

@ -115,6 +115,7 @@ internal class GlobalsCompletionDataProvider(ICSharpCode.SharpDevelop.DefaultEdi @@ -115,6 +115,7 @@ internal class GlobalsCompletionDataProvider(ICSharpCode.SharpDevelop.DefaultEdi
def constructor(interpreter as InterpreterContext):
_interpreter = interpreter
super.preSelection = ""
override def GenerateCompletionData(fileName as string, textArea as TextArea, charTyped as System.Char) as (ICompletionData):
globals = _interpreter.GetGlobals()

9
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BuildOptions.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
namespace Grunwald.BooBinding
{
@ -31,15 +32,13 @@ namespace Grunwald.BooBinding @@ -31,15 +32,13 @@ namespace Grunwald.BooBinding
helper.BindBoolean("noCorlibCheckBox", "NoStdLib", false).CreateLocationButton("noCorlibCheckBox");
helper.BindBoolean("duckyCheckBox", "Ducky", false).CreateLocationButton("duckyCheckBox");
helper.BindString("pipelineTextBox", "Pipeline").CreateLocationButton("pipelineLabel");
helper.BindString("pipelineTextBox", "Pipeline", TextBoxEditMode.EditEvaluatedProperty).CreateLocationButton("pipelineLabel");
//InitWarnings();
//
helper.BindString("baseIntermediateOutputPathTextBox", "BaseIntermediateOutputPath").CreateLocationButton("baseIntermediateOutputPathTextBox");
ConnectBrowseFolder("baseIntermediateOutputPathBrowseButton", "baseIntermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
helper.BindString("intermediateOutputPathTextBox", "IntermediateOutputPath").CreateLocationButton("intermediateOutputPathTextBox");
ConnectBrowseFolder("intermediateOutputPathBrowseButton", "intermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
InitBaseIntermediateOutputPath();
InitIntermediateOutputPath();
//
helper.AddConfigurationSelector(this);

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -28,8 +28,7 @@ namespace CSharpBinding.OptionPanels @@ -28,8 +28,7 @@ namespace CSharpBinding.OptionPanels
ConfigurationGuiBinding b;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
b.TreatPropertyValueAsLiteral = false;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants", TextBoxEditMode.EditRawProperty);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("conditionalSymbolsTextBox");

3
src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -21,8 +21,7 @@ namespace VBNetBinding.OptionPanels @@ -21,8 +21,7 @@ namespace VBNetBinding.OptionPanels
ConfigurationGuiBinding b;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
b.TreatPropertyValueAsLiteral = false;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants", TextBoxEditMode.EditRawProperty);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("conditionalSymbolsTextBox");

9
src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/ApplicationSettingsPanel.cs

@ -20,15 +20,14 @@ namespace ICSharpCode.WixBinding @@ -20,15 +20,14 @@ namespace ICSharpCode.WixBinding
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.WixBinding.Resources.ApplicationSettingsPanel.xfrm"));
InitializeHelper();
ConfigurationGuiBinding b;
b = helper.BindString("outputNameTextBox", "OutputName");
b = helper.BindString("outputNameTextBox", "OutputName", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("outputNameTextBox");
Get<TextBox>("outputName").TextChanged += RefreshOutputFileNameTextBox;
ConnectBrowseButton("localizedStringFileBrowseButton", "localizedStringFileTextBox", "${res:ICSharpCode.WixBinding.WixLocalizationFileFilterName} (*.wxl)|*.wxl|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
b = helper.BindString("localizedStringFileTextBox", "LocalizedStringFile");
b.TreatPropertyValueAsLiteral = false;
ConnectBrowseButton("localizedStringFileBrowseButton", "localizedStringFileTextBox", "${res:ICSharpCode.WixBinding.WixLocalizationFileFilterName} (*.wxl)|*.wxl|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty);
b = helper.BindString("localizedStringFileTextBox", "LocalizedStringFile", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("localizedStringFileTextBox");
b = helper.BindEnum<WixOutputType>("outputTypeComboBox", "OutputType");

24
src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/CompilerParametersPanel.cs

@ -21,25 +21,23 @@ namespace ICSharpCode.WixBinding @@ -21,25 +21,23 @@ namespace ICSharpCode.WixBinding
InitializeHelper();
ConfigurationGuiBinding b;
b = helper.BindString("outputPathTextBox", "OutputPath");
b = helper.BindString("outputPathTextBox", "OutputPath", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("outputPathTextBox");
ConnectBrowseFolder("outputPathBrowseButton", "outputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
ConnectBrowseFolder("outputPathBrowseButton", "outputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", TextBoxEditMode.EditRawProperty);
b = helper.BindString("baseOutputPathTextBox", "BaseOutputPath");
b = helper.BindString("baseOutputPathTextBox", "BaseOutputPath", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("baseOutputPathTextBox");
ConnectBrowseFolder("baseOutputPathBrowseButton", "baseOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
ConnectBrowseFolder("baseOutputPathBrowseButton", "baseOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", TextBoxEditMode.EditRawProperty);
b = helper.BindString("intermediateOutputPathTextBox", "IntermediateOutputPath");
b = helper.BindString("intermediateOutputPathTextBox", "IntermediateOutputPath", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("intermediateOutputPathTextBox");
ConnectBrowseFolder("intermediateOutputPathBrowseButton", "intermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
ConnectBrowseFolder("intermediateOutputPathBrowseButton", "intermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", TextBoxEditMode.EditRawProperty);
b = helper.BindString("wixToolPathTextBox", "WixToolPath");
b.TreatPropertyValueAsLiteral = false;
ConnectBrowseFolder("wixToolPathBrowseButton", "wixToolPathTextBox", String.Empty);
b = helper.BindString("wixToolPathTextBox", "WixToolPath", TextBoxEditMode.EditRawProperty);
ConnectBrowseFolder("wixToolPathBrowseButton", "wixToolPathTextBox", String.Empty, TextBoxEditMode.EditRawProperty);
b = helper.BindString("wixMSBuildExtensionsPathTextBox", "WixMSBuildExtensionsPath");
b.TreatPropertyValueAsLiteral = false;
ConnectBrowseFolder("wixMSBuildExtensionsPathBrowseButton", "wixMSBuildExtensionsPathTextBox", String.Empty);
b = helper.BindString("wixMSBuildExtensionsPathTextBox", "WixMSBuildExtensionsPath", TextBoxEditMode.EditRawProperty);
ConnectBrowseFolder("wixMSBuildExtensionsPathBrowseButton", "wixMSBuildExtensionsPathTextBox", String.Empty, TextBoxEditMode.EditRawProperty);
// Add the extension picker in manually since the anchoring does not
// work if we add the picker into the XML of the CompilerParametersPanel.xfrm file.
@ -66,7 +64,7 @@ namespace ICSharpCode.WixBinding @@ -66,7 +64,7 @@ namespace ICSharpCode.WixBinding
new StringPair("2", "2"),
new StringPair("3", "3"));
ChooseStorageLocationButton locationButton = b.CreateLocationButtonInPanel("errorsAndWarningsGroupBox");
b = helper.BindString("suppressWarningsTextBox", "NoWarn");
b = helper.BindString("suppressWarningsTextBox", "NoWarn", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
b = helper.BindBoolean("treatWarningsAsErrorsCheckBox", "TreatWarningsAsErrors", false);

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/TypeEditors/ContentEditor.cs

@ -61,6 +61,8 @@ namespace ICSharpCode.WpfDesign.Designer.Controls.TypeEditors @@ -61,6 +61,8 @@ namespace ICSharpCode.WpfDesign.Designer.Controls.TypeEditors
ContextMenu contextMenu = new ContextMenu();
contextMenu.Items.Add(CreateMenuItem("Set to _null", delegate { property.Value = null; }));
contextMenu.Items.Add(CreateMenuItem("Create _string", delegate { property.Value = ""; }));
contextMenu.Items.Add(CreateMenuItem("Create _Canvas", delegate { property.Value = new Canvas(); }));
contextMenu.Items.Add(CreateMenuItem("Create _Grid", delegate { property.Value = new Grid(); }));
return contextMenu;
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

@ -422,7 +422,7 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -422,7 +422,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
object collectionInstance = null;
XamlProperty collectionProperty = null;
if (propertyInfo.IsCollection) {
if (defaultProperty.FullyQualifiedName == propertyInfo.FullyQualifiedName) {
if (defaultProperty != null && defaultProperty.FullyQualifiedName == propertyInfo.FullyQualifiedName) {
collectionInstance = defaultPropertyValue;
foreach (XamlProperty existing in obj.Properties) {
if (existing.propertyInfo == defaultProperty) {

2
src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.VisualBasic.targets

@ -161,7 +161,7 @@ @@ -161,7 +161,7 @@
<!-- Compact framework property adjustments: -->
<!-- When StdLib is not set, set it to true and add reference to mscorlib -->
<!-- Set PlatformFamilyName and PlatformID if required -->
<PropertyGroup Condition=" '$(SharpDevelopTargetFrameworkClass)' == 'CF' ">
<PropertyGroup Condition=" '$(SharpDevelopUseCompactFramework)' == 'true' ">
<PlatformFamilyName Condition=" '$(PlatformFamilyName)' == '' ">PocketPC</PlatformFamilyName>
<PlatformID Condition=" '$(PlatformID)' == '' ">WinCE</PlatformID>

32
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.TextEditor.Document @@ -42,7 +42,7 @@ namespace ICSharpCode.TextEditor.Document
}
}
public void SetContent(string text)
public void SetContent(string text)
{
if (text == null) {
text = String.Empty;
@ -51,15 +51,27 @@ namespace ICSharpCode.TextEditor.Document @@ -51,15 +51,27 @@ namespace ICSharpCode.TextEditor.Document
gapBeginOffset = gapEndOffset = 0;
}
public char GetCharAt(int offset)
public char GetCharAt(int offset)
{
#if DEBUG
CheckThread();
if (offset < 0 || offset >= Length) {
throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset < " + Length.ToString());
}
#endif
return offset < gapBeginOffset ? buffer[offset] : buffer[offset + GapLength];
}
public string GetText(int offset, int length)
public string GetText(int offset, int length)
{
#if DEBUG
CheckThread();
if (offset < 0 || offset > Length) {
throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + Length.ToString());
}
if (length < 0 || offset + length > Length) {
throw new ArgumentOutOfRangeException("length", length, "0 <= length, offset+length <= " + Length.ToString());
}
#endif
int end = offset + length;
@ -90,12 +102,22 @@ namespace ICSharpCode.TextEditor.Document @@ -90,12 +102,22 @@ namespace ICSharpCode.TextEditor.Document
Replace(offset, length, String.Empty);
}
public void Replace(int offset, int length, string text)
public void Replace(int offset, int length, string text)
{
if (text == null) {
text = String.Empty;
}
#if DEBUG
CheckThread();
if (offset < 0 || offset > Length) {
throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + Length.ToString());
}
if (length < 0 || offset + length > Length) {
throw new ArgumentOutOfRangeException("length", length, "0 <= length, offset+length <= " + Length.ToString());
}
#endif
// Math.Max is used so that if we need to resize the array
// the new array has enough space for all old chars
PlaceGap(offset + length, Math.Max(text.Length - length, 0));
@ -103,7 +125,7 @@ namespace ICSharpCode.TextEditor.Document @@ -103,7 +125,7 @@ namespace ICSharpCode.TextEditor.Document
gapBeginOffset += text.Length - length;
}
void PlaceGap(int offset, int length)
void PlaceGap(int offset, int length)
{
int deltaLength = GapLength - length;
// if the gap has the right length, move the chars between offset and gap

2
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using ICSharpCode.TextEditor.Document;
@ -280,6 +281,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -280,6 +281,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
if (endOffset - startOffset > 0) {
control.Document.Remove(startOffset, endOffset - startOffset);
}
Debug.Assert(startOffset <= document.TextLength);
result = dataProvider.InsertAction(data, control.ActiveTextAreaControl.TextArea, startOffset, ch);
} finally {
control.EndUpdate();

2
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/KeywordList.txt

@ -235,4 +235,4 @@ Null("Nothing") @@ -235,4 +235,4 @@ Null("Nothing")
BlockSucc("Case", "Catch", "Else", "ElseIf", "End", "Finally", "Loop", "Next")
# List of unreserved keywords, must be the same as the "Identifier" production in VBNET.ATG
Unreserved("Text", "Binary", "Compare", "Assembly", "Ansi", "Auto", "Preserve", "Unicode", "Until")
Unreserved("Text", "Binary", "Compare", "Assembly", "Ansi", "Auto", "Preserve", "Unicode", "Until", "Explicit", "Off")

2
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs

@ -235,7 +235,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -235,7 +235,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
}
public static BitArray Null = NewSet(Nothing);
public static BitArray BlockSucc = NewSet(Case, Catch, Else, ElseIf, End, Finally, Loop, Next);
public static BitArray Unreserved = NewSet(Text, Binary, Compare, Assembly, Ansi, Auto, Preserve, Unicode, Until);
public static BitArray Unreserved = NewSet(Text, Binary, Compare, Assembly, Ansi, Auto, Preserve, Unicode, Until, Explicit, Off);
static string[] tokenList = new string[] {
// ----- terminal classes -----

1493
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff

20
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -1532,16 +1532,14 @@ ImplementsClause<out List<InterfaceImplementation> baseInterfaces> @@ -1532,16 +1532,14 @@ ImplementsClause<out List<InterfaceImplementation> baseInterfaces>
.
EventMemberSpecifier<out string name>
(. string type; name = String.Empty; .) =
Identifier (. type = t.val; .)
(. string eventName; .)
=
( Identifier | "MyBase" | "Me" )
(. name = t.val; .)
"."
Identifier (. name = type + "." + t.val; .)
| "MyBase" "."
(
Identifier (. name = "MyBase." + t.val; .)
| "Error" (. name = "MyBase.Error"; .)
)
.
IdentifierOrKeyword<out eventName>
(. name = name + "." + eventName; .)
.
Expr<out Expression expr>
=
@ -2787,6 +2785,8 @@ Identifier = @@ -2787,6 +2785,8 @@ Identifier =
| "Preserve"
| "Unicode"
| "Until"
| "Off"
| "Explicit"
.
IdentifierForFieldDeclaration =
@ -2801,6 +2801,8 @@ IdentifierForFieldDeclaration = @@ -2801,6 +2801,8 @@ IdentifierForFieldDeclaration =
| "Preserve"
| "Unicode"
| "Until"
| "Off"
| "Explicit"
.
/* 2.2 */

4
src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs

@ -48,10 +48,12 @@ namespace ICSharpCode.NRefactory.Tests.Ast @@ -48,10 +48,12 @@ namespace ICSharpCode.NRefactory.Tests.Ast
}
[Test]
public void VBNetAssemblyIdentifierExpressionTest()
public void VBNetContextKeywordsTest()
{
Assert.AreEqual("Assembly", ParseUtilVBNet.ParseExpression<IdentifierExpression>("Assembly").Identifier);
Assert.AreEqual("Custom", ParseUtilVBNet.ParseExpression<IdentifierExpression>("Custom").Identifier);
Assert.AreEqual("Off", ParseUtilVBNet.ParseExpression<IdentifierExpression>("Off").Identifier);
Assert.AreEqual("Explicit", ParseUtilVBNet.ParseExpression<IdentifierExpression>("Explicit").Identifier);
}
#endregion
}

45
src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs

@ -225,32 +225,6 @@ namespace ICSharpCode.NRefactory.Tests.Ast @@ -225,32 +225,6 @@ namespace ICSharpCode.NRefactory.Tests.Ast
#region VB.NET
[Test]
public void VBNetSimpleMethodDeclarationTest()
{
MethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>("void MyMethod() {} ");
Assert.AreEqual("void", md.TypeReference.Type);
Assert.AreEqual(0, md.Parameters.Count);
}
[Test]
public void VBNetSimpleMethodRegionTest()
{
const string program = @"
void MyMethod()
{
OtherMethod();
}
";
MethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(program);
Assert.AreEqual(2, md.StartLocation.Y, "StartLocation.Y");
Assert.AreEqual(2, md.EndLocation.Y, "EndLocation.Y");
Assert.AreEqual(3, md.StartLocation.X, "StartLocation.X");
// endLocation.X is currently 20. It should be 18, but that error is not critical
//Assert.AreEqual(18, md.EndLocation.X, "EndLocation.X");
}
[Test]
public void VBNetMethodWithModifiersRegionTest()
{
@ -346,6 +320,25 @@ End Interface @@ -346,6 +320,25 @@ End Interface
Assert.AreEqual("ISomeInterface", md.Templates[0].Bases[0].Type);
}
[Test]
public void VBNetMethodWithHandlesClause()
{
MethodDeclaration md = ParseUtilVBNet.ParseTypeMember<MethodDeclaration>(
@"Public Sub MyMethod(sender As Object, e As EventArgs) Handles x.y
End Sub");
Assert.AreEqual(new string[] { "x.y" }, md.HandlesClause.ToArray());
md = ParseUtilVBNet.ParseTypeMember<MethodDeclaration>(
@"Public Sub MyMethod() Handles Me.FormClosing
End Sub");
Assert.AreEqual(new string[] { "Me.FormClosing" }, md.HandlesClause.ToArray());
md = ParseUtilVBNet.ParseTypeMember<MethodDeclaration>(
@"Public Sub MyMethod() Handles MyBase.Event, Button1.Click
End Sub");
Assert.AreEqual(new string[] { "MyBase.Event", "Button1.Click" }, md.HandlesClause.ToArray());
}
#endregion
}
}

56
src/Main/Base/Project/Src/Gui/Dialogs/AbstractOptionPanel.cs

@ -10,6 +10,7 @@ using System.Windows.Forms; @@ -10,6 +10,7 @@ using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui
{
@ -94,11 +95,17 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -94,11 +95,17 @@ namespace ICSharpCode.SharpDevelop.Gui
protected string baseDirectory;
[Obsolete("Please specify fileFilter and targetNeedsMSBuildEncoding")]
protected void ConnectBrowseButton(string browseButton, string target)
{
ConnectBrowseButton(browseButton, target, "${res:SharpDevelop.FileFilter.AllFiles}|*.*");
}
[Obsolete("Please specify targetNeedsMSBuildEncoding")]
protected void ConnectBrowseButton(string browseButton, string target, string fileFilter)
{
ConnectBrowseButton(browseButton, target, fileFilter, TextBoxEditMode.EditEvaluatedProperty);
}
protected void ConnectBrowseButton(string browseButton, string target, string fileFilter, TextBoxEditMode textBoxEditMode)
{
if (ControlDictionary[browseButton] == null) {
@ -110,14 +117,24 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -110,14 +117,24 @@ namespace ICSharpCode.SharpDevelop.Gui
MessageService.ShowError(target + " not found!");
return;
}
ControlDictionary[browseButton].Click += new EventHandler(new BrowseButtonEvent(this, target, fileFilter).Event);
ControlDictionary[browseButton].Click += new EventHandler(new BrowseButtonEvent(this, target, fileFilter, textBoxEditMode).Event);
}
[Obsolete("Please specify textBoxEditMode")]
protected void ConnectBrowseFolder(string browseButton, string target)
{
ConnectBrowseFolder(browseButton, target, "${res:Dialog.ProjectOptions.SelectFolderTitle}");
ConnectBrowseFolder(browseButton, target, TextBoxEditMode.EditEvaluatedProperty);
}
[Obsolete("Please specify textBoxEditMode")]
protected void ConnectBrowseFolder(string browseButton, string target, string description)
{
ConnectBrowseFolder(browseButton, target, description, TextBoxEditMode.EditEvaluatedProperty);
}
protected void ConnectBrowseFolder(string browseButton, string target, TextBoxEditMode textBoxEditMode)
{
ConnectBrowseFolder(browseButton, target, "${res:Dialog.ProjectOptions.SelectFolderTitle}", textBoxEditMode);
}
protected void ConnectBrowseFolder(string browseButton, string target, string description, TextBoxEditMode textBoxEditMode)
{
if (ControlDictionary[browseButton] == null) {
MessageService.ShowError(browseButton + " not found!");
@ -128,7 +145,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -128,7 +145,7 @@ namespace ICSharpCode.SharpDevelop.Gui
return;
}
ControlDictionary[browseButton].Click += new EventHandler(new BrowseFolderEvent(this, target, description).Event);
ControlDictionary[browseButton].Click += new EventHandler(new BrowseFolderEvent(this, target, description, textBoxEditMode).Event);
}
protected class BrowseButtonEvent
@ -136,12 +153,20 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -136,12 +153,20 @@ namespace ICSharpCode.SharpDevelop.Gui
AbstractOptionPanel panel;
string target;
string filter;
TextBoxEditMode textBoxEditMode;
[Obsolete("specify textBoxEditMode")]
public BrowseButtonEvent(AbstractOptionPanel panel, string target, string filter)
: this(panel, target, filter, TextBoxEditMode.EditEvaluatedProperty)
{
}
public BrowseButtonEvent(AbstractOptionPanel panel, string target, string filter, TextBoxEditMode textBoxEditMode)
{
this.panel = panel;
this.filter = filter;
this.target = target;
this.textBoxEditMode = textBoxEditMode;
}
public void Event(object sender, EventArgs e)
@ -155,7 +180,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -155,7 +180,11 @@ namespace ICSharpCode.SharpDevelop.Gui
if (panel.baseDirectory != null) {
file = FileUtility.GetRelativePath(panel.baseDirectory, file);
}
panel.ControlDictionary[target].Text = file;
if (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty) {
panel.ControlDictionary[target].Text = file;
} else {
panel.ControlDictionary[target].Text = MSBuildInternals.Escape(file);
}
}
}
}
@ -166,19 +195,30 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -166,19 +195,30 @@ namespace ICSharpCode.SharpDevelop.Gui
AbstractOptionPanel panel;
string target;
string description;
TextBoxEditMode textBoxEditMode;
[Obsolete("Do not use BrowseFolderEvent directly")]
public BrowseFolderEvent(AbstractOptionPanel panel, string target, string description)
: this(panel, target, description, TextBoxEditMode.EditEvaluatedProperty)
{
}
internal BrowseFolderEvent(AbstractOptionPanel panel, string target, string description, TextBoxEditMode textBoxEditMode)
{
this.panel = panel;
this.description = description;
this.target = target;
this.textBoxEditMode = textBoxEditMode;
}
public void Event(object sender, EventArgs e)
{
string startLocation = panel.baseDirectory;
if (startLocation != null) {
startLocation = FileUtility.GetAbsolutePath(startLocation, panel.ControlDictionary[target].Text);
string text = panel.ControlDictionary[target].Text;
if (textBoxEditMode == TextBoxEditMode.EditRawProperty)
text = MSBuildInternals.Unescape(text);
startLocation = FileUtility.GetAbsolutePath(startLocation, text);
}
using (FolderBrowserDialog fdiag = FileService.CreateFolderBrowserDialog(description, startLocation)) {
@ -189,7 +229,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -189,7 +229,11 @@ namespace ICSharpCode.SharpDevelop.Gui
}
if (!path.EndsWith("\\") && !path.EndsWith("/"))
path += "\\";
panel.ControlDictionary[target].Text = path;
if (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty) {
panel.ControlDictionary[target].Text = path;
} else {
panel.ControlDictionary[target].Text = MSBuildInternals.Escape(path);
}
}
}
}

22
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -22,9 +22,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -22,9 +22,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
helper.BindString(Get<TextBox>("baseIntermediateOutputPath"),
"BaseIntermediateOutputPath",
TextBoxEditMode.EditRawProperty,
delegate { return @"obj\"; }
).CreateLocationButton("baseIntermediateOutputPathTextBox");
ConnectBrowseFolder("baseIntermediateOutputPathBrowseButton", "baseIntermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
ConnectBrowseFolder("baseIntermediateOutputPathBrowseButton", "baseIntermediateOutputPathTextBox",
"${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}",
TextBoxEditMode.EditRawProperty);
}
protected void InitIntermediateOutputPath()
@ -32,6 +35,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -32,6 +35,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
ConfigurationGuiBinding binding = helper.BindString(
Get<TextBox>("intermediateOutputPath"),
"IntermediateOutputPath",
TextBoxEditMode.EditRawProperty,
delegate {
return Path.Combine(helper.GetProperty("BaseIntermediateOutputPath", @"obj\", true),
helper.Configuration);
@ -39,19 +43,23 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -39,19 +43,23 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
);
binding.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
binding.CreateLocationButton("intermediateOutputPathTextBox");
ConnectBrowseFolder("intermediateOutputPathBrowseButton", "intermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
ConnectBrowseFolder("intermediateOutputPathBrowseButton",
"intermediateOutputPathTextBox",
"${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}",
TextBoxEditMode.EditRawProperty);
}
protected void InitOutputPath()
{
helper.BindString("outputPathTextBox", "OutputPath").CreateLocationButton("outputPathTextBox");
ConnectBrowseFolder("outputPathBrowseButton", "outputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
helper.BindString("outputPathTextBox", "OutputPath", TextBoxEditMode.EditRawProperty)
.CreateLocationButton("outputPathTextBox");
ConnectBrowseFolder("outputPathBrowseButton", "outputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", TextBoxEditMode.EditRawProperty);
}
protected void InitXmlDoc()
{
ConfigurationGuiBinding b;
b = helper.BindString("xmlDocumentationTextBox", "DocumentationFile");
b = helper.BindString("xmlDocumentationTextBox", "DocumentationFile", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("xmlDocumentationCheckBox");
helper.Loaded += XmlDocHelperLoaded;
XmlDocHelperLoaded(null, null);
@ -88,13 +96,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -88,13 +96,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
new StringPair("3", "3"),
new StringPair("4", "4"));
ChooseStorageLocationButton locationButton = b.CreateLocationButtonInPanel("warningsGroupBox");
b = helper.BindString("suppressWarningsTextBox", "NoWarn");
b = helper.BindString("suppressWarningsTextBox", "NoWarn", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
b = new WarningsAsErrorsBinding(this);
helper.AddBinding("TreatWarningsAsErrors", b);
locationButton = b.CreateLocationButtonInPanel("treatWarningsAsErrorsGroupBox");
b = helper.BindString("specificWarningsTextBox", "WarningsAsErrors"); // must be saved AFTER TreatWarningsAsErrors
b = helper.BindString("specificWarningsTextBox", "WarningsAsErrors", TextBoxEditMode.EditEvaluatedProperty); // must be saved AFTER TreatWarningsAsErrors
b.RegisterLocationButton(locationButton);
EventHandler setDirty = delegate {

18
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs

@ -23,32 +23,36 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -23,32 +23,36 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
InitializeHelper();
ConnectBrowseButton("applicationIconBrowseButton", "applicationIconComboBox", "${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
ConnectBrowseButton("applicationIconBrowseButton", "applicationIconComboBox",
"${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
// TODO: Suitable file filter.
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileComboBox");
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileComboBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
ConfigurationGuiBinding b;
ChooseStorageLocationButton locationButton;
b = helper.BindString("assemblyNameTextBox", "AssemblyName");
b = helper.BindString("assemblyNameTextBox", "AssemblyName", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("assemblyNameTextBox");
Get<TextBox>("assemblyName").TextChanged += new EventHandler(RefreshOutputNameTextBox);
b = helper.BindString("rootNamespaceTextBox", "RootNamespace");
b = helper.BindString("rootNamespaceTextBox", "RootNamespace", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("rootNamespaceTextBox");
b = helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType");
locationButton = b.CreateLocationButton("outputTypeComboBox");
Get<ComboBox>("outputType").SelectedIndexChanged += new EventHandler(RefreshOutputNameTextBox);
b = helper.BindString("startupObjectComboBox", "StartupObject");
b = helper.BindString("startupObjectComboBox", "StartupObject", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
b = helper.BindString("applicationIconComboBox", "ApplicationIcon");
b = helper.BindString("applicationIconComboBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty);
Get<ComboBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconComboBoxTextChanged);
b.CreateLocationButton("applicationIconComboBox");
b = helper.BindString("win32ResourceFileComboBox", "Win32Resource");
b = helper.BindString("win32ResourceFileComboBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("win32ResourceFileComboBox");
Get<TextBox>("projectFolder").Text = project.Directory;

10
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildEvents.cs

@ -22,17 +22,19 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -22,17 +22,19 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
ConnectBrowseButton("preBuildEventBrowseButton",
"preBuildEventTextBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*");
"${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditRawProperty);
ConnectBrowseButton("postBuildEventBrowseButton",
"postBuildEventTextBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*");
"${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditRawProperty);
ConfigurationGuiBinding b;
b = helper.BindString("preBuildEventTextBox", "PreBuildEvent");
b = helper.BindString("preBuildEventTextBox", "PreBuildEvent", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("preBuildEventTextBox");
b = helper.BindString("postBuildEventTextBox", "PostBuildEvent");
b = helper.BindString("postBuildEventTextBox", "PostBuildEvent", TextBoxEditMode.EditRawProperty);
b.CreateLocationButton("postBuildEventTextBox");
b = helper.BindEnum<RunPostBuildEvent>("runPostBuildEventComboBox", "RunPostBuildEvent");

15
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs

@ -17,8 +17,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -17,8 +17,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public override void LoadPanelContents()
{
SetupFromXmlResource("ProjectOptions.DebugOptions.xfrm");
ConnectBrowseButton("startExternalProgramBrowseButton", "startExternalProgramTextBox", "${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe;*.com;*.pif;*.bat;*.cmd");
ConnectBrowseFolder("workingDirectoryBrowseButton", "workingDirectoryTextBox");
ConnectBrowseButton("startExternalProgramBrowseButton", "startExternalProgramTextBox",
"${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe;*.com;*.pif;*.bat;*.cmd",
TextBoxEditMode.EditEvaluatedProperty);
ConnectBrowseFolder("workingDirectoryBrowseButton", "workingDirectoryTextBox",
TextBoxEditMode.EditEvaluatedProperty);
InitializeHelper();
@ -32,20 +35,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -32,20 +35,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
locationButton = b.CreateLocationButtonInPanel("startActionGroupBox");
b = helper.BindString("startExternalProgramTextBox", "StartProgram");
b = helper.BindString("startExternalProgramTextBox", "StartProgram", TextBoxEditMode.EditEvaluatedProperty);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.RegisterLocationButton(locationButton);
b = helper.BindString("startBrowserInURLTextBox", "StartURL");
b = helper.BindString("startBrowserInURLTextBox", "StartURL", TextBoxEditMode.EditEvaluatedProperty);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.RegisterLocationButton(locationButton);
Get<RadioButton>("startExternalProgram").CheckedChanged += UpdateEnabledStates;
Get<RadioButton>("startBrowserInURL").CheckedChanged += UpdateEnabledStates;
b = helper.BindString("commandLineArgumentsTextBox", "StartArguments");
b = helper.BindString("commandLineArgumentsTextBox", "StartArguments", TextBoxEditMode.EditEvaluatedProperty);
locationButton = b.CreateLocationButtonInPanel("startOptionsGroupBox");
b = helper.BindString("workingDirectoryTextBox", "StartWorkingDirectory");
b = helper.BindString("workingDirectoryTextBox", "StartWorkingDirectory", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
UpdateEnabledStates(this, EventArgs.Empty);

4
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
keyFile = Get<ComboBox>("keyFile");
b = helper.BindString(keyFile, "AssemblyOriginatorKeyFile");
b = helper.BindString(keyFile, "AssemblyOriginatorKeyFile", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
FindKeys(baseDirectory);
if (keyFile.Text.Length > 0) {
@ -96,7 +96,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -96,7 +96,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
void BrowseKeyFile()
{
keyFile.SelectedIndex = -1;
new BrowseButtonEvent(this, "keyFileComboBox", "${res:SharpDevelop.FileFilter.KeyFiles} (" + KeyFileExtensions + ")|" + KeyFileExtensions + "|${res:SharpDevelop.FileFilter.AllFiles}|*.*").Event(this, EventArgs.Empty);
new BrowseButtonEvent(this, "keyFileComboBox", "${res:SharpDevelop.FileFilter.KeyFiles} (" + KeyFileExtensions + ")|" + KeyFileExtensions + "|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty).Event(this, EventArgs.Empty);
}
void CreateKeyFile()

21
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs

@ -94,7 +94,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -94,7 +94,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
credential = dialog.Credential;
} else {
retry = false;
}
}
}
} else {
throw ex;
@ -117,7 +117,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -117,7 +117,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
// Do not overwrite existing web references.
refDialog.WebReference.Name = WebReference.GetReferenceName(refDialog.WebReference.WebReferencesDirectory, refDialog.WebReference.Name);
refDialog.WebReference.Save();
foreach (ProjectItem item in refDialog.WebReference.Items) {
ProjectService.AddProjectItem(node.Project, item);
}
@ -129,7 +129,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -129,7 +129,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
node.Project.Save();
}
}
}
}
}
@ -178,4 +178,19 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -178,4 +178,19 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
return webReferencesNode;
}
}
public class RefreshReference : AbstractMenuCommand
{
public override void Run()
{
ReferenceNode node = Owner as ReferenceNode;
if (node != null)
{
ReferenceProjectItem item = node.ReferenceProjectItem;
if (item != null) {
ParserService.RefreshProjectContentForReference(item);
}
}
}
}
}

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceNode.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Project
public ReferenceProjectItem ReferenceProjectItem {
get {
return ReferenceProjectItem;
return referenceProjectItem;
}
}

4
src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs

@ -41,6 +41,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -41,6 +41,10 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
/// <summary>
/// Gets if the value should be evaluated when loading the property and escaped
/// when saving. The default value is true.
/// </summary>
public bool TreatPropertyValueAsLiteral {
get { return treatPropertyValueAsLiteral; }
set { treatPropertyValueAsLiteral = value; }

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

@ -17,6 +17,26 @@ using ICSharpCode.SharpDevelop.Gui; @@ -17,6 +17,26 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Specifies whether the user enters the property value or the MSBuild code for
/// the property value.
/// </summary>
public enum TextBoxEditMode
{
/// <summary>
/// The user edits the MSBuild property value. It is not evaluated on loading,
/// and not escaped when saving.
/// The user can use MSBuild properties with $() in the text box.
/// </summary>
EditRawProperty,
/// <summary>
/// The user edits the property. When loading the value, it is evaluated;
/// when saving the value, it is escaped.
/// The user cannot use MSBuild properties with $() because the $ will be escaped.
/// </summary>
EditEvaluatedProperty
}
/// <summary>
/// Class that helps connecting configuration GUI controls to MsBuild properties.
/// </summary>
@ -232,20 +252,37 @@ namespace ICSharpCode.SharpDevelop.Project @@ -232,20 +252,37 @@ namespace ICSharpCode.SharpDevelop.Project
#region Bind string to TextBox or ComboBox
static Func<string> GetEmptyString = delegate { return ""; };
[Obsolete("Please explicitly specify textBoxEditMode")]
public ConfigurationGuiBinding BindString(string control, string property)
{
return BindString(controlDictionary[control], property, GetEmptyString);
return BindString(controlDictionary[control], property, TextBoxEditMode.EditEvaluatedProperty, GetEmptyString);
}
[Obsolete("Please explicitly specify textBoxEditMode")]
public ConfigurationGuiBinding BindString(Control control, string property)
{
return BindString(control, property, GetEmptyString);
return BindString(control, property, TextBoxEditMode.EditEvaluatedProperty, GetEmptyString);
}
public ConfigurationGuiBinding BindString(Control control, string property, Func<string> defaultValueProvider)
public ConfigurationGuiBinding BindString(string control, string property, TextBoxEditMode textBoxEditMode)
{
return BindString(controlDictionary[control], property, textBoxEditMode, GetEmptyString);
}
public ConfigurationGuiBinding BindString(Control control, string property, TextBoxEditMode textBoxEditMode)
{
return BindString(control, property, textBoxEditMode, GetEmptyString);
}
public ConfigurationGuiBinding BindString(Control control, string property, TextBoxEditMode textBoxEditMode, Func<string> defaultValueProvider)
{
if (control is TextBoxBase || control is ComboBox) {
SimpleTextBinding binding = new SimpleTextBinding(control, defaultValueProvider);
if (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty) {
binding.TreatPropertyValueAsLiteral = true;
} else {
binding.TreatPropertyValueAsLiteral = false;
}
AddBinding(property, binding);
control.TextChanged += ControlValueChanged;
if (control is ComboBox) {

17
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/CompoundClass.cs

@ -35,8 +35,10 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -35,8 +35,10 @@ namespace ICSharpCode.SharpDevelop.Dom
/// <summary>
/// Creates a new CompoundClass with the specified class as first part.
/// </summary>
public CompoundClass(IClass firstPart) : base(firstPart.CompilationUnit, firstPart.FullyQualifiedName)
public CompoundClass(IClass firstPart) : base(new DefaultCompilationUnit(firstPart.ProjectContent), firstPart.FullyQualifiedName)
{
this.CompilationUnit.Classes.Add(this);
parts.Add(firstPart);
UpdateInformationFromParts();
}
@ -48,15 +50,23 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -48,15 +50,23 @@ namespace ICSharpCode.SharpDevelop.Dom
{
// Common for all parts:
this.ClassType = parts[0].ClassType;
this.CompilationUnit.FileName = parts[0].CompilationUnit.FileName;
this.Region = parts[0].Region;
ModifierEnum modifier = ModifierEnum.None;
const ModifierEnum defaultClassVisibility = ModifierEnum.Internal;
this.BaseTypes.Clear();
this.Attributes.Clear();
string shortestFileName = null;
foreach (IClass part in parts) {
if (!string.IsNullOrEmpty(part.CompilationUnit.FileName)) {
if (shortestFileName == null || part.CompilationUnit.FileName.Length < shortestFileName.Length) {
shortestFileName = part.CompilationUnit.FileName;
this.Region = part.Region;
}
}
if ((part.Modifiers & ModifierEnum.VisibilityMask) != defaultClassVisibility) {
modifier |= part.Modifiers;
} else {
@ -71,6 +81,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -71,6 +81,7 @@ namespace ICSharpCode.SharpDevelop.Dom
this.Attributes.Add(attribute);
}
}
this.CompilationUnit.FileName = shortestFileName;
if ((modifier & ModifierEnum.VisibilityMask) == ModifierEnum.None) {
modifier |= defaultClassVisibility;
}

12
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryResolver.cs

@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
IClass callingClass;
IMember callingMember;
ICSharpCode.NRefactory.Visitors.LookupTableVisitor lookupTableVisitor;
IProjectContent projectContent = null;
IProjectContent projectContent;
NR.SupportedLanguage language;
@ -41,6 +41,8 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -41,6 +41,8 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
return projectContent;
}
set {
if (value == null)
throw new ArgumentNullException("value");
projectContent = value;
}
}
@ -1012,6 +1014,8 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -1012,6 +1014,8 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
IClass GetPrimitiveClass(string systemType, string newName)
{
IClass c = projectContent.GetClass(systemType, 0);
if (c == null)
return null;
DefaultClass c2 = new DefaultClass(c.CompilationUnit, newName);
c2.ClassType = c.ClassType;
c2.Modifiers = c.Modifiers;
@ -1030,14 +1034,16 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -1030,14 +1034,16 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
if (language == NR.SupportedLanguage.VBNet) {
foreach (KeyValuePair<string, string> pair in TypeReference.PrimitiveTypesVB) {
if ("System." + pair.Key != pair.Value) {
result.Add(GetPrimitiveClass(pair.Value, pair.Key));
IClass c = GetPrimitiveClass(pair.Value, pair.Key);
if (c != null) result.Add(c);
}
}
result.Add("Global");
result.Add("New");
} else {
foreach (KeyValuePair<string, string> pair in TypeReference.PrimitiveTypesCSharp) {
result.Add(GetPrimitiveClass(pair.Value, pair.Key));
IClass c = GetPrimitiveClass(pair.Value, pair.Key);
if (c != null) result.Add(c);
}
}
ParseInformation parseInfo = HostCallback.GetParseInformation(fileName);

Loading…
Cancel
Save