Browse Source

Merged SD 2.1 r 2454:2479 to trunk.

Fixed LocalCopy settings for references to ICSharpCode.Core in AddIns, use GlobalAssemblyInfo.cs for SharpServerTools projects.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2480 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
f5f7a99a04
  1. 10
      samples/SdaUser/SdaAddIns/SdaBase.addin
  2. 9
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerLoader.cs
  3. 4
      src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorTypeMembers.cs
  4. 8
      src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Test/MemberTests.cs
  5. 2
      src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj
  6. 1
      src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.csproj
  7. 2
      src/AddIns/DisplayBindings/ClassDiagram/ClassEditor/ClassEditor.csproj
  8. 5
      src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/ClassWizard.csproj
  9. 2
      src/AddIns/Misc/CodeAnalysis/CodeAnalysis.csproj
  10. 29
      src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.addin
  11. 1
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj
  12. 1
      src/AddIns/Misc/ComponentInspector/ComponentInspector/ComponentInspector.csproj
  13. 4
      src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Debugger.BooInterpreter.csproj
  14. 16
      src/AddIns/Misc/SharpServerTools/DataTools.Model/Configuration/AssemblyInfo.cs
  15. 3
      src/AddIns/Misc/SharpServerTools/DataTools.Model/DataTools.Model.csproj
  16. 16
      src/AddIns/Misc/SharpServerTools/DataTools.UI/Configuration/AssemblyInfo.cs
  17. 3
      src/AddIns/Misc/SharpServerTools/DataTools.UI/DataTools.UI.csproj
  18. 6
      src/AddIns/Misc/SharpServerTools/ServerBrowserTool/ServerBrowserTool.csproj
  19. 16
      src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Configuration/AssemblyInfo.cs
  20. 7
      src/AddIns/Misc/SharpServerTools/SharpDbTools/DataTools.AddIn.csproj
  21. 2
      src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin
  22. 68
      src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs
  23. 9
      src/AddIns/Misc/UnitTesting/UnitTesting.csproj
  24. 142
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/Selection/SelectionManager.cs
  25. 9
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
  26. 51
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs
  27. 32
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs
  28. 23
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
  29. 9
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  30. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs
  31. 30
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs
  32. 19
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPanel.cs
  33. 2
      src/Main/Base/Project/Src/Project/CustomTool.cs
  34. 29
      src/Main/Base/Project/Src/Project/Items/TypeLibrary.cs
  35. 26
      src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs

10
samples/SdaUser/SdaAddIns/SdaBase.addin

@ -14,12 +14,12 @@ @@ -14,12 +14,12 @@
<Import assembly=":ICSharpCode.SharpDevelop">
<!-- SharpDevelop defines more conditions and doozers, we just -->
<!-- import those we need here. -->
<ConditionEvaluator name="WindowActive" class="ICSharpCode.Core.WindowActiveConditionEvaluator"/>
<ConditionEvaluator name="ActiveWindowState" class="ICSharpCode.Core.ActiveWindowStateConditionEvaluator"/>
<ConditionEvaluator name="OpenWindowState" class="ICSharpCode.Core.OpenWindowStateConditionEvaluator"/>
<ConditionEvaluator name="WindowActive" class="ICSharpCode.SharpDevelop.WindowActiveConditionEvaluator"/>
<ConditionEvaluator name="ActiveWindowState" class="ICSharpCode.SharpDevelop.ActiveWindowStateConditionEvaluator"/>
<ConditionEvaluator name="OpenWindowState" class="ICSharpCode.SharpDevelop.OpenWindowStateConditionEvaluator"/>
<Doozer name="DialogPanel" class="ICSharpCode.Core.DialogPanelDoozer"/>
<Doozer name="DisplayBinding" class="ICSharpCode.Core.DisplayBindingDoozer"/>
<Doozer name="DialogPanel" class="ICSharpCode.SharpDevelop.DialogPanelDoozer"/>
<Doozer name="DisplayBinding" class="ICSharpCode.SharpDevelop.DisplayBindingDoozer"/>
</Import>
</Runtime>

9
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerLoader.cs

@ -79,9 +79,18 @@ namespace Grunwald.BooBinding.Designer @@ -79,9 +79,18 @@ namespace Grunwald.BooBinding.Designer
{
this.loading = true;
typeResolutionService = (ITypeResolutionService)host.GetService(typeof(ITypeResolutionService));
this.designerLoaderHost = host;
base.BeginLoad(host);
}
protected override void Initialize()
{
CodeDomLocalizationProvider localizationProvider = new CodeDomLocalizationProvider(designerLoaderHost, CodeDomLocalizationModel.PropertyAssignment);
IDesignerSerializationManager manager = (IDesignerSerializationManager)designerLoaderHost.GetService(typeof(IDesignerSerializationManager));
manager.AddSerializationProvider(localizationProvider);
base.Initialize();
}
protected override void OnEndLoad(bool successful, System.Collections.ICollection errors)
{
this.loading = false;

4
src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorTypeMembers.cs

@ -195,7 +195,7 @@ namespace NRefactoryToBooConverter @@ -195,7 +195,7 @@ namespace NRefactoryToBooConverter
m.Getter = new B.Method(GetLexicalInfo(propertyDeclaration.GetRegion));
if (propertyDeclaration.GetRegion != null) {
ConvertAttributes(propertyDeclaration.GetRegion.Attributes, m.Getter.Attributes);
m.Modifiers = ConvertModifier(propertyDeclaration.GetRegion, m.Visibility);
m.Getter.Modifiers = ConvertModifier(propertyDeclaration.GetRegion, B.TypeMemberModifiers.None);
m.Getter.Body = ConvertMethodBlock(propertyDeclaration.GetRegion.Block);
m.Getter.ReturnType = m.Type;
}
@ -204,7 +204,7 @@ namespace NRefactoryToBooConverter @@ -204,7 +204,7 @@ namespace NRefactoryToBooConverter
m.Setter = new B.Method(GetLexicalInfo(propertyDeclaration.SetRegion));
if (propertyDeclaration.SetRegion != null) {
ConvertAttributes(propertyDeclaration.SetRegion.Attributes, m.Setter.Attributes);
m.Modifiers = ConvertModifier(propertyDeclaration.SetRegion, m.Visibility);
m.Setter.Modifiers = ConvertModifier(propertyDeclaration.SetRegion, B.TypeMemberModifiers.None);
m.Setter.Body = ConvertMethodBlock(propertyDeclaration.SetRegion.Block);
}
}

8
src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Test/MemberTests.cs

@ -228,7 +228,13 @@ namespace NRefactoryToBooConverter.Tests @@ -228,7 +228,13 @@ namespace NRefactoryToBooConverter.Tests
}
[Test]
[Ignore("Fix requires change to Boo.Lang.Compiler.dll")]
public void PropertyWithProtectedSetter()
{
TestInClass("public string Text { get {} protected set { } }",
"public Text as System.String:\n\tget:\n\t\tpass\n\tprotected set:\n\t\tpass");
}
[Test]
public void AbstractProperty()
{
TestInClass("public abstract string Prop { get; }", "public abstract Prop as System.String:\n\tget:\n\t\tpass");

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

@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>True</Private>
<Private>False</Private>
</ProjectReference>
<Content Include="Templates\EmptyWixProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

1
src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.csproj

@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>

2
src/AddIns/DisplayBindings/ClassDiagram/ClassEditor/ClassEditor.csproj

@ -55,6 +55,7 @@ @@ -55,6 +55,7 @@
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\TreeViewAdv\Aga.Controls\Aga.Controls.csproj">
<Project>{E73BB233-D88B-44A7-A98F-D71EE158381D}</Project>
@ -78,6 +79,7 @@ @@ -78,6 +79,7 @@
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project>
<Name>ICSharpCode.SharpDevelop.Widgets</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />

5
src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/ClassWizard.csproj

@ -64,22 +64,27 @@ @@ -64,22 +64,27 @@
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project>
<Name>ICSharpCode.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj">
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project>
<Name>ICSharpCode.SharpDevelop.Dom</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />

2
src/AddIns/Misc/CodeAnalysis/CodeAnalysis.csproj

@ -81,10 +81,12 @@ @@ -81,10 +81,12 @@
<ProjectReference Include="..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project>
<Name>ICSharpCode.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj">
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project>

29
src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.addin

@ -1,31 +1,34 @@ @@ -1,31 +1,34 @@
<AddIn name="ComponentInspectorAddIn"
author="Matt Ward"
<AddIn name="ComponentInspectorAddIn"
author="Matt Ward"
url="http://oaklandsoftware.com/"
copyright="prj:///doc/copyright.txt"
description="Component Inspector AddIn for SharpDevelop">
<Manifest>
<Identity name="ICSharpCode.ComponentInspector"/>
</Manifest>
<Runtime>
<Condition name = "Compare" string = "${Platform}" equals = "Win64">
<DisableAddIn message = "This AddIn does not work when SharpDevelop runs as 64-bit process."/>
</Condition>
<Import assembly="ComponentInspector.AddIn.dll"/>
</Runtime>
<Path name="/Workspace/Tools">
<MenuItem id="ShowComponentInspector"
insertafter="ShowAddInScout"
label="${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}"
label="${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}"
class="ICSharpCode.ComponentInspector.AddIn.ShowComponentInspectorCommand"/>
</Path>
<Path name="/SharpDevelop/Workbench/MainMenu">
<Condition name="WindowActive" activewindow="ICSharpCode.ComponentInspector.AddIn.ComponentInspectorView">
<MenuItem id="ComponentInspector"
insertafter="Tools"
insertbefore="Window"
label="${res:ComponentInspector.MainMenu.InspectorMenu}"
type="Menu">
<MenuItem id="ComponentInspector"
insertafter="Tools"
insertbefore="Window"
label="${res:ComponentInspector.MainMenu.InspectorMenu}"
type="Menu">
<MenuItem id="OpenAssembly"
label="${res:ComponentInspector.InspectorMenu.OpenAssembly}"
class="ICSharpCode.ComponentInspector.AddIn.OpenAssemblyCommand"/>
@ -39,7 +42,7 @@ @@ -39,7 +42,7 @@
</MenuItem>
</Condition>
</Path>
<Path name = "/SharpDevelop/Dialogs/OptionsDialog">
<DialogPanel id="ComponentInspectorOptions"
label="${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}"

1
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj

@ -203,6 +203,7 @@ @@ -203,6 +203,7 @@
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />

1
src/AddIns/Misc/ComponentInspector/ComponentInspector/ComponentInspector.csproj

@ -56,6 +56,7 @@ @@ -56,6 +56,7 @@
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<Folder Include="Resources" />
</ItemGroup>

4
src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Debugger.BooInterpreter.csproj

@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
<Reference Include="Boo.Lang.Interpreter">
<HintPath>..\..\..\..\BackendBindings\Boo\RequiredLibraries\Boo.Lang.Interpreter.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<Private>False</Private>
</Reference>
<Reference Include="Boo.Lang">
<HintPath>..\..\..\..\BackendBindings\Boo\RequiredLibraries\Boo.Lang.dll</HintPath>
@ -80,10 +80,12 @@ @@ -80,10 +80,12 @@
<ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />

16
src/AddIns/Misc/SharpServerTools/DataTools.Model/Configuration/AssemblyInfo.cs

@ -11,21 +11,5 @@ using System.Runtime.InteropServices; @@ -11,21 +11,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DataTools.Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataTools.Model")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

3
src/AddIns/Misc/SharpServerTools/DataTools.Model/DataTools.Model.csproj

@ -44,6 +44,9 @@ @@ -44,6 +44,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\ColumnNames.cs" />
<Compile Include="Src\DbModelInfo.cs" />

16
src/AddIns/Misc/SharpServerTools/DataTools.UI/Configuration/AssemblyInfo.cs

@ -11,21 +11,5 @@ using System.Runtime.InteropServices; @@ -11,21 +11,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DataTools.UI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataTools.UI")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

3
src/AddIns/Misc/SharpServerTools/DataTools.UI/DataTools.UI.csproj

@ -42,6 +42,9 @@ @@ -42,6 +42,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\ConnectionStringDefinitionDialog.cs" />
<Compile Include="Src\ConnectionStringDefinitionDialog.Designer.cs" />

6
src/AddIns/Misc/SharpServerTools/ServerBrowserTool/ServerBrowserTool.csproj

@ -36,10 +36,12 @@ @@ -36,10 +36,12 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Src\Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Src\Forms\ISupportsDragDrop.cs" />
<Compile Include="Src\Forms\ServerToolTreeView.cs" />
<Compile Include="Src\Forms\IInitializable.cs" />
@ -61,10 +63,12 @@ @@ -61,10 +63,12 @@
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<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" />

16
src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Configuration/AssemblyInfo.cs

@ -17,21 +17,5 @@ using System.Runtime.InteropServices; @@ -17,21 +17,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ServerBrowserTool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ServerBrowserTool")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

7
src/AddIns/Misc/SharpServerTools/SharpDbTools/DataTools.AddIn.csproj

@ -36,13 +36,15 @@ @@ -36,13 +36,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Src\Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Src\Configuration\AssemblyInfo.cs" />
<Compile Include="Src\Forms.TextEditor\SQLTextEditorControl.cs" />
<Compile Include="Src\Forms\SQLTool.cs" />
@ -78,14 +80,17 @@ @@ -78,14 +80,17 @@
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project>
<Name>ICSharpCode.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\DataTools.Model\DataTools.Model.csproj">
<Project>{51783FC4-D8D2-4BFB-A1F1-AC8857CF3ED0}</Project>

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

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<Runtime>
<Condition name = "Compare" string = "${Platform}" equals = "Win64">
<DisableAddIn message = "This AddIn does not work in the x64 Edition of Windows."/>
<DisableAddIn message = "This AddIn does not work when SharpDevelop runs as 64-bit process."/>
</Condition>
<Import assembly = "SubversionAddIn.dll">
<ConditionEvaluator name="SubversionState" class="ICSharpCode.Svn.SubversionStateCondition"/>

68
src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
@ -32,6 +33,8 @@ namespace ICSharpCode.Svn.Commands @@ -32,6 +33,8 @@ namespace ICSharpCode.Svn.Commands
FileService.FileRenaming += FileRenaming;
FileService.FileCreated += FileCreated;
ProjectService.ProjectAdded += ProjectAdded;
FileUtility.FileSaved += new FileNameEventHandler(FileSaved);
AbstractProjectBrowserTreeNode.AfterNodeInitialize += TreeNodeInitialized;
}
@ -44,6 +47,71 @@ namespace ICSharpCode.Svn.Commands @@ -44,6 +47,71 @@ namespace ICSharpCode.Svn.Commands
node.AcceptVisitor(visitor, null);
}
void ProjectAdded(object sender, ProjectEventArgs e)
{
if (!AddInOptions.AutomaticallyAddFiles) return;
if (!CanBeVersionControlledFile(e.Project.Directory)) return;
string projectDir = Path.GetFullPath(e.Project.Directory);
try {
Status status = SvnClient.Instance.Client.SingleStatus(projectDir);
if (status.TextStatus != StatusKind.Unversioned)
return;
SvnClient.Instance.Client.Add(projectDir, Recurse.None);
if (FileUtility.IsBaseDirectory(Path.Combine(projectDir, "bin"), e.Project.OutputAssemblyFullPath)) {
AddToIgnoreList(projectDir, "bin");
}
CompilableProject compilableProject = e.Project as CompilableProject;
if (compilableProject != null) {
if (FileUtility.IsBaseDirectory(Path.Combine(projectDir, "obj"), compilableProject.IntermediateOutputFullPath)) {
AddToIgnoreList(projectDir, "obj");
}
}
foreach (ProjectItem item in e.Project.Items) {
FileProjectItem fileItem = item as FileProjectItem;
if (fileItem != null) {
if (FileUtility.IsBaseDirectory(projectDir, fileItem.FileName)) {
AddFileWithParentDirectoriesToSvn(fileItem.FileName);
}
}
}
AddFileWithParentDirectoriesToSvn(e.Project.FileName);
} catch (Exception ex) {
MessageService.ShowError("Project add exception: " + ex);
}
}
void AddFileWithParentDirectoriesToSvn(string fileName)
{
if (!CanBeVersionControlledFile(fileName)) {
AddFileWithParentDirectoriesToSvn(FileUtility.GetAbsolutePath(fileName, ".."));
}
Status status = SvnClient.Instance.Client.SingleStatus(fileName);
if (status.TextStatus != StatusKind.Unversioned)
return;
SvnClient.Instance.Client.Add(fileName, Recurse.None);
}
void AddToIgnoreList(string directory, string file)
{
PropertyDictionary pd = SvnClient.Instance.Client.PropGet("svn:ignore", directory, Revision.Working, Recurse.None);
StringBuilder b = new StringBuilder();
foreach (Property p in pd.Values) {
using (StreamReader r = new StreamReader(new MemoryStream(p.Data))) {
string line;
while ((line = r.ReadLine()) != null) {
if (line.Length > 0) {
b.AppendLine(line);
}
}
}
break;
}
b.AppendLine(file);
SvnClient.Instance.Client.PropSet(new Property("svn:ignore", b.ToString()),
directory, Recurse.None);
}
internal static bool CanBeVersionControlledFile(string fileName)
{
return CanBeVersionControlledDirectory(Path.GetDirectoryName(fileName));

9
src/AddIns/Misc/UnitTesting/UnitTesting.csproj

@ -94,6 +94,11 @@ @@ -94,6 +94,11 @@
<Compile Include="Src\TestMethodEventArgs.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
@ -116,10 +121,6 @@ @@ -116,10 +121,6 @@
<Private>False</Private>
</ProjectReference>
<Folder Include="Resources" />
<ProjectReference Include="..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

142
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/Selection/SelectionManager.cs

@ -154,11 +154,17 @@ namespace ICSharpCode.TextEditor.Document @@ -154,11 +154,17 @@ namespace ICSharpCode.TextEditor.Document
public void ExtendSelection(Point oldPosition, Point newPosition)
{
if (oldPosition == newPosition) {
// where oldposition is where the cursor was,
// and newposition is where it has ended up from a click (both zero based)
if (oldPosition == newPosition)
{
return;
}
Point min;
Point max;
int oldnewX = newPosition.X;
bool oldIsGreater = GreaterEqPos(oldPosition, newPosition);
if (oldIsGreater) {
min = newPosition;
@ -167,104 +173,59 @@ namespace ICSharpCode.TextEditor.Document @@ -167,104 +173,59 @@ namespace ICSharpCode.TextEditor.Document
min = oldPosition;
max = newPosition;
}
if (min == max) {
return;
}
if (!HasSomethingSelected) {
SetSelection(new DefaultSelection(document, min, max));
return;
}
ISelection selection = this.selectionCollection[0];
bool changed = false;
if (selection.ContainsPosition(newPosition)) {
if (oldIsGreater) {
if (selection.EndPosition != newPosition) {
selection.EndPosition = newPosition;
changed = true;
}
} else {
if (selection.StartPosition != newPosition) {
// we're back to the line we started from and it was a gutter selection
if (selectFrom.where == WhereFrom.Gutter && newPosition.Y >= selectionStart.Y)
{
selection.StartPosition = selectionStart;
selection.EndPosition = NextValidPosition(selection.StartPosition.Y);
} else {
selection.StartPosition = newPosition;
}
changed = true;
}
}
if (min == max) {
//selection.StartPosition = newPosition;
return;
} else {
if (oldPosition == selection.StartPosition) {
if (GreaterEqPos(newPosition, selection.EndPosition)) {
if (selection.StartPosition != selection.EndPosition ||
selection.EndPosition != newPosition) {
selection.StartPosition = selection.EndPosition;
selection.EndPosition = newPosition;
changed = true;
}
} else {
if (selection.StartPosition != newPosition) {
selection.StartPosition = newPosition;
changed = true;
}
}
} else {
if (GreaterEqPos(selection.StartPosition, newPosition)) {
if (selection.EndPosition != selection.StartPosition ||
selection.StartPosition != newPosition) {
changed = true;
}
if (selectFrom.where == WhereFrom.Gutter)
{
if (selectFrom.first == WhereFrom.Gutter)
{
if(newPosition.Y == selectionStart.Y) {
selection.EndPosition = NextValidPosition(selection.StartPosition.Y);
selection.StartPosition = new Point(0, newPosition.Y);
} else {
selection.EndPosition = NextValidPosition(selection.StartPosition.Y);
selection.StartPosition = newPosition;
}
} else {
if(newPosition.Y == selectionStart.Y) {
selection.EndPosition = NextValidPosition(selection.StartPosition.Y);
selection.StartPosition = new Point(selectionStart.X, newPosition.Y);
} else {
selection.EndPosition = new Point(selectionStart.X, selection.StartPosition.Y);
selection.StartPosition = newPosition;
}
}
} else {
selection.EndPosition = selection.StartPosition;
selection.StartPosition = newPosition;
}
changed = true;
} else {
if (selection.EndPosition != newPosition) {
// changed selection via gutter
if (selectFrom.where == WhereFrom.Gutter) {
// selection new position is always at the left edge for gutter selections
newPosition.X = 0;
}
if (newPosition.Y >= selectionStart.Y) {
// selecting down
if(GreaterEqPos(newPosition, selectionStart)) {
selection.StartPosition = selectionStart;
// this handles last line selection
//if( textArea.Document.TotalNumberOfLines - 1 == newPosition.Y)
if (selectFrom.where == WhereFrom.Gutter ) //&& newPosition.Y != oldPosition.Y)
//selection.EndPosition = NextValidPosition(newPosition.Y - 1);
selection.EndPosition = new Point(textArea.Caret.Column, textArea.Caret.Line);
else {
newPosition.X = oldnewX;
selection.EndPosition = newPosition;
changed = true;
}
} else { // generally this occurs if the selection is on the same line, at a point less than the start position
selection.StartPosition = newPosition;
selection.EndPosition = selectionStart;
}
} else { // selecting up
if (selectFrom.where == WhereFrom.Gutter && selectFrom.first == WhereFrom.Gutter) {
// gutter selection
selection.EndPosition = NextValidPosition(selectionStart.Y);
} else { // internal text selection
selection.EndPosition = selectionStart; //selection.StartPosition;
}
selection.StartPosition = newPosition;
}
}
// if (GreaterEqPos(selection.StartPosition, min) && GreaterEqPos(selection.EndPosition, max)) {
// if (oldIsGreater) {
// selection.StartPosition = min;
// } else {
// selection.StartPosition = max;
// }
// } else {
// if (oldIsGreater) {
// selection.EndPosition = min;
// } else {
// selection.EndPosition = max;
// }
// }
if (changed) {
document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, min.Y, max.Y));
document.CommitUpdate();
OnSelectionChanged(EventArgs.Empty);
}
document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, min.Y, max.Y));
document.CommitUpdate();
OnSelectionChanged(EventArgs.Empty);
}
// retrieve the next available line
@ -299,8 +260,9 @@ namespace ICSharpCode.TextEditor.Document @@ -299,8 +260,9 @@ namespace ICSharpCode.TextEditor.Document
// positions because it is always called before a new selection
selectFrom.first = selectFrom.where;
selectionStart = textArea.TextView.GetLogicalPosition(mousepos.X - textArea.TextView.DrawingPosition.X, mousepos.Y - textArea.TextView.DrawingPosition.Y);
if(selectFrom.where == WhereFrom.Gutter)
if(selectFrom.where == WhereFrom.Gutter) {
selectionStart.X = 0;
}
ClearWithoutUpdate();
document.CommitUpdate();
@ -364,7 +326,7 @@ namespace ICSharpCode.TextEditor.Document @@ -364,7 +326,7 @@ namespace ICSharpCode.TextEditor.Document
{
return GetSelectionAt(offset) != null;
}
/// <remarks>
/// Returns a <see cref="ISelection"/> object giving the selection in which
/// the offset points to.

9
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs

@ -442,7 +442,14 @@ namespace ICSharpCode.TextEditor @@ -442,7 +442,14 @@ namespace ICSharpCode.TextEditor
lastMouseInMargin = null;
}
if (textView.DrawingPosition.Contains(e.X, e.Y)) {
this.Cursor = textView.Cursor;
Point realmousepos = TextView.GetLogicalPosition(e.X - TextView.DrawingPosition.X, e.Y - TextView.DrawingPosition.Y);
if(SelectionManager.IsSelected(Document.PositionToOffset(realmousepos)) && MouseButtons == MouseButtons.None) {
// mouse is hovering over a selection, so show default mouse
this.Cursor = Cursors.Default;
} else {
// mouse is hovering over text area, not a selection, so show the textView cursor
this.Cursor = textView.Cursor;
}
return;
}
this.Cursor = Cursors.Default;

51
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs

@ -143,15 +143,14 @@ namespace ICSharpCode.TextEditor @@ -143,15 +143,14 @@ namespace ICSharpCode.TextEditor
void TextAreaMouseMove(object sender, MouseEventArgs e)
{
Point mousepos = textArea.mousepos;
textArea.mousepos = e.Location; //textArea.mousepos;
// honour the starting selection strategy
switch (textArea.SelectionManager.selectFrom.where)
{
case WhereFrom.Gutter:
//moveGutter(sender, e);
ExtendSelectionToMouse();
break;
return;
case WhereFrom.TArea:
break;
@ -167,8 +166,8 @@ namespace ICSharpCode.TextEditor @@ -167,8 +166,8 @@ namespace ICSharpCode.TextEditor
textArea.mousepos = new Point(e.X, e.Y);
if (clickedOnSelectedText) {
if (Math.Abs(mousedownpos.X - mousepos.X) >= SystemInformation.DragSize.Width / 2 ||
Math.Abs(mousedownpos.Y - mousepos.Y) >= SystemInformation.DragSize.Height / 2)
if (Math.Abs(mousedownpos.X - e.X) >= SystemInformation.DragSize.Width / 2 ||
Math.Abs(mousedownpos.Y - e.Y) >= SystemInformation.DragSize.Height / 2)
{
clickedOnSelectedText = false;
ISelection selection = textArea.SelectionManager.GetSelectionAt(textArea.Caret.Offset);
@ -220,30 +219,11 @@ namespace ICSharpCode.TextEditor @@ -220,30 +219,11 @@ namespace ICSharpCode.TextEditor
textArea.Caret.Position = textArea.SelectionManager.NextValidPosition(realmousepos.Y);
}
}
else
else {
textArea.Caret.Position = realmousepos;
if (minSelection != nilPoint && textArea.SelectionManager.SelectionCollection.Count > 0) {
// Extend selection when selection was started with double-click
ISelection selection = textArea.SelectionManager.SelectionCollection[0];
Point min = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? maxSelection : minSelection;
Point max = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? minSelection : maxSelection;
if (textArea.SelectionManager.GreaterEqPos(max, realmousepos) && textArea.SelectionManager.GreaterEqPos(realmousepos, min)) {
textArea.SelectionManager.SetSelection(min, max);
} else if (textArea.SelectionManager.GreaterEqPos(max, realmousepos)) {
//textArea.SelectionManager.SetSelection(realmousepos, max);
int moff = textArea.Document.PositionToOffset(realmousepos);
min = textArea.Document.OffsetToPosition(FindWordStart(textArea.Document, moff));
textArea.SelectionManager.SetSelection(min, max);
} else {
//textArea.SelectionManager.SetSelection(min, realmousepos);
int moff = textArea.Document.PositionToOffset(realmousepos);
max = textArea.Document.OffsetToPosition(FindWordEnd(textArea.Document, moff));
textArea.SelectionManager.SetSelection(min, max);
}
} else {
textArea.SelectionManager.ExtendSelection(oldPos, textArea.Caret.Position);
}
textArea.SelectionManager.ExtendSelection(oldPos, textArea.Caret.Position);
textArea.SetDesiredColumn();
}
@ -278,7 +258,9 @@ namespace ICSharpCode.TextEditor @@ -278,7 +258,9 @@ namespace ICSharpCode.TextEditor
break;
}
textArea.Caret.Position = maxSelection;
textArea.SelectionManager.ExtendSelection(minSelection, maxSelection);
}
// HACK WARNING !!!
// must refresh here, because when a error tooltip is showed and the underlined
@ -289,12 +271,12 @@ namespace ICSharpCode.TextEditor @@ -289,12 +271,12 @@ namespace ICSharpCode.TextEditor
}
}
DateTime lastTime = DateTime.Now;
void OnMouseDown(object sender, MouseEventArgs e)
{
Point mousepos;
mousepos = textArea.mousepos;
textArea.mousepos = e.Location;
mousepos = e.Location;
if (dodragdrop)
{
@ -311,6 +293,7 @@ namespace ICSharpCode.TextEditor @@ -311,6 +293,7 @@ namespace ICSharpCode.TextEditor
textArea.SelectionManager.selectFrom.where = WhereFrom.TArea;
button = e.Button;
// double-click
if (button == MouseButtons.Left && (DateTime.Now - lastTime).Milliseconds < SystemInformation.DoubleClickTime) {
int deltaX = Math.Abs(lastmousedownpos.X - e.X);
int deltaY = Math.Abs(lastmousedownpos.Y - e.Y);
@ -319,6 +302,15 @@ namespace ICSharpCode.TextEditor @@ -319,6 +302,15 @@ namespace ICSharpCode.TextEditor
DoubleClickSelectionExtend();
lastTime = DateTime.Now;
lastmousedownpos = new Point(e.X, e.Y);
if(minSelection != nilPoint && maxSelection != nilPoint) {
textArea.SelectionManager.SelectionCollection[0].StartPosition = minSelection;
textArea.SelectionManager.SelectionCollection[0].EndPosition = maxSelection;
textArea.SelectionManager.selectionStart = minSelection;
minSelection = nilPoint;
maxSelection = nilPoint;
}
return;
}
}
@ -454,6 +446,7 @@ namespace ICSharpCode.TextEditor @@ -454,6 +446,7 @@ namespace ICSharpCode.TextEditor
return;
}
textArea.SelectionManager.selectFrom.where = WhereFrom.TArea;
doubleclick = true;
}

32
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

@ -374,14 +374,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -374,14 +374,7 @@ namespace ICSharpCode.SharpDevelop.Gui
ExtTreeNode node = GetNodeAt(clientcoordinate) as ExtTreeNode;
if (node != null) {
DragDropEffects effect = DragDropEffects.None;
if ((e.KeyState & 8) > 0) { // CTRL key pressed.
effect = DragDropEffects.Copy;
} else {
effect = DragDropEffects.Move;
}
e.Effect = node.GetDragDropEffect(e.Data, effect);
HandleDragOver(e, node);
if (e.Effect != DragDropEffects.None) {
SelectedNode = node;
@ -389,6 +382,18 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -389,6 +382,18 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
void HandleDragOver(DragEventArgs e, ExtTreeNode node)
{
DragDropEffects effect = DragDropEffects.None;
if ((e.KeyState & 8) > 0) { // CTRL key pressed.
effect = DragDropEffects.Copy;
} else {
effect = DragDropEffects.Move;
}
e.Effect = node.GetDragDropEffect(e.Data, effect);
}
protected override void OnDragDrop(DragEventArgs e)
{
base.OnDragDrop(e);
@ -396,8 +401,15 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -396,8 +401,15 @@ namespace ICSharpCode.SharpDevelop.Gui
ExtTreeNode node = GetNodeAt(clientcoordinate) as ExtTreeNode;
if (node != null) {
node.DoDragDrop(e.Data, e.Effect);
SortParentNodes(node);
// when dragging very fast from one node to another, it's possible that
// OnDragDrop raises without OnDragOver for the node.
// So we have to call HandleDragOver to ensure that we don't call DoDragDrop for
// invalid operations.
HandleDragOver(e, node);
if (e.Effect != DragDropEffects.None) {
node.DoDragDrop(e.Data, e.Effect);
SortParentNodes(node);
}
}
}

23
src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs

@ -405,22 +405,25 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -405,22 +405,25 @@ namespace ICSharpCode.SharpDevelop.Gui
createdFiles.Add(new KeyValuePair<string, FileDescriptionTemplate>(parsedFileName, newfile));
}
internal static string GenerateValidClassName(string className)
internal static string GenerateValidClassOrNamespaceName(string className, bool allowDot)
{
int idx = 0;
while (idx < className.Length && className[idx] != '_' && !Char.IsLetter(className[idx])) {
++idx;
}
if (className == null)
throw new ArgumentNullException("className");
className = className.Trim();
if (className.Length == 0)
return string.Empty;
StringBuilder nameBuilder = new StringBuilder();
for (; idx < className.Length; ++idx) {
if (className[0] != '_' && !char.IsLetter(className, 0))
nameBuilder.Append('_');
for (int idx = 0; idx < className.Length; ++idx) {
if (Char.IsLetterOrDigit(className[idx]) || className[idx] == '_') {
nameBuilder.Append(className[idx]);
}
if (className[idx] == ' ' || className[idx] == '-' ) {
} else if (className[idx] == '.' && allowDot) {
nameBuilder.Append('.');
} else {
nameBuilder.Append('_');
}
}
return nameBuilder.ToString();
}
@ -467,7 +470,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -467,7 +470,7 @@ namespace ICSharpCode.SharpDevelop.Gui
StringParser.Properties["Extension"] = Path.GetExtension(fileName);
StringParser.Properties["Path"] = Path.GetDirectoryName(fileName);
StringParser.Properties["ClassName"] = GenerateValidClassName(Path.GetFileNameWithoutExtension(fileName));
StringParser.Properties["ClassName"] = GenerateValidClassOrNamespaceName(Path.GetFileNameWithoutExtension(fileName), false);
if (item.Template.WizardPath != null) {

9
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -34,6 +34,15 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -34,6 +34,15 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
protected bool createNewSolution;
public string InitialProjectLocationDirectory {
get {
return ((TextBox)ControlDictionary["locationTextBox"]).Text;
}
set {
((TextBox)ControlDictionary["locationTextBox"]).Text = value;
}
}
public NewProjectDialog(bool createNewSolution)
{
StandardHeader.SetHeaders();

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs

@ -177,6 +177,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -177,6 +177,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.AddExtension = true;
string[] fileFilters = (string[])(AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter").BuildChildItems(this)).ToArray(typeof(string));
fdiag.InitialDirectory = node.Directory;
fdiag.FilterIndex = GetFileFilterIndex(node.Project, fileFilters);
fdiag.Filter = String.Join("|", fileFilters);
fdiag.Multiselect = true;
@ -230,6 +231,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -230,6 +231,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
if (res == 2) {
return;
}
// only continue for res==0 (Copy)
}
bool replaceAll = false;
foreach (KeyValuePair<string, string> pair in fileNames) {

30
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs

@ -22,6 +22,9 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -22,6 +22,9 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
ISolutionFolderNode solutionFolderNode = node as ISolutionFolderNode;
if (node != null) {
using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);
// show the dialog to request project type and name
if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
if (npdlg.NewProjectLocation.Length == 0) {
MessageService.ShowError("No project has been created, there is nothing to add.");
@ -33,6 +36,32 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -33,6 +36,32 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
}
}
internal static string GetInitialDirectorySuggestion(ISolutionFolderNode solutionFolderNode)
{
// Detect the correct folder to place the new project in:
int projectCount = 0;
string initialDirectory = null;
foreach (ISolutionFolder folderEntry in solutionFolderNode.Container.Folders) {
IProject project = folderEntry as IProject;
if (project != null) {
if (projectCount == 0)
initialDirectory = project.Directory;
else
initialDirectory = FileUtility.GetCommonBaseDirectory(initialDirectory, project.Directory);
projectCount++;
}
}
if (initialDirectory != null) {
if (projectCount == 1) {
return FileUtility.GetAbsolutePath(initialDirectory, "..");
} else {
return initialDirectory;
}
} else {
return solutionFolderNode.Solution.Directory;
}
}
}
public class AddExitingProjectToSolution : AbstractMenuCommand
@ -62,6 +91,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -62,6 +91,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.Filter = ProjectService.GetAllProjectsFilter(this);
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
fdiag.InitialDirectory = AddNewProjectToSolution.GetInitialDirectorySuggestion(solutionFolderNode);
if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
foreach (string fileName in fdiag.FileNames) {
AddProject(solutionFolderNode, fileName);

19
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPanel.cs

@ -45,14 +45,16 @@ namespace ICSharpCode.SharpDevelop.Project @@ -45,14 +45,16 @@ namespace ICSharpCode.SharpDevelop.Project
projectBrowserControl.Dock = DockStyle.Fill;
Controls.Add(projectBrowserControl);
toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard");
toolStrip.ShowItemToolTips = true;
toolStrip.Dock = DockStyle.Top;
toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
toolStrip.Stretch = true;
standardItems = new ToolStripItem[toolStrip.Items.Count];
toolStrip.Items.CopyTo(standardItems, 0);
Controls.Add(toolStrip);
if (AddInTree.ExistsTreeNode("/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard")) {
toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard");
toolStrip.ShowItemToolTips = true;
toolStrip.Dock = DockStyle.Top;
toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
toolStrip.Stretch = true;
standardItems = new ToolStripItem[toolStrip.Items.Count];
toolStrip.Items.CopyTo(standardItems, 0);
Controls.Add(toolStrip);
}
projectBrowserControl.TreeView.BeforeSelect += TreeViewBeforeSelect;
}
@ -63,6 +65,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -63,6 +65,7 @@ namespace ICSharpCode.SharpDevelop.Project
void UpdateToolStrip(AbstractProjectBrowserTreeNode node)
{
if (toolStrip == null) return;
toolStrip.Items.Clear();
toolStrip.Items.AddRange(standardItems);
ToolbarService.UpdateToolbar(toolStrip);

2
src/Main/Base/Project/Src/Project/CustomTool.cs

@ -438,7 +438,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -438,7 +438,7 @@ namespace ICSharpCode.SharpDevelop.Project
if (subdir.Equals("source", StringComparison.OrdinalIgnoreCase))
continue;
standardNameSpace.Append('.');
standardNameSpace.Append(NewFileDialog.GenerateValidClassName(subdir));
standardNameSpace.Append(NewFileDialog.GenerateValidClassOrNamespaceName(subdir, true));
}
return standardNameSpace.ToString();
}

29
src/Main/Base/Project/Src/Project/Items/TypeLibrary.cs

@ -103,7 +103,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -103,7 +103,12 @@ namespace ICSharpCode.SharpDevelop.Project
get {
RegistryKey typeLibsKey = Registry.ClassesRoot.OpenSubKey("TypeLib");
foreach (string typeLibKeyName in typeLibsKey.GetSubKeyNames()) {
RegistryKey typeLibKey = typeLibsKey.OpenSubKey(typeLibKeyName);
RegistryKey typeLibKey = null;
try {
typeLibKey = typeLibsKey.OpenSubKey(typeLibKeyName);
} catch (System.Security.SecurityException) {
// ignore type libraries that cannot be read from the registry
}
if (typeLibKey == null) {
continue;
}
@ -151,7 +156,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -151,7 +156,7 @@ namespace ICSharpCode.SharpDevelop.Project
RegistryKey win32Key = NullKey.OpenSubKey("win32");
return win32Key == null || win32Key.GetValue(null) == null ? null : GetTypeLibPath(win32Key.GetValue(null).ToString());
}
}
}
return null;
}
@ -168,7 +173,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -168,7 +173,7 @@ namespace ICSharpCode.SharpDevelop.Project
string GetTypeLibName()
{
string name = null;
int typeLibLcid;
if (guid != null && lcid != null && Int32.TryParse(lcid, out typeLibLcid)) {
Guid typeLibGuid = new Guid(this.guid);
@ -226,7 +231,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -226,7 +231,7 @@ namespace ICSharpCode.SharpDevelop.Project
} finally {
Marshal.ReleaseComObject(typeLib);
}
}
}
return null;
}
@ -238,15 +243,15 @@ namespace ICSharpCode.SharpDevelop.Project @@ -238,15 +243,15 @@ namespace ICSharpCode.SharpDevelop.Project
[DllImport("oleaut32.dll")]
static extern int LoadTypeLibEx([MarshalAs(UnmanagedType.BStr)] string szFile,
RegKind regkind,
out ITypeLib pptlib);
RegKind regkind,
out ITypeLib pptlib);
[DllImport("oleaut32.dll")]
static extern int LoadRegTypeLib(
ref Guid rguid,
short wVerMajor,
short wVerMinor,
int lcid,
out ITypeLib pptlib);
static extern int LoadRegTypeLib(
ref Guid rguid,
short wVerMajor,
short wVerMinor,
int lcid,
out ITypeLib pptlib);
}
}

26
src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs

@ -105,6 +105,32 @@ namespace ICSharpCode.Core @@ -105,6 +105,32 @@ namespace ICSharpCode.Core
return path.IndexOf(':') >= 2;
}
public static string GetCommonBaseDirectory(string dir1, string dir2)
{
if (dir1 == null || dir2 == null) return null;
if (IsUrl(dir1) || IsUrl(dir2)) return null;
dir1 = NormalizePath(dir1);
dir2 = NormalizePath(dir2);
string[] aPath = dir1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
string[] bPath = dir2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
StringBuilder result = new StringBuilder();
int indx = 0;
for(; indx < Math.Min(bPath.Length, aPath.Length); ++indx) {
if (bPath[indx].Equals(aPath[indx], StringComparison.OrdinalIgnoreCase)) {
if (result.Length > 0) result.Append(Path.DirectorySeparatorChar);
result.Append(aPath[indx]);
} else {
break;
}
}
if (indx == 0)
return null;
else
return result.ToString();
}
/// <summary>
/// Converts a given absolute path and a given base path to a path that leads
/// from the base path to the absoulte path. (as a relative path)

Loading…
Cancel
Save