Browse Source

Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
pull/521/head
gumme 11 years ago
parent
commit
22ff94b295
  1. 120
      README.md
  2. 74
      README.txt
  3. 7
      SharpDevelop.Tests.sln
  4. 15
      SharpDevelop.sln
  5. 6
      clean.bat
  6. 7
      data/resources/StringResources.resx
  7. 4
      debugbuild.bat
  8. 4
      doc/Dependencies.html
  9. 4
      releasebuild.bat
  10. 2
      src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.addin
  11. 2
      src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport - Kopie.srd
  12. 2
      src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd
  13. 2
      src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd
  14. 2
      src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.addin
  15. 2
      src/AddIns/Analysis/Profiler/Frontend/AddIn/ICSharpCode.Profiler.AddIn.addin
  16. 15
      src/AddIns/Analysis/UnitTesting/Commands/PadCommands.cs
  17. 2
      src/AddIns/Analysis/UnitTesting/Model/ITest.cs
  18. 4
      src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs
  19. 6
      src/AddIns/Analysis/UnitTesting/UnitTesting.addin
  20. 23
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs
  21. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs
  22. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs
  23. 44
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs
  24. 12
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs
  25. 129
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs
  26. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs
  27. 22
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerLoader.cs
  28. 29
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml
  29. 31
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs
  30. 12
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml
  31. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs
  32. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs
  33. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs
  34. 7
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs
  35. 1
      src/AddIns/BackendBindings/FSharpBinding/FSharpInteractive.cs
  36. 2
      src/AddIns/BackendBindings/FSharpBinding/Templates/FSharp3ConsoleProject.xpt
  37. 2
      src/AddIns/BackendBindings/FSharpBinding/Templates/FSharp3LibraryProject.xpt
  38. 2
      src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
  39. 2
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.addin
  40. 13
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin
  41. 3
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
  42. 2
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml
  43. 4
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  44. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.addin
  45. 2
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.addin
  46. 2
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
  47. 4
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/AdornerLayer.cs
  48. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/PanelMoveAdorner.cs
  49. 61
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
  50. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPositionExtension.cs
  51. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/QuickOperationMenuExtension.cs
  52. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RenderTransformOriginExtension.cs
  53. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs
  54. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenuExtension.cs
  55. 19
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RotateThumbExtension.cs
  56. 248
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SkewThumbExtension.cs
  57. 130
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs
  58. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TopLeftContainerDragHandle.cs
  59. 93
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TopLeftContainerDragHandleMultipleItems.cs
  60. 4
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs
  61. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  62. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Adorners/AdornerPanel.cs
  63. 57
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs
  64. 7
      src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs
  65. 49
      src/AddIns/Misc/ICSharpCode.Reporting.Tests/Factory/ReportingFactoryFixture.cs
  66. 96
      src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/LoadPlainModelFixture.cs
  67. 58
      src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/ReportModelFixture.cs
  68. 61
      src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/ReportSettingsFixture.cs
  69. 86
      src/AddIns/Misc/ICSharpCode.Reporting.Tests/TestReports/PlainModel.srd
  70. 1
      src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs
  71. 4
      src/AddIns/Misc/PackageManagement/Project/Src/IPackageExtensions.cs
  72. 23
      src/AddIns/Misc/PackageManagement/Project/Src/ManagePackagesView.xaml
  73. 5
      src/AddIns/Misc/PackageManagement/Project/Src/PackagesViewModel.cs
  74. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/Microsoft.Web.XmlTransform.dll
  75. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Console.Types.dll
  76. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  77. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.exe
  78. 2
      src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj
  79. 34
      src/AddIns/Misc/PackageManagement/Test/Src/AvailablePackagesViewModelTests.cs
  80. 12
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ExceptionThrowingRegisteredPackageRepositories.cs
  81. 55
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestableAvailablepackagesViewModel.cs
  82. 9
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestablePackagesViewModels.cs
  83. 55
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestableRecentPackagesViewModel.cs
  84. 86
      src/AddIns/Misc/PackageManagement/Test/Src/IPackageExtensionsTests.cs
  85. 6
      src/AddIns/Misc/PackageManagement/Test/Src/RecentPackagesViewModelTests.cs
  86. 2
      src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin
  87. 15
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
  88. 62
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/AbstractGraphicItem.cs
  89. 48
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseCircleItem.cs
  90. 42
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseDataItem.cs
  91. 75
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs
  92. 162
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs
  93. 13
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs
  94. 108
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ContainerDesigner.cs
  95. 66
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/DataItemDesigner.cs
  96. 16
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/LineDesigner.cs
  97. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
  98. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportSettingsDesigner.cs
  99. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/RootReportModel.cs
  100. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/SectionDesigner.cs
  101. Some files were not shown because too many files have changed in this diff Show More

120
README.md

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
# #develop (short for SharpDevelop)
##Overview
#develop is a free Integrated Development Environment
(IDE) for C#, VB.NET, Boo, IronPython, IronRuby and F# projects on Microsoft's
.NET platform. It is written (almost) entirely in C#, and comes with features
you would expect in an IDE plus a few more.
The #develop project started on September 11th, 2000. The project was initiated
by Mike Krüger. In the course of the project, several contributors joined in.
If you want to contribute see ["Joining the team"](https://github.com/icsharpcode/SharpDevelop/wiki/Joining-the-Team).
1. [Official Website](http://www.icsharpcode.net/OpenSource/SD/Default.aspx)
2. [Forums](http://community.sharpdevelop.net/forums/)
3. [Build Artefacts (Nightly Builds)](http://build.sharpdevelop.net/BuildArtefacts)
##How To Compile
#Develop can be compiled using the supplied .bat files, or in #Develop itself.
##System Requirements (running #Develop)
- Windows Vista or higher.
- [.NET 4.5](http://www.microsoft.com/en-au/download/details.aspx?id=30653)
- [Visual C++ 2008 SP1 Runtime](http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)
##Extended Requirements (building #Develop)
- [Microsoft Build Tools 2013](www.microsoft.com/en-us/download/details.aspx?id=40760)
- [.NET 3.5 SP1](http://www.microsoft.com/en-au/download/details.aspx?id=22)
- [.NET 4.5 SDK] (part of [Windows SDK 8.0](http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx))
- [Windows SDK 7.1](http://www.microsoft.com/downloads/details.aspx?familyid=6B6C21D2-2006-4AFA-9702-529FA782D63B) (?? not sure if this still is necessary...)
- [Windows SDK 7.0](http://www.microsoft.com/en-us/download/details.aspx?id=3138) (optional; C++ compiler needed for profiler)
- [Windows PowerShell](http://www.microsoft.com/en-us/download/details.aspx?id=34595)
- If you have cloned the SD git repository: git must be available on your PATH
##Libraries and Integrated tools:
* [Avalon Dock](http://avalondock.codeplex.com/) : New BSD License (BSD) (thanks to **Adolfo Marinucci**)
* [Graph#](https://graphsharp.codeplex.com/)
* [IQToolkit](https://iqtoolkit.codeplex.com/)
* [Irony](https://irony.codeplex.com/)
* [ITextSharp](http://sourceforge.net/projects/itextsharp/)
* [log4Net](https://github.com/apache/log4net)
* Mono T4
* [Mono.Cecil](https://github.com/jbevain/cecil): MIT License (thanks to **Jb Evain**)
* [Sharp Svn](https://sharpsvn.open.collab.net/)
* [SQLite](https://sqlite.org/)
* [WPFToolkit](https://wpf.codeplex.com/)
##Integrated Tools (packaged with #Develop):
* [IronPython](http://ironpython.net/)
* [IronRuby](https://ironruby.codeplex.com/)
* [NuGet](https://nuget.codeplex.com/)
* [NUnit](http://www.nunit.org/)
* [OpenCover](https://github.com/OpenCover/opencover)
* [WiX](https://wix.codeplex.com/)
##Reusable Libraries (Part of #Develop):
* [AvalonEdit](http://avalonedit.net/)
* [Debugger.Core](https://github.com/icsharpcode/SharpDevelop/tree/master/src/AddIns/Debugger/Debugger.Core)
* [ICSharpCode.Core](https://github.com/icsharpcode/SharpDevelop/tree/master/src/Main/Core)
* [ICSharpCode.Decompiler](https://github.com/icsharpcode/SharpDevelop/tree/master/src/Libraries/ICSharpCode.Decompiler)
* [NRefactory](https://github.com/icsharpcode/NRefactory)
* [SharpTreeView](https://github.com/icsharpcode/SharpDevelop/tree/master/src/Libraries/SharpTreeView)
* [WPF Designer]( https://github.com/icsharpcode/SharpDevelop/tree/master/src/AddIns/DisplayBindings/WpfDesign)
## #Develop Contributors
###Developers
* [Mike Krüger](https://github.com/mkrueger) (Project Founder)
* [Daniel Grunwald](https://github.com/dgrunwald) (Technical Lead)
* [Andreas Weizel](https://github.com/Rpinski)
* [Matt Ward](https://github.com/mrward)
* [David Srbecky](https://github.com/dsrbecky)(Debugger)
* [Siegfried Pammer](https://github.com/siegfriedpammer)
* [Peter Forstmeier]( https://github.com/PeterForstmeier)(#Develop Reports)
###Non-Developers
* Christoph Wille (PM)
* Bernhard Spuida (Kalfaktor)
###Past Developers (Non-Exhaustive List)
* [Mike Krüger](https://github.com/mkrueger) (Project Founder)
* Alexandre Semenov
* Andrea Paatz
* Christian Hornung
* David Alpert
* Denis ERCHOFF
* Dickon Field
* Georg Brandl
* Ifko Kovacka
* Itai Bar-Haim
* Ivan Shumilin
* John Reilly
* John Simons
* Justin Dearing
* Markus Palme
* Mathias Simmack
* Matt Everson
* Nathan Allan
* Nikola Kavaldjiev
* Philipp Maihart
* Poul Staugaard
* Robert Pickering
* Robert Zaunere
* Roman Taranchenko
* Russell Wilkins
* Scott Ferrett
* Sergej Andrejev
* Shinsaku Nakagawa
* Tomasz Tretkowski
* Troy Simpson
######Copyright 2014 AlphaSierraPapa for the SharpDevelop team. SharpDevelop is distributed under the MIT license.

74
README.txt

@ -1,74 +0,0 @@ @@ -1,74 +0,0 @@
#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
Website: http://www.icsharpcode.net/OpenSource/SD/Default.aspx
Forums: http://community.sharpdevelop.net/forums/
Nightly builds: http://build.sharpdevelop.net/BuildArtefacts
Copyright 2014 AlphaSierraPapa for the SharpDevelop team.
SharpDevelop is distributed under the MIT license.
The #develop project started on September 11th, 2000. The project was initiated
by Mike Krüger. In the course of the project, several contributors joined in.
If you want to contribute see <https://github.com/icsharpcode/SharpDevelop/wiki/Joining-the-Team>.
Overview
#develop (short for SharpDevelop) is a free Integrated Development Environment
(IDE) for C#, VB.NET, Boo, IronPython, IronRuby and F# projects on Microsoft's
.NET platform. It is written (almost) entirely in C#, and comes with features
you would expect in an IDE plus a few more.
How To Compile
SharpDevelop can be compiled using the supplied .bat files, or in SharpDevelop itself.
System Requirements (running SharpDevelop)
- Windows Vista or higher.
- .NET 4.5
- Visual C++ 2008 SP1 Runtime (http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)
Extended Requirements (building SharpDevelop)
- .NET 3.5 SP1
- .NET 4.5 SDK (part of Windows SDK 8.0)
- Windows SDK 7.1 (?? not sure if this still is necessary...)
- Windows SDK 7.0 (optional; C++ compiler needed for profiler)
- Windows PowerShell
- if you have cloned the SD git repository: git must be available on your PATH
Libraries and integrated tools:
AvalonDock: New BSD License (BSD) (thanks to Adolfo Marinucci) - http://avalondock.codeplex.com/
GraphSharp
IQToolkit
Irony
ITextSharp
log4net
Mono T4
Mono.Cecil: MIT License (thanks to Jb Evain) - https://github.com/jbevain/cecil
SharpSvn
SQLite
WPFToolkit
Integrated Tools (shipping with SharpDevelop):
IronPython
IronRuby
NuGet
NUnit
OpenCover - https://github.com/OpenCover/opencover
WiX
Reusable Libraries (developed as part of SharpDevelop):
AvalonEdit
Debugger.Core
ICSharpCode.Core
ICSharpCode.Decompiler
NRefactory
SharpTreeView
WPF Designer
SharpDevelop Contributors:
Mike Krüger (Project Founder)
Daniel Grunwald (Technical Lead)
Andreas Weizel
Matt Ward
David Srbecky (Debugger)
Siegfried Pammer
Peter Forstmeier (SharpDevelop Reports)
(for a full list see https://github.com/icsharpcode/SharpDevelop/wiki/Contributors)

7
SharpDevelop.Tests.sln

@ -26,6 +26,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Wi @@ -26,6 +26,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Wi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDevelop", "src\Main\SharpDevelop\SharpDevelop.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker120", "src\Main\ICSharpCode.SharpDevelop.BuildWorker120\ICSharpCode.SharpDevelop.BuildWorker120.csproj", "{6F273DA5-E10C-45A6-9071-7313ECD98C90}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}"
@ -280,6 +282,10 @@ Global @@ -280,6 +282,10 @@ Global
{1152B71B-3C05-4598-B20D-823B5D40559E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1152B71B-3C05-4598-B20D-823B5D40559E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1152B71B-3C05-4598-B20D-823B5D40559E}.Release|Any CPU.Build.0 = Release|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.Build.0 = Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
@ -647,6 +653,7 @@ Global @@ -647,6 +653,7 @@ Global
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{8035765F-D51F-4A0C-A746-2FD100E19419} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{1152B71B-3C05-4598-B20D-823B5D40559E} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{6F273DA5-E10C-45A6-9071-7313ECD98C90} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{D68133BD-1E63-496E-9EDE-4FBDBF77B486} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
{6222A3A1-83CE-47A3-A4E4-A018F82D44D8} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}

15
SharpDevelop.sln

@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Wi @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Wi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDevelop", "src\Main\SharpDevelop\SharpDevelop.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker120", "src\Main\ICSharpCode.SharpDevelop.BuildWorker120\ICSharpCode.SharpDevelop.BuildWorker120.csproj", "{6F273DA5-E10C-45A6-9071-7313ECD98C90}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}"
@ -229,6 +231,10 @@ Global @@ -229,6 +231,10 @@ Global
{1152B71B-3C05-4598-B20D-823B5D40559E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1152B71B-3C05-4598-B20D-823B5D40559E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1152B71B-3C05-4598-B20D-823B5D40559E}.Release|Any CPU.Build.0 = Release|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F273DA5-E10C-45A6-9071-7313ECD98C90}.Release|Any CPU.Build.0 = Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU
@ -373,6 +379,10 @@ Global @@ -373,6 +379,10 @@ Global
{40CA84D4-ACFC-4646-9CDD-B87262D34093}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40CA84D4-ACFC-4646-9CDD-B87262D34093}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40CA84D4-ACFC-4646-9CDD-B87262D34093}.Release|Any CPU.Build.0 = Release|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Release|Any CPU.Build.0 = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -497,10 +507,6 @@ Global @@ -497,10 +507,6 @@ Global
{3DF4060F-5EE0-41CF-8096-F27355FD5511}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DF4060F-5EE0-41CF-8096-F27355FD5511}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DF4060F-5EE0-41CF-8096-F27355FD5511}.Release|Any CPU.Build.0 = Release|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0502FCF7-72F4-4587-936B-D0238CD0E072}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -514,6 +520,7 @@ Global @@ -514,6 +520,7 @@ Global
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{8035765F-D51F-4A0C-A746-2FD100E19419} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{1152B71B-3C05-4598-B20D-823B5D40559E} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{6F273DA5-E10C-45A6-9071-7313ECD98C90} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{D68133BD-1E63-496E-9EDE-4FBDBF77B486} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371} = {E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865}

6
clean.bat

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
%windir%\microsoft.net\framework\v4.0.30319\msbuild /m SharpDevelop.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Debug
@set PROGFILES=%PROGRAMFILES%
@if exist "%PROGRAMFILES(x86)%" set PROGFILES=%PROGRAMFILES(x86)%
"%PROGFILES%\MSBuild\12.0\Bin\msbuild" /m SharpDevelop.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Debug
@IF %ERRORLEVEL% NEQ 0 PAUSE
%windir%\microsoft.net\framework\v4.0.30319\msbuild /m SharpDevelop.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Release
"%PROGFILES%\MSBuild\12.0\Bin\msbuild" /m SharpDevelop.sln /t:clean "/p:Platform=Any CPU" /p:Configuration=Release
@IF %ERRORLEVEL% NEQ 0 PAUSE

7
data/resources/StringResources.resx

@ -6054,6 +6054,10 @@ Removed the end part of the original message ", reason '${Message}'" since this @@ -6054,6 +6054,10 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="ProjectComponent.ContextMenu.AddReference" xml:space="preserve">
<value>Add Reference</value>
</data>
<data name="ProjectComponent.ContextMenu.AddServiceReference" xml:space="preserve">
<value>Add Service Reference</value>
<comment>Right click context menu option to add a service reference to the project.</comment>
</data>
<data name="ProjectComponent.ContextMenu.AddWebReference" xml:space="preserve">
<value>Add Web Reference</value>
<comment>Right click context menu option to add a web reference to the project.</comment>
@ -6972,6 +6976,9 @@ The resources files have been renamed/moved accordingly.</value> @@ -6972,6 +6976,9 @@ The resources files have been renamed/moved accordingly.</value>
<data name="StartPage.StartMenu.OpenCombineButton" xml:space="preserve">
<value>Open solution</value>
</data>
<data name="StartPage.StartMenu.RemoveRecentProject" xml:space="preserve">
<value>Remove from recent projects list</value>
</data>
<data name="StartPage.StartPageContentName" xml:space="preserve">
<value>Start Page</value>
</data>

4
debugbuild.bat

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
%windir%\microsoft.net\framework\v4.0.30319\msbuild /m SharpDevelop.sln /p:Configuration=Debug "/p:Platform=Any CPU"
@set PROGFILES=%PROGRAMFILES%
@if exist "%PROGRAMFILES(x86)%" set PROGFILES=%PROGRAMFILES(x86)%
"%PROGFILES%\MSBuild\12.0\Bin\msbuild" /m SharpDevelop.sln /p:Configuration=Debug "/p:Platform=Any CPU" %*
@IF %ERRORLEVEL% NEQ 0 GOTO err
@exit /B 0
:err

4
doc/Dependencies.html

@ -63,6 +63,10 @@ @@ -63,6 +63,10 @@
<td style="padding-right: 8px;">.NET Framework 3.5 SP1 and below</td>
<td>Included with .NET framework</td>
</tr>
<tr>
<td>.NET Portable Class Libraries</td>
<td><a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981/">Portable Library Tools - Install with the /buildmachine switch</a></td>
</tr>
</table>
<p>

4
releasebuild.bat

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
%windir%\microsoft.net\framework\v4.0.30319\msbuild /m SharpDevelop.sln /p:Configuration=Release "/p:Platform=Any CPU"
@set PROGFILES=%PROGRAMFILES%
@if exist "%PROGRAMFILES(x86)%" set PROGFILES=%PROGRAMFILES(x86)%
"%PROGFILES%\MSBuild\12.0\Bin\msbuild" /m SharpDevelop.sln /p:Configuration=Release "/p:Platform=Any CPU" %*
@IF %ERRORLEVEL% NEQ 0 GOTO err
@exit /B 0
:err

2
src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "CodeCoverageAddIn"
<AddIn name = "CodeCoverage AddIn"
author = "Matt Ward"
copyright = "prj:///doc/copyright.txt"
description = "Code Coverage AddIn for SharpDevelop using OpenCover"

2
src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport - Kopie.srd

@ -265,7 +265,7 @@ @@ -265,7 +265,7 @@
<CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<RTL>No</RTL>
<Text>= Globals!ReportFolder + Globals!ReportName</Text>
<Text>= Globals!ReportFolder + ' - ' + Globals!ReportName</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>Black</FrameColor>
<ForeColor>ControlText</ForeColor>

2
src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd

@ -254,7 +254,7 @@ @@ -254,7 +254,7 @@
<CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<RTL>No</RTL>
<Text>= Globals!ReportFolder + Globals!ReportName</Text>
<Text>= Globals!ReportFolder + ' - ' + Globals!ReportName</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>Black</FrameColor>
<ForeColor>ControlText</ForeColor>

2
src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd

@ -440,7 +440,7 @@ @@ -440,7 +440,7 @@
<CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<RTL>No</RTL>
<Text>= Globals!ReportFolder + Globals!ReportName</Text>
<Text>= Globals!ReportFolder + ' - ' + Globals!ReportName</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>Black</FrameColor>
<ForeColor>ControlText</ForeColor>

2
src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "Machine.Specifications Addin"
<AddIn name = "Machine.Specifications AddIn"
author = "Tomasz Tretkowski"
url = ""
description = "Runner for Machine.Specifications unit tests for SharpDevelop"

2
src/AddIns/Analysis/Profiler/Frontend/AddIn/ICSharpCode.Profiler.AddIn.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "Profiler.AddIn"
<AddIn name = "Profiler AddIn"
author = "Siegfried Pammer"
url = ""
description = "Integrates a Profiler with GUI into SharpDevelop"

15
src/AddIns/Analysis/UnitTesting/Commands/PadCommands.cs

@ -54,6 +54,21 @@ namespace ICSharpCode.UnitTesting @@ -54,6 +54,21 @@ namespace ICSharpCode.UnitTesting
}
}
public class ExpandAllTestsCommand : AbstractMenuCommand
{
public override void Run()
{
if (!(this.Owner is SharpTreeView))
return;
var treeView = (SharpTreeView)this.Owner;
if (treeView.Root != null) {
foreach (var n in treeView.Root.Descendants())
n.IsExpanded = true;
}
}
}
public class CollapseAllTestsCommand : AbstractMenuCommand
{
public override void Run()

2
src/AddIns/Analysis/UnitTesting/Model/ITest.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.UnitTesting @@ -54,7 +54,7 @@ namespace ICSharpCode.UnitTesting
string DisplayName { get; }
/// <summary>
/// Raised when the <see cref="Name"/> property changes.
/// Raised when the <see cref="DisplayName"/> property changes.
/// </summary>
event EventHandler DisplayNameChanged;

4
src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs

@ -84,6 +84,10 @@ namespace ICSharpCode.UnitTesting @@ -84,6 +84,10 @@ namespace ICSharpCode.UnitTesting
public override bool ShowExpander {
get { return test.CanExpandNestedTests && base.ShowExpander; }
}
public override bool CanExpandRecursively {
get { return true; }
}
#endregion
#region Icon + Text

6
src/AddIns/Analysis/UnitTesting/UnitTesting.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name="Unit Testing Addin"
<AddIn name="Unit Testing AddIn"
author="Matt Ward"
copyright="prj:///doc/copyright.txt"
description="Runs NUnit tests inside #Develop"
@ -100,6 +100,10 @@ @@ -100,6 +100,10 @@
tooltip="${res:NUnitPad.NUnitPadContent.ReferenceItem}"
class="ICSharpCode.UnitTesting.AddNUnitReferenceCommand"/>
<ToolbarItem id = "CollapseSeparator" type = "Separator"/>
<ToolbarItem id = "ExpandAll"
icon = "Icons.16x16.OpenCollection"
tooltip = "${res:MainWindow.Windows.SearchResultPanel.ExpandAll.ToolTip}"
class = "ICSharpCode.UnitTesting.ExpandAllTestsCommand"/>
<ToolbarItem id = "Collapse"
icon = "Icons.16x16.Collection"
tooltip = "${res:MainWindow.Windows.SearchResultPanel.CollapseAll.ToolTip}"

23
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

@ -21,6 +21,7 @@ using System.Collections.Generic; @@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.NRefactory;
@ -43,6 +44,7 @@ namespace CSharpBinding @@ -43,6 +44,7 @@ namespace CSharpBinding
ISymbolReference currentSymbolReference;
CancellationTokenSource caretMovementTokenSource;
DispatcherTimer timer;
List<ISegment> currentReferences;
Pen borderPen;
@ -63,6 +65,11 @@ namespace CSharpBinding @@ -63,6 +65,11 @@ namespace CSharpBinding
this.backgroundBrush = new SolidColorBrush(DefaultFillColor);
this.borderPen.Freeze();
this.backgroundBrush.Freeze();
this.timer = new DispatcherTimer {
Interval = TimeSpan.FromMilliseconds(500)
};
timer.Tick += (sender, e) => ResolveAtCaret();
editor.Caret.LocationChanged += CaretLocationChanged;
textView.VisualLinesChanged += VisualLinesChanged;
SD.ParserService.ParseInformationUpdated += ParseInformationUpdated;
@ -136,9 +143,19 @@ namespace CSharpBinding @@ -136,9 +143,19 @@ namespace CSharpBinding
{
if (caretMovementTokenSource != null)
caretMovementTokenSource.Cancel();
timer.Stop();
timer.Start();
}
async void ResolveAtCaret()
{
timer.Stop();
caretMovementTokenSource = new CancellationTokenSource();
var rr = SD.ParserService.Resolve(editor.FileName, editor.Caret.Location, editor.Document, cancellationToken: caretMovementTokenSource.Token);
SetCurrentSymbol(rr.GetSymbol());
try {
var rr = await SD.ParserService.ResolveAsync(editor.FileName, editor.Caret.Location, editor.Document, cancellationToken: caretMovementTokenSource.Token);
SetCurrentSymbol(rr.GetSymbol());
} catch (OperationCanceledException) {
}
}
IResolveVisitorNavigator InitNavigator(ICompilation compilation)
@ -185,7 +202,7 @@ namespace CSharpBinding @@ -185,7 +202,7 @@ namespace CSharpBinding
void VisitVisibleNodes(AstNode node, IResolveVisitorNavigator currentNavigator, CSharpAstResolver resolver, int start, int end)
{
if (!CSharpAstResolver.IsUnresolvableNode(node))
currentNavigator.Resolved(node, resolver.Resolve(node, caretMovementTokenSource.Token));
currentNavigator.Resolved(node, resolver.Resolve(node));
for (var child = node.FirstChild; child != null; child = child.NextSibling) {
if (child.StartLocation.Line <= end && child.EndLocation.Line >= start)
VisitVisibleNodes(child, currentNavigator, resolver, start, end);

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs

@ -31,6 +31,7 @@ using ICSharpCode.NRefactory.TypeSystem; @@ -31,6 +31,7 @@ using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
using CSharpBinding.FormattingStrategy;
namespace CSharpBinding.Completion
{
@ -98,7 +99,8 @@ namespace CSharpBinding.Completion @@ -98,7 +99,8 @@ namespace CSharpBinding.Completion
completionContext.ProjectContent,
completionContext.TypeResolveContextAtCaret
);
cce.FormattingPolicy = FormattingOptionsFactory.CreateSharpDevelop();
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(completionContext.Compilation.GetProject());
cce.FormattingPolicy = formattingOptions.OptionsContainer.GetEffectiveOptions();
cce.EolMarker = DocumentUtilities.GetLineTerminator(completionContext.Document, currentLocation.Line);
cce.IndentString = editor.Options.IndentationString;

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpInsightItem.cs

@ -28,6 +28,7 @@ using ICSharpCode.NRefactory.TypeSystem; @@ -28,6 +28,7 @@ using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.Xml;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
using CSharpBinding.FormattingStrategy;
namespace CSharpBinding.Completion
{
@ -71,7 +72,7 @@ namespace CSharpBinding.Completion @@ -71,7 +72,7 @@ namespace CSharpBinding.Completion
ambience.ConversionFlags = ConversionFlags.StandardConversionFlags;
var stringBuilder = new StringBuilder();
var formatter = new ParameterHighlightingOutputFormatter(stringBuilder, highlightedParameterIndex);
ambience.ConvertSymbol(Method, formatter, FormattingOptionsFactory.CreateSharpDevelop());
ambience.ConvertSymbol(Method, formatter, CSharpFormattingOptionsPersistence.GlobalOptions.OptionsContainer.GetEffectiveOptions());
var documentation = XmlDocumentationElement.Get(Method);
ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList;

44
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsContainer.cs

@ -34,13 +34,10 @@ namespace CSharpBinding.FormattingStrategy @@ -34,13 +34,10 @@ namespace CSharpBinding.FormattingStrategy
/// </summary>
internal class CSharpFormattingOptionsContainer : INotifyPropertyChanged
{
private const string AutoFormattingOptionName = "AutoFormatting";
CSharpFormattingOptionsContainer parent;
CSharpFormattingOptions cachedOptions;
readonly HashSet<string> activeOptions;
bool? autoFormatting;
public CSharpFormattingOptionsContainer(CSharpFormattingOptionsContainer parent = null)
: this(parent, new HashSet<string>())
@ -71,34 +68,6 @@ namespace CSharpBinding.FormattingStrategy @@ -71,34 +68,6 @@ namespace CSharpBinding.FormattingStrategy
}
}
public bool? AutoFormatting
{
get {
return autoFormatting;
}
set {
autoFormatting = value;
OnPropertyChanged("AutoFormatting");
}
}
public bool EffectiveAutoFormatting
{
get {
// Get "effective" option, i.e. walk up all parents to find a defined value
CSharpFormattingOptionsContainer container = this;
do
{
if (container.autoFormatting.HasValue) {
return container.autoFormatting.Value;
}
container = container.parent;
} while (container != null);
return true;
}
}
/// <summary>
/// Resets all container's options to given <see cref="ICSharpCode.NRefactory.CSharp.CSharpFormattingOptions"/> instance.
/// </summary>
@ -112,7 +81,6 @@ namespace CSharpBinding.FormattingStrategy @@ -112,7 +81,6 @@ namespace CSharpBinding.FormattingStrategy
foreach (var property in typeof(CSharpFormattingOptions).GetProperties()) {
activeOptions.Add(property.Name);
}
autoFormatting = true;
}
OnPropertyChanged(null);
}
@ -138,7 +106,6 @@ namespace CSharpBinding.FormattingStrategy @@ -138,7 +106,6 @@ namespace CSharpBinding.FormattingStrategy
foreach (var activeOption in options.activeOptions)
activeOptions.Add(activeOption);
cachedOptions = options.cachedOptions.Clone();
autoFormatting = options.autoFormatting;
OnPropertyChanged(null);
}
@ -308,11 +275,6 @@ namespace CSharpBinding.FormattingStrategy @@ -308,11 +275,6 @@ namespace CSharpBinding.FormattingStrategy
// Silently ignore loading error, then this property will be "as parent" automatically
}
}
if (formatProperties.Contains(AutoFormattingOptionName)) {
autoFormatting = formatProperties.Get(AutoFormattingOptionName, true);
} else {
autoFormatting = null;
}
}
}
@ -329,12 +291,6 @@ namespace CSharpBinding.FormattingStrategy @@ -329,12 +291,6 @@ namespace CSharpBinding.FormattingStrategy
formatProperties.Set(activeOption, val);
}
}
if (formatProperties.Contains(AutoFormattingOptionName) && !autoFormatting.HasValue) {
// AutoFormatting options was activated previously, remove it now
formatProperties.Remove(AutoFormattingOptionName);
} else {
formatProperties.Set(AutoFormattingOptionName, autoFormatting);
}
parentProperties.SetNestedProperties("CSharpFormatting", formatProperties);
}

12
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs

@ -71,6 +71,16 @@ namespace CSharpBinding.FormattingStrategy @@ -71,6 +71,16 @@ namespace CSharpBinding.FormattingStrategy
}
}
public static bool AutoFormatting
{
get {
return SD.PropertyService.Get("CSharpBinding.Formatting.AutoFormatting", true);
}
set {
SD.PropertyService.Set("CSharpBinding.Formatting.AutoFormatting", value);
}
}
public static CSharpFormattingOptionsPersistence GlobalOptions
{
get;
@ -108,7 +118,7 @@ namespace CSharpBinding.FormattingStrategy @@ -108,7 +118,7 @@ namespace CSharpBinding.FormattingStrategy
{
// Load solution settings
SolutionOptions = new CSharpFormattingOptionsPersistence(
e.Solution.GlobalPreferences,
e.Solution.SDSettings,
new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer)
{
DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.SolutionOptionReference}")

129
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs

@ -155,7 +155,7 @@ namespace CSharpBinding.FormattingStrategy @@ -155,7 +155,7 @@ namespace CSharpBinding.FormattingStrategy
if ((inString && !verbatim) || inChar)
++i; // skip next character
break;
}
}
}
return curlyCounter > 0;
}
@ -269,16 +269,43 @@ namespace CSharpBinding.FormattingStrategy @@ -269,16 +269,43 @@ namespace CSharpBinding.FormattingStrategy
public override void FormatLines(ITextEditor textArea)
{
// Format current selection or whole document
int formattedTextOffset = 0;
int formattedTextLength = textArea.Document.TextLength;
if (textArea.SelectionLength != 0) {
formattedTextOffset = textArea.SelectionStart;
formattedTextLength = textArea.SelectionLength;
}
FormatCode(textArea, formattedTextOffset, formattedTextLength, false);
}
/// <summary>
/// Formats a code section according to currently effective formatting settings.
/// </summary>
/// <param name="textArea">Text editor instance to format code in.</param>
/// <param name="offset">Start offset of formatted code.</param>
/// <param name="length">Length of formatted code.</param>
/// <param name="respectAutoFormattingSetting">
/// Set to <c>true</c> to perform formatting only if auto-formatting setting is active.
/// If <c>false</c>, formatting will be performed in any case.
/// </param>
/// <returns><c>True</c>, if code has been formatted, <c>false</c> if auto-formatting is currently forbidden.</returns>
private bool FormatCode(ITextEditor textArea, int offset, int length, bool respectAutoFormattingSetting)
{
if ((offset > textArea.Document.TextLength) || ((offset + length) > textArea.Document.TextLength))
return false;
if (respectAutoFormattingSetting && !CSharpFormattingOptionsPersistence.AutoFormatting)
return false;
using (textArea.Document.OpenUndoGroup()) {
// In any other case: Simply format selection or whole document
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(SD.ProjectService.CurrentProject);
int formattedTextOffset = 0;
int formattedTextLength = textArea.Document.TextLength;
if (textArea.SelectionLength != 0) {
formattedTextOffset = textArea.SelectionStart;
formattedTextLength = textArea.SelectionLength;
try {
CSharpFormatterHelper.Format(textArea, offset, length, formattingOptions.OptionsContainer);
} catch (Exception) {
// Exceptions in formatting might happen if code contains syntax errors, we have to catch them
return false;
}
CSharpFormatterHelper.Format(textArea, formattedTextOffset, formattedTextLength, formattingOptions.OptionsContainer);
return true;
}
}
@ -289,6 +316,24 @@ namespace CSharpBinding.FormattingStrategy @@ -289,6 +316,24 @@ namespace CSharpBinding.FormattingStrategy
}
}
bool FormatStatement(ITextEditor textArea, int cursorOffset, int formattingStartOffset)
{
var line = textArea.Document.GetLineByOffset(formattingStartOffset);
int lineOffset = line.Offset;
// Walk up the lines until we arrive at previous statement, block, comment or preprocessor directive
while (line.PreviousLine != null) {
line = line.PreviousLine;
string lineText = textArea.Document.GetText(line.Offset, line.Length);
if (IsLineEndOfStatement(lineText)) {
// Previous line is another statement, don't format it
break;
}
lineOffset = line.Offset;
}
return FormatCode(textArea, lineOffset, cursorOffset - lineOffset, true);
}
void FormatLineInternal(ITextEditor textArea, int lineNr, int cursorOffset, char ch)
{
IDocumentLine curLine = textArea.Document.GetLineByNumber(lineNr);
@ -313,8 +358,17 @@ namespace CSharpBinding.FormattingStrategy @@ -313,8 +358,17 @@ namespace CSharpBinding.FormattingStrategy
sb.Append(indentation);
sb.Append("/// </summary>");
IUnresolvedMethod method = null;
if (member is IUnresolvedMethod) {
IUnresolvedMethod method = (IUnresolvedMethod)member;
method = (IUnresolvedMethod)member;
} else if (member is IUnresolvedTypeDefinition) {
IUnresolvedTypeDefinition type = (IUnresolvedTypeDefinition) member;
if (type.Kind == TypeKind.Delegate) {
method = type.Methods.FirstOrDefault(m => m.Name == "Invoke");
}
}
if (method != null) {
for (int i = 0; i < method.Parameters.Count; ++i) {
sb.Append(terminator);
sb.Append(indentation);
@ -331,8 +385,8 @@ namespace CSharpBinding.FormattingStrategy @@ -331,8 +385,8 @@ namespace CSharpBinding.FormattingStrategy
}
}
}
textArea.Document.Insert(cursorOffset, sb.ToString());
textArea.Document.Insert(cursorOffset, sb.ToString());
textArea.Caret.Offset = cursorOffset + indentation.Length + "/// ".Length + " <summary>".Length + terminator.Length;
}
}
@ -375,12 +429,29 @@ namespace CSharpBinding.FormattingStrategy @@ -375,12 +429,29 @@ namespace CSharpBinding.FormattingStrategy
case ':':
case ')':
case ']':
case '}':
case '{':
//if (textArea.Document.TextEditorProperties.IndentStyle == IndentStyle.Smart) {
IndentLine(textArea, curLine);
//}
break;
case '}':
// Try to get corresponding block beginning brace
var bracketSearchResult = textArea.Language.BracketSearcher.SearchBracket(textArea.Document, cursorOffset);
if (bracketSearchResult != null) {
// Format the block
if (!FormatStatement(textArea, cursorOffset, bracketSearchResult.OpeningBracketOffset)) {
// No auto-formatting seems to be active, at least indent the line
IndentLine(textArea, curLine);
}
}
break;
case ';':
// Format this line
if (!FormatStatement(textArea, cursorOffset, cursorOffset)) {
// No auto-formatting seems to be active, at least indent the line
IndentLine(textArea, curLine);
}
break;
case '\n':
string lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove);
// curLine might have some text which should be added to indentation
@ -445,7 +516,41 @@ namespace CSharpBinding.FormattingStrategy @@ -445,7 +516,41 @@ namespace CSharpBinding.FormattingStrategy
}
}
return;
}
}
bool IsLineEndOfStatement(string lineText)
{
string normalizedLine = null;
// Look if there is a comment at the end of line
int indexOfSingleLineComment = lineText.LastIndexOf("//");
if (indexOfSingleLineComment > -1) {
normalizedLine = lineText.Substring(0, indexOfSingleLineComment);
} else {
normalizedLine = lineText;
}
normalizedLine = normalizedLine.Trim(' ', '\t');
if (normalizedLine.EndsWith("*/")) {
int indexOfMultiLineCommentStart = normalizedLine.LastIndexOf("/*");
if (indexOfMultiLineCommentStart > -1) {
normalizedLine = normalizedLine.Substring(0, indexOfMultiLineCommentStart);
} else {
// Seems to be a multiline comment (no comment start on this line)
return true;
}
}
// Usual statement endings
if (normalizedLine.StartsWith("#")
|| normalizedLine.EndsWith(";")
|| normalizedLine.EndsWith("{")
|| normalizedLine.EndsWith("}"))
return true;
return false;
}
/// <summary>
@ -554,7 +659,7 @@ namespace CSharpBinding.FormattingStrategy @@ -554,7 +659,7 @@ namespace CSharpBinding.FormattingStrategy
if ((inString && !verbatim) || inChar)
++i; // skip next character
break;
}
}
}
return (inString || inChar) ? 2 : 0;
}

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs

@ -35,6 +35,7 @@ using ICSharpCode.SharpDevelop; @@ -35,6 +35,7 @@ using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Project;
using Microsoft.CSharp;
using CSharpBinding.FormattingStrategy;
using CSharpBinding.Parser;
using CSharpBinding.Refactoring;
@ -154,7 +155,8 @@ namespace CSharpBinding.FormsDesigner @@ -154,7 +155,8 @@ namespace CSharpBinding.FormsDesigner
IDocument document = context.GetDocument(fileNameObj);
var ctx = SDRefactoringContext.Create(fileNameObj, document);
script = new DocumentScript(document, FormattingOptionsFactory.CreateSharpDevelop(), new TextEditorOptions());
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(compilation.GetProject());
script = new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), new TextEditorOptions());
scripts.Add(fileNameObj, script);
return script;
}

22
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerLoader.cs

@ -127,6 +127,7 @@ namespace CSharpBinding.FormsDesigner @@ -127,6 +127,7 @@ namespace CSharpBinding.FormsDesigner
foreach (var field in designerClass.Fields) {
var codeField = new CodeMemberField(cv.Convert(field.Type), field.Name);
codeField.Attributes = GetAccessibility(field);
codeClass.Members.Add(codeField);
}
var codeNamespace = new CodeNamespace(designerClass.Namespace);
@ -170,6 +171,27 @@ namespace CSharpBinding.FormsDesigner @@ -170,6 +171,27 @@ namespace CSharpBinding.FormsDesigner
MessageService.ShowException(ex);
}
}
MemberAttributes GetAccessibility(IField field)
{
switch (field.Accessibility) {
case Accessibility.None:
case Accessibility.Private:
return MemberAttributes.Private;
case Accessibility.Public:
return MemberAttributes.Public;
case Accessibility.Protected:
return MemberAttributes.Family;
case Accessibility.Internal:
return MemberAttributes.Assembly;
case Accessibility.ProtectedOrInternal:
return MemberAttributes.FamilyOrAssembly;
case Accessibility.ProtectedAndInternal:
return MemberAttributes.FamilyAndAssembly;
default:
throw new ArgumentOutOfRangeException();
}
}
protected override CodeDomLocalizationModel GetCurrentLocalizationModelFromDesignedFile()
{

29
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml

@ -297,24 +297,17 @@ @@ -297,24 +297,17 @@
</UserControl.Resources>
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Vertical">
<CheckBox
Name="autoFormattingCheckBox"
Content="{core:Localize CSharpBinding.Formatting.AutoFormat}"
IsThreeState="True" IsChecked="{Binding AutoFormatting}"
Margin="0,0,0,10"
Visibility="Collapsed"/>
<Grid
Visibility="{Binding Path=AllowPresets, Converter={StaticResource boolToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{core:Localize CSharpBinding.Formatting.ResetTo}" Click="ResetButton_Click" />
<ComboBox Name="presetComboBox" Grid.Column="1" Margin="3,0,0,0" ItemsSource="{Binding Presets}" />
</Grid>
</StackPanel>
<Grid
Visibility="{Binding Path=AllowPresets, Converter={StaticResource boolToVisibilityConverter}}"
DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{core:Localize CSharpBinding.Formatting.ResetTo}" Click="ResetButton_Click" />
<ComboBox Name="presetComboBox" Grid.Column="1" Margin="3,0,0,0" ItemsSource="{Binding Presets}" />
</Grid>
<sd:RestrictDesiredSize Margin="0,4,0,0">
<ScrollViewer VerticalScrollBarVisibility="Auto">

31
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingEditor.xaml.cs

@ -133,48 +133,17 @@ namespace CSharpBinding.OptionPanels @@ -133,48 +133,17 @@ namespace CSharpBinding.OptionPanels
set { SetValue(AllowPresetsProperty, value); }
}
public static readonly DependencyProperty AutoFormattingProperty =
DependencyProperty.Register("AutoFormatting", typeof(bool?), typeof(CSharpFormattingEditor),
new FrameworkPropertyMetadata());
public bool? AutoFormatting {
get { return (bool?)GetValue(AutoFormattingProperty); }
set { SetValue(AutoFormattingProperty, value); }
}
static void OnOptionsContainerPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
var editor = o as CSharpFormattingEditor;
if (editor != null) {
var newContainer = e.NewValue as CSharpFormattingOptionsContainer;
if (newContainer != null) {
newContainer.PropertyChanged += (sender, eventArgs) =>
{
if (eventArgs.PropertyName == "AutoFormatting") {
// Update AutoFormatting special option
if (editor.AutoFormatting != newContainer.AutoFormatting)
editor.AutoFormatting = newContainer.AutoFormatting;
}
};
editor.autoFormattingCheckBox.IsThreeState = (newContainer.Parent != null);
editor.AutoFormatting = newContainer.AutoFormatting;
editor.FillPresetList(newContainer);
}
}
}
static void OnAutoFormattingPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
var editor = o as CSharpFormattingEditor;
if (editor != null) {
var container = editor.OptionsContainer;
if (container != null) {
if (container.AutoFormatting != (bool?) e.NewValue)
container.AutoFormatting = (bool?) e.NewValue;
}
}
}
private void FillPresetList(CSharpFormattingOptionsContainer container)
{
presets["(default)"] = () => null;

12
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml

@ -7,10 +7,20 @@ @@ -7,10 +7,20 @@
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project;assembly=ICSharpCode.SharpDevelop"
xmlns:fstrategy="clr-namespace:CSharpBinding.FormattingStrategy"
xmlns:local="clr-namespace:CSharpBinding.OptionPanels"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets">
<Grid>
<local:CSharpFormattingEditor x:Name="formattingEditor" Margin="0,0,0,0" />
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CheckBox
Name="autoFormattingCheckBox"
Content="{core:Localize CSharpBinding.Formatting.AutoFormat}"
IsChecked="{sd:OptionBinding fstrategy:CSharpFormattingOptionsPersistence.AutoFormatting}"
Margin="0,0,0,10" />
<local:CSharpFormattingEditor x:Name="formattingEditor" Grid.Row="1" Margin="0,0,0,0" />
</Grid>
</gui:OptionPanel>

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/CSharpFormattingOptionPanel.xaml.cs

@ -42,6 +42,7 @@ namespace CSharpBinding.OptionPanels @@ -42,6 +42,7 @@ namespace CSharpBinding.OptionPanels
public CSharpGlobalFormattingOptionPanel()
: base(CSharpFormattingOptionsPersistence.GlobalOptions, true)
{
autoFormattingCheckBox.Visibility = Visibility.Visible;
}
}
@ -53,6 +54,7 @@ namespace CSharpBinding.OptionPanels @@ -53,6 +54,7 @@ namespace CSharpBinding.OptionPanels
public CSharpSolutionFormattingOptionPanel()
: base(CSharpFormattingOptionsPersistence.SolutionOptions, true)
{
autoFormattingCheckBox.Visibility = Visibility.Collapsed;
}
}
@ -83,7 +85,7 @@ namespace CSharpBinding.OptionPanels @@ -83,7 +85,7 @@ namespace CSharpBinding.OptionPanels
public override bool SaveOptions()
{
return persistenceHelper.Save();
return persistenceHelper.Save() && base.SaveOptions();
}
}
}

5
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertCtorDialog.xaml.cs

@ -38,6 +38,7 @@ using ICSharpCode.NRefactory.TypeSystem; @@ -38,6 +38,7 @@ using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Parser;
using CSharpBinding.FormattingStrategy;
namespace CSharpBinding.Refactoring
{
@ -170,8 +171,8 @@ namespace CSharpBinding.Refactoring @@ -170,8 +171,8 @@ namespace CSharpBinding.Refactoring
using (StringWriter textWriter = new StringWriter(pList)) {
// Output parameter list as string
var formattingOptions = FormattingOptionsFactory.CreateMono();
CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor(textWriter, formattingOptions);
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(refactoringContext.Compilation.GetProject());
CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor(textWriter, formattingOptions.OptionsContainer.GetEffectiveOptions());
for (int i = 0; i < parameters.Count; i++) {
if (i > 0)
textWriter.Write(",");

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs

@ -36,6 +36,7 @@ using ICSharpCode.SharpDevelop.Parser; @@ -36,6 +36,7 @@ using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Refactoring;
using ICSharpCode.SharpDevelop.Workbench;
using CSharpBinding.FormattingStrategy;
using CSharpBinding.Parser;
namespace CSharpBinding.Refactoring
@ -108,7 +109,8 @@ namespace CSharpBinding.Refactoring @@ -108,7 +109,8 @@ namespace CSharpBinding.Refactoring
|| ch is UsingAliasDeclaration
|| ch is ExternAliasDeclaration);
StringBuilder newCode = new StringBuilder(header);
CSharpOutputVisitor visitor = new CSharpOutputVisitor(new StringWriter(newCode), FormattingOptionsFactory.CreateSharpDevelop());
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(compilation.GetProject());
CSharpOutputVisitor visitor = new CSharpOutputVisitor(new StringWriter(newCode), formattingOptions.OptionsContainer.GetEffectiveOptions());
foreach (var topLevelUsing in topLevelUsings)
topLevelUsing.AcceptVisitor(visitor);

7
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs

@ -21,6 +21,7 @@ using System.ComponentModel.Design; @@ -21,6 +21,7 @@ using System.ComponentModel.Design;
using System.Threading;
using ICSharpCode.NRefactory.Utils;
using CSharpBinding.FormattingStrategy;
using CSharpBinding.Parser;
using ICSharpCode.Core;
using ICSharpCode.NRefactory;
@ -118,13 +119,13 @@ namespace CSharpBinding.Refactoring @@ -118,13 +119,13 @@ namespace CSharpBinding.Refactoring
public Script StartScript()
{
var formattingOptions = FormattingOptionsFactory.CreateSharpDevelop();
var formattingOptions = CSharpFormattingOptionsPersistence.GetProjectOptions(resolver.Compilation.GetProject());
if (editor != null)
return new EditorScript(editor, this, formattingOptions);
return new EditorScript(editor, this, formattingOptions.OptionsContainer.GetEffectiveOptions());
else if (document == null || document is ReadOnlyDocument)
throw new InvalidOperationException("Cannot start a script in a read-only context");
else
return new DocumentScript(document, formattingOptions, this.TextEditorOptions);
return new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), this.TextEditorOptions);
}
public IDocument Document {

1
src/AddIns/BackendBindings/FSharpBinding/FSharpInteractive.cs

@ -108,6 +108,7 @@ namespace FSharpBinding @@ -108,6 +108,7 @@ namespace FSharpBinding
string FindFSharpInteractiveInProgramFilesFolder()
{
var fileNames = new string [] {
@"Microsoft SDKs\F#\3.1\Framework\v4.0\Fsi.exe",
@"Microsoft SDKs\F#\3.0\Framework\v4.0\Fsi.exe",
@"Microsoft F#\v4.0\Fsi.exe"
};

2
src/AddIns/BackendBindings/FSharpBinding/Templates/FSharp3ConsoleProject.xpt

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
</PropertyGroup>
<Imports clear="True">
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" />
</Imports>
<Files>

2
src/AddIns/BackendBindings/FSharpBinding/Templates/FSharp3LibraryProject.xpt

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
</PropertyGroup>
<Imports clear="True">
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" />
</Imports>
<Files>

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "WiX binding"
<AddIn name = "WiX Binding"
author = "Matt Ward"
copyright = "prj:///doc/copyright.txt"
url = "http://icsharpcode.net"

2
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "XAML binding"
<AddIn name = "XAML Binding"
author = "Siegfried Pammer"
copyright = "prj:///doc/copyright.txt"
url = "http://icsharpcode.net"

13
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin

@ -71,11 +71,14 @@ @@ -71,11 +71,14 @@
label = "${res:MainWindow.Windows.Debug.AddExpressionBreakpoint}"
shortcut="Shift|F7"
class = "Debugger.AddIn.AddExpressionBreakpointCommand"/>-->
<MenuItem id="AddWatchExpression"
insertafter="AddExpressionBreakpoint"
label = "${res:MainWindow.Windows.Debug.AddWatchExpression}"
shortcut="Ctrl|F7"
class = "Debugger.AddIn.AddWatchExpressionCommand"/>
<Condition name = "IsTextSelected" action="Disable">
<MenuItem id="AddWatchExpression"
insertafter="AddExpressionBreakpoint"
icon = "Icons.16x16.WatchAdd"
label = "${res:MainWindow.Windows.Debug.AddWatchExpression}"
shortcut="Ctrl|F7"
class = "Debugger.AddIn.AddWatchExpressionCommand"/>
</Condition>
</Path>
<Path name="/SharpDevelop/Pads/ClassBrowser/Toolbar">

3
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs

@ -24,12 +24,13 @@ using System.Windows.Forms; @@ -24,12 +24,13 @@ using System.Windows.Forms;
using System.Xml.Serialization;
using Debugger;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Debugging;
namespace ICSharpCode.SharpDevelop.Services
{
public enum ShowIntegersAs { Decimal, Hexadecimal, Both };
public class DebuggingOptions: Options
public class DebuggingOptions: Options, IDebuggerOptions
{
public static DebuggingOptions Instance {
get { return new DebuggingOptions(); }

2
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml

@ -36,6 +36,8 @@ @@ -36,6 +36,8 @@
</GroupBox>
<GroupBox Margin="5" Header="{sd:Localize Dialog.Options.IDEOptions.Debugging.WithoutSource}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<CheckBox Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.EnableJustMyCode}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.EnableJustMyCode}" />
<CheckBox Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.AskForArguments}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.AskForArguments}" />
<CheckBox Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.BreakAtBeginning}"

4
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -137,6 +137,10 @@ namespace ICSharpCode.SharpDevelop.Services @@ -137,6 +137,10 @@ namespace ICSharpCode.SharpDevelop.Services
}
}
public override IDebuggerOptions Options {
get { return DebuggingOptions.Instance; }
}
public override bool CanDebug(IProject project)
{
return true;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "AvalonEdit.AddIn"
<AddIn name = "AvalonEdit AddIn"
author = "Daniel Grunwald"
description = "The main text editor for SharpDevelop"
addInManagerHidden="preinstalled">

2
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "ILSpyAddIn"
<AddIn name = "ILSpy AddIn"
author = "Daniel Grunwald"
copyright = "prj:///doc/copyright.txt"
description = "Can open ILSpy on a selected class or member."

2
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs

@ -16,7 +16,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -16,7 +16,7 @@ namespace ICSharpCode.ILSpyAddIn
{
public bool Handles(IMethod method)
{
return true;
return !SD.Debugger.Options.EnableJustMyCode;
}
public bool IsCompilerGenerated(IMethod method)

4
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/AdornerLayer.cs

@ -221,11 +221,11 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -221,11 +221,11 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
protected override Size ArrangeOverride(Size finalSize)
{
foreach (AdornerPanel adorner in this.Children) {
adorner.Arrange(new Rect(new Point(0, 0), adorner.DesiredSize));
foreach (AdornerPanel adorner in this.Children) {
if (adorner.AdornedElement.IsDescendantOf(_designPanel)) {
adorner.RenderTransform = (Transform)adorner.AdornedElement.TransformToAncestor(_designPanel);
}
adorner.Arrange(new Rect(new Point(0, 0), adorner.DesiredSize));
}
return finalSize;
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/PanelMoveAdorner.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -54,7 +54,7 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
e.Handled = true;
item.Services.Selection.SetSelectedComponents(new DesignItem [] { item }, SelectionTypes.Auto);
//item.Services.Selection.SetSelectedComponents(new DesignItem [] { item }, SelectionTypes.Auto);
new DragMoveMouseGesture(item, false).Start(item.Services.DesignPanel, e);
}

61
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -54,7 +54,7 @@ namespace ICSharpCode.WpfDesign.Designer
void RunHitTest(Visual reference, Point point, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback)
{
VisualTreeHelper.HitTest(reference, filterCallback, resultCallback,
new PointHitTestParameters(point));
new PointHitTestParameters(point));
}
HitTestFilterBehavior FilterHitTestInvisibleElements(DependencyObject potentialHitTestTarget)
@ -128,7 +128,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -128,7 +128,7 @@ namespace ICSharpCode.WpfDesign.Designer
}
});
}
if (continueHitTest && testDesignSurface) {
RunHitTest(
this.Child, mousePosition, filterBehavior,
@ -161,9 +161,6 @@ namespace ICSharpCode.WpfDesign.Designer @@ -161,9 +161,6 @@ namespace ICSharpCode.WpfDesign.Designer
DesignContext _context;
readonly EatAllHitTestRequests _eatAllHitTestRequests;
readonly AdornerLayer _adornerLayer;
PlacementOperation _currentOperation;
bool _moving = false;
int _movingDistance;
public DesignPanel()
{
@ -231,7 +228,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -231,7 +228,7 @@ namespace ICSharpCode.WpfDesign.Designer
}
}
}
/// <summary>
/// Enables / Disables the Raster Placement
/// </summary>
@ -327,15 +324,20 @@ namespace ICSharpCode.WpfDesign.Designer @@ -327,15 +324,20 @@ namespace ICSharpCode.WpfDesign.Designer
}
#endregion
PlacementOperation placementOp;
int dx = 0;
int dy = 0;
private void DesignPanel_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down)
{
if (_currentOperation != null)
_currentOperation.Commit();
_currentOperation = null;
_moving = false;
e.Handled = true;
if (placementOp != null) {
placementOp.Commit();
placementOp = null;
}
}
}
@ -344,40 +346,37 @@ namespace ICSharpCode.WpfDesign.Designer @@ -344,40 +346,37 @@ namespace ICSharpCode.WpfDesign.Designer
if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down)
{
e.Handled = true;
if (!_moving)
{
_currentOperation = PlacementOperation.Start(Context.Services.Selection.SelectedItems, PlacementType.Move);
_moving = true;
_movingDistance = 0;
if (placementOp == null) {
dx = 0;
dy = 0;
placementOp = PlacementOperation.Start(Context.Services.Selection.SelectedItems, PlacementType.Move);
}
var dx1 = (e.Key == Key.Left) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance - 10 : _movingDistance - 1 : 0;
var dy1 = (e.Key == Key.Up) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance - 10 : _movingDistance - 1 : 0;
var dx2 = (e.Key == Key.Right) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance + 10 : _movingDistance + 1 : 0;
var dy2 = (e.Key == Key.Down) ? Keyboard.IsKeyDown(Key.LeftShift) ? _movingDistance + 10 : _movingDistance + 1 : 0;
foreach (PlacementInformation info in _currentOperation.PlacedItems)
dx += (e.Key == Key.Left) ? Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1 : 0;
dy += (e.Key == Key.Up) ? Keyboard.IsKeyDown(Key.LeftShift) ? -10 : -1 : 0;
dx += (e.Key == Key.Right) ? Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1 : 0;
dy += (e.Key == Key.Down) ? Keyboard.IsKeyDown(Key.LeftShift) ? 10 : 1 : 0;
foreach (PlacementInformation info in placementOp.PlacedItems)
{
if (!Keyboard.IsKeyDown(Key.LeftCtrl))
{
info.Bounds = new Rect(info.OriginalBounds.Left + dx1 + dx2,
info.OriginalBounds.Top + dy1 + dy2,
info.OriginalBounds.Width,
info.OriginalBounds.Height);
info.Bounds = new Rect(info.OriginalBounds.Left + dx,
info.OriginalBounds.Top + dy,
info.OriginalBounds.Width,
info.OriginalBounds.Height);
}
else
{
info.Bounds = new Rect(info.OriginalBounds.Left,
info.OriginalBounds.Top,
info.OriginalBounds.Width + dx1 + dx2,
info.OriginalBounds.Height + dy1 + dy2);
info.OriginalBounds.Top,
info.OriginalBounds.Width + dx,
info.OriginalBounds.Height + dy);
}
_currentOperation.CurrentContainerBehavior.SetPosition(info);
placementOp.CurrentContainerBehavior.SetPosition(info);
}
_movingDistance = (dx1 + dx2 + dy1 + dy2);
}
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPositionExtension.cs

@ -28,7 +28,7 @@ using ICSharpCode.WpfDesign.Extensions; @@ -28,7 +28,7 @@ using ICSharpCode.WpfDesign.Extensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
[ExtensionFor(typeof(FrameworkElement))]
[ExtensionServer(typeof(PrimarySelectionExtensionServer))]
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
public class CanvasPositionExtension : AdornerProvider
{
private MarginHandle[] _handles;

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/QuickOperationMenuExtension.cs

@ -31,6 +31,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -31,6 +31,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <summary>
/// Extends the Quick operation menu for the designer.
/// </summary>
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof (FrameworkElement))]
public class QuickOperationMenuExtension : PrimarySelectionAdornerProvider
{

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RenderTransformOriginExtension.cs

@ -32,6 +32,7 @@ using System.Windows.Media; @@ -32,6 +32,7 @@ using System.Windows.Media;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public class RenderTransformOriginExtension : SelectionAdornerProvider
{

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs

@ -32,6 +32,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -32,6 +32,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <summary>
/// The resize thumb around a component.
/// </summary>
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public sealed class ResizeThumbExtension : SelectionAdornerProvider
{

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenuExtension.cs

@ -30,6 +30,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -30,6 +30,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <summary>
///
/// </summary>
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(UIElement))]
public sealed class RightClickContextMenuExtension : PrimarySelectionAdornerProvider
{

19
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RotateThumbExtension.cs

@ -32,6 +32,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -32,6 +32,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <summary>
/// The resize thumb around a component.
/// </summary>
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public sealed class RotateThumbExtension : SelectionAdornerProvider
{
@ -41,6 +42,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -41,6 +42,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
readonly DesignItem[] extendedItemArray = new DesignItem[1];
IPlacementBehavior resizeBehavior;
PlacementOperation operation;
private AdornerLayer _adornerLayer;
public RotateThumbExtension()
{
@ -64,6 +66,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -64,6 +66,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
DragListener drag = new DragListener(rotateThumb);
drag.Started += drag_Rotate_Started;
drag.Changed += drag_Rotate_Changed;
drag.Completed += drag_Rotate_Completed;
return rotateThumb;
}
@ -75,10 +78,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -75,10 +78,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
private RotateTransform rotateTransform;
private double initialAngle;
private DesignItem rtTransform;
private double angle;
private void drag_Rotate_Started(DragListener drag)
{
_adornerLayer = this.adornerPanel.TryFindParent<AdornerLayer>();
var designerItem = this.ExtendedItem.Component as FrameworkElement;
this.parent = VisualTreeHelper.GetParent(designerItem) as UIElement;
this.centerPoint = designerItem.TranslatePoint(
@ -135,10 +139,16 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -135,10 +139,16 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
rtTransform = this.ExtendedItem.Properties[FrameworkElement.RenderTransformProperty].Value;
}
rtTransform.Properties["Angle"].SetValue(destAngle);
this.angle = destAngle * Math.PI / 180.0;
_adornerLayer.UpdateAdornersForElement(this.ExtendedItem.View, true);
}
}
void drag_Rotate_Completed(ICSharpCode.WpfDesign.Designer.Controls.DragListener drag)
{
operation.Commit();
}
#endregion
protected override void OnInitialized()
@ -154,9 +164,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -154,9 +164,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
var designerItem = this.ExtendedItem.Component as FrameworkElement;
this.rotateTransform = designerItem.RenderTransform as RotateTransform;
if (rotateTransform != null)
angle = rotateTransform.Angle;
}
void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)

248
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SkewThumbExtension.cs

@ -0,0 +1,248 @@ @@ -0,0 +1,248 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.Extensions;
using System.Collections.Generic;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public sealed class SkewThumbExtension : SelectionAdornerProvider
{
readonly AdornerPanel adornerPanel;
readonly DesignItem[] extendedItemArray = new DesignItem[1];
private AdornerLayer _adornerLayer;
public SkewThumbExtension()
{
adornerPanel = new AdornerPanel();
adornerPanel.Order = AdornerOrder.BeforeForeground;
this.Adorners.Add(adornerPanel);
}
#region Skew
private Point startPoint;
private UIElement parent;
private SkewTransform skewTransform;
private double skewX;
private double skewY;
private DesignItem rtTransform;
private Thumb thumb1;
private Thumb thumb2;
PlacementOperation operation;
private void dragX_Started(DragListener drag)
{
_adornerLayer = this.adornerPanel.TryFindParent<AdornerLayer>();
var designerItem = this.ExtendedItem.Component as FrameworkElement;
this.parent = VisualTreeHelper.GetParent(designerItem) as UIElement;
startPoint = Mouse.GetPosition(this.parent);
if (this.skewTransform == null)
{
this.skewX = 0;
this.skewY = 0;
}
else
{
this.skewX = this.skewTransform.AngleX;
this.skewY = this.skewTransform.AngleY;
}
rtTransform = this.ExtendedItem.Properties[FrameworkElement.RenderTransformProperty].Value;
operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize);
}
private void dragX_Changed(DragListener drag)
{
Point currentPoint = Mouse.GetPosition(this.parent);
Vector deltaVector = Point.Subtract(currentPoint, this.startPoint);
var destAngle = (-0.5*deltaVector.X) + skewX;
if (destAngle == 0 && skewY == 0)
{
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformProperty).Reset();
rtTransform = null;
skewTransform = null;
}
else
{
if (rtTransform == null)
{
if (!this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformOriginProperty).IsSet) {
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformOriginProperty).SetValue(new Point(0.5,0.5));
}
if (this.skewTransform == null)
this.skewTransform = new SkewTransform(0, 0);
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformProperty).SetValue(skewTransform);
rtTransform = this.ExtendedItem.Properties[FrameworkElement.RenderTransformProperty].Value;
}
rtTransform.Properties["AngleX"].SetValue(destAngle);
}
_adornerLayer.UpdateAdornersForElement(this.ExtendedItem.View, true);
}
void dragX_Completed(ICSharpCode.WpfDesign.Designer.Controls.DragListener drag)
{
operation.Commit();
}
private void dragY_Started(DragListener drag)
{
_adornerLayer = this.adornerPanel.TryFindParent<AdornerLayer>();
var designerItem = this.ExtendedItem.Component as FrameworkElement;
this.parent = VisualTreeHelper.GetParent(designerItem) as UIElement;
startPoint = Mouse.GetPosition(this.parent);
if (this.skewTransform == null)
{
this.skewX = 0;
this.skewY = 0;
}
else
{
this.skewX = this.skewTransform.AngleX;
this.skewY = this.skewTransform.AngleY;
}
rtTransform = this.ExtendedItem.Properties[FrameworkElement.RenderTransformProperty].Value;
operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize);
}
private void dragY_Changed(DragListener drag)
{
Point currentPoint = Mouse.GetPosition(this.parent);
Vector deltaVector = Point.Subtract(currentPoint, this.startPoint);
var destAngle = (-0.5*deltaVector.Y) + skewY;
if (destAngle == 0 && skewX == 0)
{
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformProperty).Reset();
rtTransform = null;
skewTransform = null;
}
else
{
if (rtTransform == null)
{
if (!this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformOriginProperty).IsSet)
{
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformOriginProperty).SetValue(new Point(0.5, 0.5));
}
if (this.skewTransform == null)
this.skewTransform = new SkewTransform(0, 0);
this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformProperty).SetValue(skewTransform);
rtTransform = this.ExtendedItem.Properties[FrameworkElement.RenderTransformProperty].Value;
}
rtTransform.Properties["AngleY"].SetValue(destAngle);
}
_adornerLayer.UpdateAdornersForElement(this.ExtendedItem.View, true);
}
void dragY_Completed(ICSharpCode.WpfDesign.Designer.Controls.DragListener drag)
{
operation.Commit();
}
#endregion
protected override void OnInitialized()
{
if (this.ExtendedItem.Component is WindowClone)
return;
base.OnInitialized();
extendedItemArray[0] = this.ExtendedItem;
this.ExtendedItem.PropertyChanged += OnPropertyChanged;
var designerItem = this.ExtendedItem.Component as FrameworkElement;
this.skewTransform = designerItem.RenderTransform as SkewTransform;
if (skewTransform != null)
{
skewX = skewTransform.AngleX;
skewY = skewTransform.AngleY;
}
thumb1 = new Thumb() { Cursor = Cursors.ScrollWE, Height = 14, Width = 4, Opacity = 1 };
thumb2 = new Thumb() { Cursor = Cursors.ScrollNS, Width = 14, Height = 4, Opacity = 1 };
OnPropertyChanged(null, null);
adornerPanel.Children.Add(thumb1);
adornerPanel.Children.Add(thumb2);
DragListener drag1 = new DragListener(thumb1);
drag1.Started += dragX_Started;
drag1.Changed += dragX_Changed;
drag1.Completed += dragX_Completed;
DragListener drag2 = new DragListener(thumb2);
drag2.Started += dragY_Started;
drag2.Changed += dragY_Changed;
drag2.Completed += dragY_Completed;
}
void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender == null || e.PropertyName == "Width" || e.PropertyName == "Height") {
AdornerPanel.SetPlacement(thumb1,
new RelativePlacement(HorizontalAlignment.Center, VerticalAlignment.Top) {
YOffset = 0,
XOffset = -1 * ((FrameworkElement)ExtendedItem.View).ActualWidth / 4
});
AdornerPanel.SetPlacement(thumb2,
new RelativePlacement(HorizontalAlignment.Left, VerticalAlignment.Center) {
YOffset = -1 * ((FrameworkElement)ExtendedItem.View).ActualHeight / 4,
XOffset = 0
});
}
}
protected override void OnRemove()
{
this.ExtendedItem.PropertyChanged -= OnPropertyChanged;
base.OnRemove();
}
}
}

130
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs

@ -41,51 +41,51 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -41,51 +41,51 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
List<Snapline> horizontalMap;
List<Snapline> verticalMap;
double? baseline;
public const double Accuracy = 5;
public const double Margin = 8;
public override void BeginPlacement(PlacementOperation operation)
{
base.BeginPlacement(operation);
CreateSurface(operation);
}
public override void EndPlacement(PlacementOperation operation)
{
base.EndPlacement(operation);
DeleteSurface();
}
public override void EnterContainer(PlacementOperation operation)
{
base.EnterContainer(operation);
CreateSurface(operation);
}
public override void LeaveContainer(PlacementOperation operation)
{
base.LeaveContainer(operation);
DeleteSurface();
}
public override void BeforeSetPosition(PlacementOperation operation)
{
base.BeforeSetPosition(operation);
if (surface == null) return;
DesignPanel designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel == null || !designPanel.UseSnaplinePlacement)
return;
surface.Children.Clear();
if (Keyboard.IsKeyDown(Key.LeftCtrl)) return;
Rect bounds = Rect.Empty;
foreach (var item in operation.PlacedItems) {
bounds.Union(item.Bounds);
}
var horizontalInput = new List<Snapline>();
var verticalInput = new List<Snapline>();
var info = operation.PlacedItems[0];
@ -99,7 +99,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -99,7 +99,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
horizontalInput.Add(new Snapline() { Group = 1, Offset = textOffset, Start = bounds.Left, End = bounds.Right });
}
}
// debug
//foreach (var t in horizontalMap.Concat(horizontalInput)) {
// surface.Children.Add(new Line() { X1 = t.Start, X2 = t.End, Y1 = t.Offset, Y2 = t.Offset, Stroke = Brushes.Black });
@ -108,12 +108,12 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -108,12 +108,12 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
// surface.Children.Add(new Line() { X1 = t.Offset, X2 = t.Offset, Y1 = t.Start , Y2 = t.End, Stroke = Brushes.Black });
//}
//return;
List<Snapline> drawLines;
double delta;
if (Snap(horizontalInput, horizontalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Vertical == VerticalAlignment.Top) {
bounds.Y += delta;
@ -129,14 +129,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -129,14 +129,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
item.Bounds = r;
}
}
foreach (var d in drawLines) {
DrawLine(d.Start, d.Offset, d.End, d.Offset);
}
}
if (Snap(verticalInput, verticalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Horizontal == HorizontalAlignment.Left) {
bounds.X += delta;
@ -158,52 +158,81 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -158,52 +158,81 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
}
}
void CreateSurface(PlacementOperation operation)
{
if (ExtendedItem.Services.GetService<IDesignPanel>() != null) {
surface = new Canvas();
adornerPanel = new AdornerPanel();
adornerPanel.SetAdornedElement(ExtendedItem.View, ExtendedItem);
AdornerPanel.SetPlacement(surface, AdornerPlacement.FillContent);
adornerPanel.Children.Add(surface);
ExtendedItem.Services.DesignPanel.Adorners.Add(adornerPanel);
BuildMaps(operation);
if (operation.Type != PlacementType.Resize && operation.PlacedItems.Count == 1) {
baseline = GetBaseline(operation.PlacedItems[0].Item.View);
}
}
}
private IEnumerable<DesignItem> AllDesignItems(DesignItem designItem = null)
{
if (designItem == null && this.ExtendedItem.Services.DesignPanel is DesignPanel)
{
designItem = this.ExtendedItem.Services.DesignPanel.Context.RootItem;
if (designItem != null) {
yield return designItem;
if (designItem.ContentProperty.Value != null) {
yield return designItem.ContentProperty.Value;
designItem = designItem.ContentProperty.Value;
}
}
}
if (designItem != null && designItem.ContentProperty != null && designItem.ContentProperty.IsCollection)
foreach (var collectionElement in designItem.ContentProperty.CollectionElements)
{
if (collectionElement != null)
yield return collectionElement;
foreach (var el in AllDesignItems(collectionElement))
{
if (el != null)
yield return el;
}
}
}
void BuildMaps(PlacementOperation operation)
{
horizontalMap = new List<Snapline>();
verticalMap = new List<Snapline>();
var containerRect = new Rect(0, 0, ModelTools.GetWidth(ExtendedItem.View), ModelTools.GetHeight(ExtendedItem.View));
AddLines(containerRect, -Margin, false);
AddLines(containerRect, 0, false);
foreach (var item in ExtendedItem.ContentProperty.CollectionElements
.Except(operation.PlacedItems.Select(f => f.Item)))
{
var bounds = GetPosition(operation, item);
AddLines(bounds, 0, false);
AddLines(bounds, Margin, true);
AddBaseline(item, bounds, horizontalMap);
foreach (var item in AllDesignItems() /* ExtendedItem.ContentProperty.CollectionElements */
.Except(operation.PlacedItems.Select(f => f.Item))) {
if (item != null) {
var bounds = GetPosition(operation, item);
AddLines(bounds, 0, false);
AddLines(bounds, Margin, true);
AddBaseline(item, bounds, horizontalMap);
}
}
}
void AddLines(Rect r, double inflate, bool requireOverlap)
{
AddLines(r, inflate, requireOverlap, horizontalMap, verticalMap, null);
}
void AddLines(Rect r, double inflate, bool requireOverlap, List<Snapline> h, List<Snapline> v, PlacementAlignment? filter)
{
Rect r2 = r;
@ -217,8 +246,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -217,8 +246,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Left - 1, Start = r.Top, End = r.Bottom });
if (filter == null || filter.Value.Horizontal == HorizontalAlignment.Right)
v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Right - 1, Start = r.Top, End = r.Bottom });
if (filter == null)
{
h.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Top + Math.Abs((r2.Top - r2.Bottom) / 2), Start = r.Left, End = r.Right });
v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Left + Math.Abs((r2.Left - r2.Right) / 2), Start = r.Top, End = r.Bottom });
}
}
void AddBaseline(DesignItem item, Rect bounds, List<Snapline> list)
{
var baseline = GetBaseline(item.View);
@ -227,7 +262,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -227,7 +262,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
list.Add(new Snapline() { Group = 1, Offset = textOffset, Start = bounds.Left, End = bounds.Right });
}
}
void DeleteSurface()
{
if (surface != null) {
@ -238,7 +273,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -238,7 +273,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
verticalMap = null;
}
}
void DrawLine(double x1, double y1, double x2, double y2)
{
var line1 = new Line() {
@ -250,7 +285,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -250,7 +285,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
Stroke = Brushes.White
};
surface.Children.Add(line1);
var line2 = new Line() {
X1 = x1,
Y1 = y1,
@ -263,7 +298,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -263,7 +298,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
};
surface.Children.Add(line2);
}
//TODO: GlyphRun must be used
static double? GetBaseline(UIElement element) {
var textBox = element as TextBox;
@ -274,21 +309,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -274,21 +309,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
var textBlock = element as TextBlock;
if (textBlock != null)
return textBlock.TranslatePoint(new Point(0, textBlock.ActualHeight), element).Y;
return null;
}
static bool Snap(List<Snapline> input, List<Snapline> map, double accuracy,
out List<Snapline> drawLines, out double delta)
out List<Snapline> drawLines, out double delta)
{
delta = double.MaxValue;
drawLines = null;
foreach (var inputLine in input) {
foreach (var mapLine in map) {
if (Math.Abs(mapLine.Offset - inputLine.Offset) <= accuracy) {
if (!inputLine.RequireOverlap && !mapLine.RequireOverlap ||
Math.Max(inputLine.Start, mapLine.Start) < Math.Min(inputLine.End, mapLine.End))
Math.Max(inputLine.Start, mapLine.Start) < Math.Min(inputLine.End, mapLine.End))
{
if (mapLine.Group == inputLine.Group)
delta = mapLine.Offset - inputLine.Offset;
@ -296,10 +331,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -296,10 +331,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
}
}
if (delta == double.MaxValue) return false;
var offsetDict = new Dictionary<double, Snapline>();
foreach (var inputLine in input) {
inputLine.Offset += delta;
foreach (var mapLine in map) {
@ -318,11 +353,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -318,11 +353,11 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
}
}
drawLines = offsetDict.Values.ToList();
return true;
}
[DebuggerDisplay("Snapline: {Offset}")]
class Snapline
{
@ -334,3 +369,4 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -334,3 +369,4 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
}
}

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TopLeftContainerDragHandle.cs

@ -32,16 +32,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -32,16 +32,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
/// <summary>
/// The drag handle displayed for panels.
/// The drag handle displayed for Framework Elements
/// </summary>
[ExtensionServer(typeof(PrimarySelectionExtensionServer))]
[ExtensionFor(typeof(Panel))]
[ExtensionFor(typeof(Image))]
[ExtensionFor(typeof(MediaElement))]
[ExtensionFor(typeof(ItemsControl))]
[ExtensionFor(typeof(Border))]
[ExtensionFor(typeof(Viewbox))]
[ExtensionFor(typeof(ContentControl))]
[ExtensionServer(typeof(OnlyOneItemSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public class TopLeftContainerDragHandle : AdornerProvider
{
/// <summary/>
@ -50,9 +44,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -50,9 +44,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
ContainerDragHandle rect = new ContainerDragHandle();
rect.PreviewMouseDown += delegate(object sender, MouseButtonEventArgs e) {
Services.Selection.SetSelectedComponents(new DesignItem[] { this.ExtendedItem }, SelectionTypes.Auto);
//Services.Selection.SetSelectedComponents(new DesignItem[] { this.ExtendedItem }, SelectionTypes.Auto);
new DragMoveMouseGesture(this.ExtendedItem, false).Start(this.ExtendedItem.Services.DesignPanel,e);
e.Handled=true;
e.Handled=true;
};
RelativePlacement p = new RelativePlacement(HorizontalAlignment.Left, VerticalAlignment.Top);

93
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TopLeftContainerDragHandleMultipleItems.cs

@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign.Designer.Services;
using ICSharpCode.WpfDesign.Designer.Controls;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
/// <summary>
/// The drag handle displayed for Framework Elements
/// </summary>
[ExtensionServer(typeof(PrimarySelectionButOnlyWhenMultipleSelectedExtensionServer))]
[ExtensionFor(typeof(FrameworkElement))]
public class TopLeftContainerDragHandleMultipleItems : AdornerProvider
{
/// <summary/>
public TopLeftContainerDragHandleMultipleItems()
{ }
protected override void OnInitialized()
{
base.OnInitialized();
ContainerDragHandle rect = new ContainerDragHandle();
rect.PreviewMouseDown += delegate(object sender, MouseButtonEventArgs e) {
//Services.Selection.SetSelectedComponents(new DesignItem[] { this.ExtendedItem }, SelectionTypes.Auto);
new DragMoveMouseGesture(this.ExtendedItem, false).Start(this.ExtendedItem.Services.DesignPanel,e);
e.Handled=true;
};
var items = this.ExtendedItem.Services.Selection.SelectedItems;
double minX = 0;
double minY = 0;
double maxX = 0;
double maxY = 0;
foreach (DesignItem di in items) {
Point relativeLocation = di.View.TranslatePoint(new Point(0, 0), this.ExtendedItem.View);
minX = minX < relativeLocation.X ? minX : relativeLocation.X;
minY = minY < relativeLocation.Y ? minY : relativeLocation.Y;
maxX = maxX > relativeLocation.X + ((FrameworkElement)this.ExtendedItem.View).ActualWidth ? maxX : relativeLocation.X + ((FrameworkElement)this.ExtendedItem.View).ActualWidth;
maxY = maxY > relativeLocation.Y + ((FrameworkElement)this.ExtendedItem.View).ActualHeight ? maxY : relativeLocation.Y + ((FrameworkElement)this.ExtendedItem.View).ActualHeight;
}
Rectangle rect2 = new Rectangle() {
Width = (maxX - minX) + 4,
Height = (maxY - minY) + 4,
Stroke = Brushes.Black,
StrokeThickness = 2,
StrokeDashArray = new DoubleCollection(){ 2, 2 },
};
RelativePlacement p = new RelativePlacement(HorizontalAlignment.Left, VerticalAlignment.Top);
p.XOffset = minX - 3;
p.YOffset = minY - 3;
RelativePlacement p2 = new RelativePlacement(HorizontalAlignment.Left, VerticalAlignment.Top);
p2.XOffset = (minX + rect2.Width) - 2;
p2.YOffset = (minY + rect2.Height) - 2;
AddAdorner(p, AdornerOrder.Background, rect);
AddAdorner(p2, AdornerOrder.Background, rect2);
}
}
}

4
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs

@ -94,8 +94,8 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView @@ -94,8 +94,8 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
public static void OnIsSelectedChanged(DependencyObject s, DependencyPropertyChangedEventArgs e)
{
var el = s as FrameworkElement;
if (el != null)
var el = s as DragTreeViewItem;
if (el != null && el.IsSelected)
el.BringIntoView();
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -88,6 +88,8 @@ @@ -88,6 +88,8 @@
<Compile Include="Extensions\RenderTransformOriginExtension.cs" />
<Compile Include="Extensions\RightClickContextMenuExtension.cs" />
<Compile Include="OutlineView\OutlineNodeBase.cs" />
<Compile Include="Extensions\SkewThumbExtension.cs" />
<Compile Include="Extensions\TopLeftContainerDragHandleMultipleItems.cs" />
<Compile Include="PropertyGrid\Editors\FlatCollectionEditor.xaml.cs">
<DependentUpon>FlatCollectionEditor.xaml</DependentUpon>
<SubType>Code</SubType>

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Adorners/AdornerPanel.cs

@ -179,6 +179,11 @@ namespace ICSharpCode.WpfDesign.Adorners @@ -179,6 +179,11 @@ namespace ICSharpCode.WpfDesign.Adorners
/// </summary>
public static readonly AdornerOrder Foreground = new AdornerOrder(300);
/// <summary>
/// The adorner is in the before foreground layer.
/// </summary>
public static readonly AdornerOrder BeforeForeground = new AdornerOrder(400);
int i;
internal AdornerOrder(int i)

57
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs

@ -102,6 +102,63 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -102,6 +102,63 @@ namespace ICSharpCode.WpfDesign.Extensions
}
}
/// <summary>
/// Applies an extension to the primary selection, but only when multiple Items are selected!
/// </summary>
public class PrimarySelectionButOnlyWhenMultipleSelectedExtensionServer : PrimarySelectionExtensionServer
{
/// <summary>
/// Is called after the extension server is initialized and the Context property has been set.
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
this.Services.Selection.SelectionChanged += OnSelectionChanged;
}
void OnSelectionChanged(object sender, EventArgs e)
{
ReapplyExtensions(this.Services.Selection.SelectedItems);
}
/// <summary>
/// Gets if the item is in the secondary selection.
/// </summary>
public override bool ShouldApplyExtensions(DesignItem extendedItem)
{
return Services.Selection.PrimarySelection == extendedItem && Services.Selection.SelectionCount > 1;
}
}
/// <summary>
/// Applies an extension to the primary selection if Only One Item is Selected.
/// </summary>
public class OnlyOneItemSelectedExtensionServer : PrimarySelectionExtensionServer
{
/// <summary>
/// Is called after the extension server is initialized and the Context property has been set.
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
this.Services.Selection.SelectionChanged += OnSelectionChanged;
}
void OnSelectionChanged(object sender, EventArgs e)
{
if (this.Services.Selection.SelectedItems.Count > 1)
ReapplyExtensions(this.Services.Selection.SelectedItems);
}
/// <summary>
/// Gets if the item is the primary selection.
/// </summary>
public override bool ShouldApplyExtensions(DesignItem extendedItem)
{
return Services.Selection.PrimarySelection == extendedItem && Services.Selection.SelectionCount < 2;
}
}
/// <summary>
/// Applies an extension to the parent of the primary selection.
/// </summary>

7
src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using ICSharpCode.Core;
@ -53,6 +54,7 @@ namespace AddInScout @@ -53,6 +54,7 @@ namespace AddInScout
CodonLV.Columns.Add("Codon ID", 175,HorizontalAlignment.Left);
CodonLV.Columns.Add("Codon Class", 400,HorizontalAlignment.Left);
CodonLV.Columns.Add("Codon Condition -> Action on Fail", 600,HorizontalAlignment.Left);
CodonLV.Columns.Add("Label", 450, HorizontalAlignment.Left);
ExtTextBox.Text = "Extension : ";
ExtTextBox.ReadOnly = true;
@ -105,9 +107,8 @@ namespace AddInScout @@ -105,9 +107,8 @@ namespace AddInScout
lvi.SubItems.Add(c.Properties.Contains("class") ? c.Properties["class"] : "");
foreach (ICondition condition in c.Conditions) {
lvi.SubItems.Add(condition.Name + ", " + condition.Action);
}
lvi.SubItems.Add(string.Join(";", c.Conditions.Select(a => a.Name + ": " + a.Action)));
lvi.SubItems.Add(c.Properties.Contains("label") ? c.Properties["label"] : "");
CodonLV.Items.Add(lvi);
}
}

49
src/AddIns/Misc/ICSharpCode.Reporting.Tests/Factory/ReportingFactoryFixture.cs

@ -1,49 +0,0 @@ @@ -1,49 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.IO;
using System.Reflection;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Tests.Factory
{
[TestFixture]
public class ReportingFactoryFixture
{
private const string nS = "ICSharpCode.Reporting.Tests.TestReports.";
private const string reportName = "PlainModel.srd";
private Stream stream;
[Test]
public void CreateFormSheetBuilder()
{
var r = new ReportingFactory();
var x = r.CreatePageBuilder(stream);
Assert.That(x,Is.Null);
}
[SetUp]
public void LoadFromStream()
{
System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();
stream = asm.GetManifestResourceStream(nS + reportName);
}
}
}

96
src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/LoadPlainModelFixture.cs

@ -1,96 +0,0 @@ @@ -1,96 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.IO;
using System.Reflection;
using ICSharpCode.Reporting.Globals;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Tests.Model
{
[TestFixture]
public class LoadPlainModelFixture
{
private const string nS = "ICSharpCode.Reporting.Tests.TestReports.";
private const string reportName = "PlainModel.srd";
private Stream stream;
[Test]
public void CanLoadFromResource()
{
Assert.IsNotNull(stream);
}
[Test]
public void LoadPlainModel()
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.IsNotNull(model);
}
[Test]
public void ReportSettingsFromPlainModel()
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.That(model.ReportSettings,Is.Not.Null);
}
[Test]
public void ReportSettingsReportName()
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.That(model.ReportSettings.ReportName,Is.EqualTo(Globals.GlobalValues.DefaultReportName));
}
[Test]
public void ReportSettingsDataModelFormSheet()
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.That(model.ReportSettings.DataModel,Is.EqualTo(GlobalEnums.PushPullModel.FormSheet));
}
[Test]
public void ReportSettingsPageSize()
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.That(model.ReportSettings.PageSize,Is.EqualTo(Globals.GlobalValues.DefaultPageSize));
}
[SetUp]
public void LoadFromStream()
{
System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();
stream = asm.GetManifestResourceStream(nS + reportName);
}
}
}

58
src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/ReportModelFixture.cs

@ -1,58 +0,0 @@ @@ -1,58 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Reporting.Items;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Tests.Model
{
[TestFixture]
public class ReportModelFixture
{
private ReportModel model;
[Test]
public void CanCreateReportModel()
{
Assert.That(model,Is.Not.Null);
}
[Test]
public void ModelInitializeReportSettings()
{
Assert.That(model.ReportSettings,Is.Not.Null);
}
[Test]
public void ModelReturnsPlainReportName()
{
Assert.That(model.ReportSettings.ReportName,Is.EqualTo(Globals.GlobalValues.DefaultReportName));
}
[SetUp]
public void CreateModel()
{
model = ReportModel.Create();
}
}
}

61
src/AddIns/Misc/ICSharpCode.Reporting.Tests/Model/ReportSettingsFixture.cs

@ -1,61 +0,0 @@ @@ -1,61 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Drawing;
using ICSharpCode.Reporting.Globals;
using ICSharpCode.Reporting.Items;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Tests
{
[TestFixture]
public class ReportSettingsFixture
{
ReportSettings reportSettings;
[Test]
public void DefaultConstructureShouldReturnStandardValues()
{
Assert.IsNotNull(reportSettings,"Should not be 'null'");
Assert.AreEqual(GlobalValues.DefaultReportName,reportSettings.ReportName);
}
[Test]
public void DefaultPageSize ()
{
Assert.AreEqual(GlobalValues.DefaultPageSize,reportSettings.PageSize);
}
[Test]
public void LandScape_True_Return_PageSize_For_LandScape ()
{
reportSettings.Landscape = true;
var landscapeSize = new Size(Globals.GlobalValues.DefaultPageSize.Height,
Globals.GlobalValues.DefaultPageSize.Width);
Assert.That(reportSettings.PageSize,Is.EqualTo(landscapeSize));
}
[SetUp]
public void Setup () {
reportSettings = new ReportSettings();
}
}
}

86
src/AddIns/Misc/ICSharpCode.Reporting.Tests/TestReports/PlainModel.srd

@ -1,86 +0,0 @@ @@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ReportModel>
<ReportSettings>
<ReportSettings>
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<DataModel>FormSheet</DataModel>
<FileName>D:\SharpDevelop3.0_CHECKOUT\SharpDevelop\bin\Raaaaaeport1.srd</FileName>
<RightMargin>50</RightMargin>
<UseStandardPrinter>True</UseStandardPrinter>
<SortColumnCollection />
<AvailableFieldsCollection />
<NoDataMessage>No Data for this Report</NoDataMessage>
<LeftMargin>50</LeftMargin>
<PageSize>827, 1169</PageSize>
<Padding>5, 5, 5, 5</Padding>
<BottomMargin>50</BottomMargin>
<CommandType>Text</CommandType>
<ParameterCollection />
<Landscape>False</Landscape>
<ReportName>Report1</ReportName>
<TopMargin>50</TopMargin>
<GroupColumnsCollection />
<GraphicsUnit>Millimeter</GraphicsUnit>
<CommandText />
<ReportType>FormSheet</ReportType>
<ConnectionString />
</ReportSettings>
</ReportSettings>
<SectionCollection>
<BaseSection>
<Size>727, 60</Size>
<Name>ReportHeader</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>0</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>White</BackColor>
<Items />
<Location>50, 50</Location>
<DrawBorder>False</DrawBorder>
</BaseSection>
<BaseSection>
<Size>727, 60</Size>
<Name>ReportPageHeader</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>0</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>White</BackColor>
<Items />
<Location>50, 125</Location>
<DrawBorder>False</DrawBorder>
</BaseSection>
<BaseSection>
<Size>727, 60</Size>
<Name>ReportDetail</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>0</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>White</BackColor>
<Items />
<Location>50, 200</Location>
<DrawBorder>False</DrawBorder>
</BaseSection>
<BaseSection>
<Size>727, 60</Size>
<Name>ReportPageFooter</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>0</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>White</BackColor>
<Items />
<Location>50, 275</Location>
<DrawBorder>False</DrawBorder>
</BaseSection>
<BaseSection>
<Size>727, 60</Size>
<Name>ReportFooter</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>0</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>White</BackColor>
<Items />
<Location>50, 350</Location>
<DrawBorder>False</DrawBorder>
</BaseSection>
</SectionCollection>
</ReportModel>

1
src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs

@ -68,6 +68,7 @@ namespace ICSharpCode.PackageManagement @@ -68,6 +68,7 @@ namespace ICSharpCode.PackageManagement
try {
repository = RegisteredPackageRepositories.ActiveRepository;
} catch (Exception ex) {
repository = null;
errorMessage = ex.Message;
}
}

4
src/AddIns/Misc/PackageManagement/Project/Src/IPackageExtensions.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Linq;
using NuGet;
namespace ICSharpCode.PackageManagement
@ -45,7 +46,8 @@ namespace ICSharpCode.PackageManagement @@ -45,7 +46,8 @@ namespace ICSharpCode.PackageManagement
public static bool IsProjectPackage(this IPackage package)
{
return package.HasProjectContent();
return package.HasProjectContent() ||
package.DependencySets.SelectMany(p => p.Dependencies).Any();
}
}
}

23
src/AddIns/Misc/PackageManagement/Project/Src/ManagePackagesView.xaml

@ -47,7 +47,26 @@ @@ -47,7 +47,26 @@
Grid.Column="1"
Margin="4, 4"
TextTrimming="CharacterEllipsis"
Text="{Binding Path=Message}"/>
Text="{Binding Path=Message}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="ToolTip">
<Setter.Value>
<TextBlock
Text="{Binding Message}"
TextWrapping="WrapWithOverflow"
TextTrimming="CharacterEllipsis"
MaxWidth="400" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Message}" Value="{x:Null}">
<Setter Property="ToolTip" Value="{x:Null}" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Button
Grid.Column="2"
Content="{core:Localize Global.CloseButtonText}"
@ -76,4 +95,4 @@ @@ -76,4 +95,4 @@
</TabItem>
</TabControl>
</DockPanel>
</Window>
</Window>

5
src/AddIns/Misc/PackageManagement/Project/Src/PackagesViewModel.cs

@ -275,11 +275,6 @@ namespace ICSharpCode.PackageManagement @@ -275,11 +275,6 @@ namespace ICSharpCode.PackageManagement
return null;
}
protected virtual bool IsProjectPackage (IPackage package)
{
return package.IsProjectPackage();
}
/// <summary>
/// Allows filtering of the packages before paging the results. Call base class method
/// to run default filtering.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/Microsoft.Web.XmlTransform.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Console.Types.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.exe

Binary file not shown.

2
src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj

@ -119,12 +119,10 @@ @@ -119,12 +119,10 @@
<Compile Include="Src\Helpers\PropertiesHelper.cs" />
<Compile Include="Src\Helpers\SelectedProjectCollectionAssert.cs" />
<Compile Include="Src\Helpers\SolutionHelper.cs" />
<Compile Include="Src\Helpers\TestableAvailablepackagesViewModel.cs" />
<Compile Include="Src\Helpers\TestableInstalledPackageViewModel.cs" />
<Compile Include="Src\Helpers\TestablePackageFromRepository.cs" />
<Compile Include="Src\Helpers\TestablePackagesViewModels.cs" />
<Compile Include="Src\Helpers\TestableProjectBehaviour.cs" />
<Compile Include="Src\Helpers\TestableRecentPackagesViewModel.cs" />
<Compile Include="Src\Helpers\TestableSelectedProjectsForUpdatedPackages.cs" />
<Compile Include="Src\Helpers\TestableSolutionSnapshot.cs" />
<Compile Include="Src\Helpers\TestableUpdatePackagesAction.cs" />

34
src/AddIns/Misc/PackageManagement/Test/Src/AvailablePackagesViewModelTests.cs

@ -30,7 +30,7 @@ namespace PackageManagement.Tests @@ -30,7 +30,7 @@ namespace PackageManagement.Tests
[TestFixture]
public class AvailablePackagesViewModelTests
{
TestableAvailablePackagesViewModel viewModel;
AvailablePackagesViewModel viewModel;
PackageManagementEvents packageManagementEvents;
FakeRegisteredPackageRepositories registeredPackageRepositories;
ExceptionThrowingRegisteredPackageRepositories exceptionThrowingRegisteredPackageRepositories;
@ -53,7 +53,7 @@ namespace PackageManagement.Tests @@ -53,7 +53,7 @@ namespace PackageManagement.Tests
var packageViewModelFactory = new FakePackageViewModelFactory();
packageManagementEvents = new PackageManagementEvents();
viewModel = new TestableAvailablePackagesViewModel(
viewModel = new AvailablePackagesViewModel(
new FakePackageManagementSolution(),
packageManagementEvents,
registeredPackageRepositories,
@ -385,7 +385,7 @@ namespace PackageManagement.Tests @@ -385,7 +385,7 @@ namespace PackageManagement.Tests
public void ReadPackages_ExceptionThrownWhenAccessingActiveRepository_ErrorMessageFromExceptionNotOverriddenByReadPackagesCall()
{
CreateExceptionThrowingRegisteredPackageRepositories();
exceptionThrowingRegisteredPackageRepositories.ExeptionToThrowWhenActiveRepositoryAccessed =
exceptionThrowingRegisteredPackageRepositories.ExceptionToThrowWhenActiveRepositoryAccessed =
new Exception("Test");
CreateViewModel(exceptionThrowingRegisteredPackageRepositories);
viewModel.ReadPackages();
@ -621,5 +621,33 @@ namespace PackageManagement.Tests @@ -621,5 +621,33 @@ namespace PackageManagement.Tests
};
PackageCollectionAssert.AreEqual(expectedPackages, allPackages);
}
[Test]
public void ReadPackages_ActiveRepositoryChangedWhichUsesInvalidUrl_InvalidUrlExceptionIsShownAsErrorMessage()
{
CreateExceptionThrowingRegisteredPackageRepositories();
CreateViewModel(exceptionThrowingRegisteredPackageRepositories);
var package = new FakePackage("Test", "0.1.0.0");
exceptionThrowingRegisteredPackageRepositories
.FakeActiveRepository
.FakePackages
.Add(package);
viewModel.ReadPackages();
CompleteReadPackagesTask();
taskFactory.ClearAllFakeTasks();
exceptionThrowingRegisteredPackageRepositories.ExceptionToThrowWhenActiveRepositoryAccessed =
new Exception("Invalid url");
viewModel.ReadPackages();
FakeTask<PackagesForSelectedPageResult> task = taskFactory.FirstFakeTaskCreated;
ApplicationException ex = Assert.Throws<ApplicationException>(() => task.ExecuteTaskButNotContinueWith());
task.Exception = new AggregateException(ex);
task.IsFaulted = true;
task.ExecuteContinueWith();
Assert.AreEqual("Invalid url", ex.Message);
Assert.IsTrue(viewModel.HasError);
Assert.AreEqual("Invalid url", viewModel.ErrorMessage);
}
}
}

12
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ExceptionThrowingRegisteredPackageRepositories.cs

@ -25,23 +25,23 @@ namespace PackageManagement.Tests.Helpers @@ -25,23 +25,23 @@ namespace PackageManagement.Tests.Helpers
{
public class ExceptionThrowingRegisteredPackageRepositories : FakeRegisteredPackageRepositories
{
public Exception ExeptionToThrowWhenActiveRepositoryAccessed { get; set; }
public Exception ExceptionToThrowWhenActiveRepositoryAccessed { get; set; }
public override IPackageRepository ActiveRepository {
get {
if (ExeptionToThrowWhenActiveRepositoryAccessed != null) {
throw ExeptionToThrowWhenActiveRepositoryAccessed;
if (ExceptionToThrowWhenActiveRepositoryAccessed != null) {
throw ExceptionToThrowWhenActiveRepositoryAccessed;
}
return base.ActiveRepository;
}
}
public Exception ExeptionToThrowWhenRecentPackageRepositoryAccessed { get; set; }
public Exception ExceptionToThrowWhenRecentPackageRepositoryAccessed { get; set; }
public override IRecentPackageRepository RecentPackageRepository {
get {
if (ExeptionToThrowWhenRecentPackageRepositoryAccessed != null) {
throw ExeptionToThrowWhenRecentPackageRepositoryAccessed;
if (ExceptionToThrowWhenRecentPackageRepositoryAccessed != null) {
throw ExceptionToThrowWhenRecentPackageRepositoryAccessed;
}
return base.RecentPackageRepository;
}

55
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestableAvailablepackagesViewModel.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.PackageManagement;
namespace PackageManagement.Tests.Helpers
{
/// <summary>
/// Description of TestableAvailablepackagesViewModel.
/// </summary>
public class TestableAvailablePackagesViewModel : AvailablePackagesViewModel
{
public TestableAvailablePackagesViewModel(
IPackageManagementSolution solution,
IPackageManagementEvents packageManagementEvents,
IRegisteredPackageRepositories registeredPackageRepositories,
IPackageViewModelFactory packageViewModelFactory,
ITaskFactory taskFactory)
: base(
solution,
packageManagementEvents,
registeredPackageRepositories,
packageViewModelFactory,
taskFactory)
{
IsProjectPackageReturnsValue = true;
IsProjectPackageIsCalled = false;
}
protected override bool IsProjectPackage(NuGet.IPackage package)
{
IsProjectPackageIsCalled = true;
return IsProjectPackageReturnsValue;
}
public bool IsProjectPackageReturnsValue { get; set; }
public bool IsProjectPackageIsCalled { get; set; }
}
}

9
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestablePackagesViewModels.cs

@ -21,9 +21,6 @@ using ICSharpCode.PackageManagement; @@ -21,9 +21,6 @@ using ICSharpCode.PackageManagement;
namespace PackageManagement.Tests.Helpers
{
/// <summary>
/// Description of TestablePackagesViewModels.
/// </summary>
public class TestablePackagesViewModels : PackagesViewModels
{
public TestablePackagesViewModels(
@ -31,15 +28,15 @@ namespace PackageManagement.Tests.Helpers @@ -31,15 +28,15 @@ namespace PackageManagement.Tests.Helpers
IRegisteredPackageRepositories registeredPackageRepositories,
IThreadSafePackageManagementEvents packageManagementEvents,
IPackageActionRunner actionRunner,
ITaskFactory taskFactory) : base()
ITaskFactory taskFactory)
{
var packageViewModelFactory = new PackageViewModelFactory(solution, packageManagementEvents, actionRunner);
var updatedPackageViewModelFactory = new UpdatedPackageViewModelFactory(packageViewModelFactory);
AvailablePackagesViewModel = new TestableAvailablePackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
AvailablePackagesViewModel = new AvailablePackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
InstalledPackagesViewModel = new InstalledPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
UpdatedPackagesViewModel = new UpdatedPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, updatedPackageViewModelFactory, taskFactory);
RecentPackagesViewModel = new TestableRecentPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
RecentPackagesViewModel = new RecentPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
}
}
}

55
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestableRecentPackagesViewModel.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.PackageManagement;
namespace PackageManagement.Tests.Helpers
{
/// <summary>
/// Description of TestableRecentPackagesViewModel.
/// </summary>
public class TestableRecentPackagesViewModel : RecentPackagesViewModel
{
public TestableRecentPackagesViewModel(
IPackageManagementSolution solution,
IPackageManagementEvents packageManagementEvents,
IRegisteredPackageRepositories registeredPackageRepositories,
IPackageViewModelFactory packageViewModelFactory,
ITaskFactory taskFactory)
: base(
solution,
packageManagementEvents,
registeredPackageRepositories,
packageViewModelFactory,
taskFactory)
{
IsProjectPackageReturnsValue = true;
IsProjectPackageIsCalled = false;
}
protected override bool IsProjectPackage(NuGet.IPackage package)
{
IsProjectPackageIsCalled = true;
return IsProjectPackageReturnsValue;
}
public bool IsProjectPackageReturnsValue { get; set; }
public bool IsProjectPackageIsCalled { get; set; }
}
}

86
src/AddIns/Misc/PackageManagement/Test/Src/IPackageExtensionsTests.cs

@ -32,7 +32,28 @@ namespace PackageManagement.Tests @@ -32,7 +32,28 @@ namespace PackageManagement.Tests
void CreatePackageWithSummary(string summary)
{
package = new FakePackage() { Summary = summary };
package = new FakePackage { Summary = summary };
}
void CreatePackageWithTitle(string title)
{
package = new FakePackage { Title = title };
}
void CreatePackageWithNoProjectContent()
{
package = new FakePackage();
}
void CreatePackageWithProjectContent()
{
CreatePackageWithNoProjectContent();
package.FrameworkAssembliesList.Add(new FrameworkAssemblyReference("System.Xml"));
}
void AddDependencyToPackage()
{
package.AddDependency("Id");
}
[Test]
@ -66,5 +87,68 @@ namespace PackageManagement.Tests @@ -66,5 +87,68 @@ namespace PackageManagement.Tests
Assert.AreEqual("description", result);
}
[Test]
public void GetName_PackageHasTitle_ReturnsTitle()
{
CreatePackageWithTitle("title");
string result = package.GetName();
Assert.AreEqual("title", result);
}
[Test]
public void GetName_PackageHasNullTitle_ReturnsPackageId()
{
CreatePackageWithTitle(null);
package.Id = "Id";
string result = package.GetName();
Assert.AreEqual("Id", result);
}
[Test]
public void GetName_PackageHasEmptyStringTitle_ReturnsPackageId()
{
CreatePackageWithTitle(String.Empty);
package.Id = "Id";
string result = package.GetName();
Assert.AreEqual("Id", result);
}
[Test]
public void IsProjectPackage_PackageHasNoProjectContent_ReturnsFalse()
{
CreatePackageWithNoProjectContent();
bool result = package.IsProjectPackage();
Assert.IsFalse(result);
}
[Test]
public void IsProjectPackage_PackageHasProjectContent_ReturnsTrie()
{
CreatePackageWithProjectContent();
bool result = package.IsProjectPackage();
Assert.IsTrue(result);
}
[Test]
public void IsProjectPackage_PackageHasNoProjectContentButHasDependency_ReturnsTrue()
{
CreatePackageWithNoProjectContent();
AddDependencyToPackage();
bool result = package.IsProjectPackage();
Assert.IsTrue(result);
}
}
}

6
src/AddIns/Misc/PackageManagement/Test/Src/RecentPackagesViewModelTests.cs

@ -27,7 +27,7 @@ namespace PackageManagement.Tests @@ -27,7 +27,7 @@ namespace PackageManagement.Tests
[TestFixture]
public class RecentPackagesViewModelTests
{
TestableRecentPackagesViewModel viewModel;
RecentPackagesViewModel viewModel;
PackageManagementEvents packageManagementEvents;
FakeRegisteredPackageRepositories registeredPackageRepositories;
FakeTaskFactory taskFactory;
@ -43,7 +43,7 @@ namespace PackageManagement.Tests @@ -43,7 +43,7 @@ namespace PackageManagement.Tests
taskFactory = new FakeTaskFactory();
var packageViewModelFactory = new FakePackageViewModelFactory();
packageManagementEvents = new PackageManagementEvents();
viewModel = new TestableRecentPackagesViewModel(
viewModel = new RecentPackagesViewModel(
new FakePackageManagementSolution(),
packageManagementEvents,
registeredPackageRepositories,
@ -143,7 +143,7 @@ namespace PackageManagement.Tests @@ -143,7 +143,7 @@ namespace PackageManagement.Tests
public void ReadPackages_ExceptionThrownWhenAccessingActiveRepository_ErrorMessageFromExceptionNotOverriddenByReadPackagesCall()
{
var registeredRepositories = new ExceptionThrowingRegisteredPackageRepositories();
registeredRepositories.ExeptionToThrowWhenRecentPackageRepositoryAccessed =
registeredRepositories.ExceptionToThrowWhenRecentPackageRepositoryAccessed =
new Exception("Test");
CreateViewModel(registeredRepositories);

2
src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "Regular expressions toolkit"
<AddIn name = "Regular Expressions Toolkit"
author = "Markus Palme"
copyright = "prj:///doc/copyright.txt"
description = "Testing toolkit for regular expressions"

15
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj

@ -82,6 +82,7 @@ @@ -82,6 +82,7 @@
<Folder Include="src\Globals" />
<Folder Include="src\DesignableItems" />
<Folder Include="src\Factory" />
<Folder Include="src\Dialogs" />
<Folder Include="src\Wizard" />
<Folder Include="src\Toolbox" />
<Folder Include="src\TypeProvider" />
@ -90,12 +91,19 @@ @@ -90,12 +91,19 @@
<Folder Include="src\Views" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="src\Commands\ViewCommands.cs" />
<Compile Include="src\DesignableItems\AbstractGraphicItem.cs" />
<Compile Include="src\DesignableItems\AbstractItem.cs" />
<Compile Include="src\DesignableItems\BaseCircleItem.cs" />
<Compile Include="src\DesignableItems\BaseLineItem.cs" />
<Compile Include="src\DesignableItems\BaseRectangleItem.cs" />
<Compile Include="src\DesignableItems\BaseSection.cs" />
<Compile Include="src\DesignableItems\BaseTextItem.cs" />
<Compile Include="src\DesignableItems\BaseDataItem.cs" />
<Compile Include="src\DesignableItems\ReportSettings.cs" />
<Compile Include="src\DesignerBinding\DesignerBinding.cs" />
<Compile Include="src\DesignerBinding\DesignerGenerator.cs" />
@ -104,14 +112,18 @@ @@ -104,14 +112,18 @@
<Compile Include="src\DesignerBinding\ReportDefinitionDeserializer.cs" />
<Compile Include="src\DesignerBinding\ReportDesignerLoader.cs" />
<Compile Include="src\Designer\AbstractDesigner.cs" />
<Compile Include="src\Designer\DataItemDesigner.cs" />
<Compile Include="src\Designer\LineDesigner.cs" />
<Compile Include="src\Designer\ContainerDesigner.cs" />
<Compile Include="src\Designer\ReportRootDesigner.cs" />
<Compile Include="src\Designer\ReportSettingsDesigner.cs" />
<Compile Include="src\Designer\RootReportModel.cs" />
<Compile Include="src\Designer\SectionDesigner.cs" />
<Compile Include="src\Designer\TextItemDesigner.cs" />
<Compile Include="src\Dialogs\DataTypeStringConverter.cs" />
<Compile Include="src\Factory\CreateFormSheetFromModel.cs" />
<Compile Include="src\Globals\DesignerGlobals.cs" />
<Compile Include="src\Globals\GlobalLists.cs" />
<Compile Include="src\Globals\StringWriterWithEncoding.cs" />
<Compile Include="src\Services\DefaultMemberRelationshipService.cs" />
<Compile Include="src\Services\DesignerSerializationService.cs" />
@ -126,7 +138,10 @@ @@ -126,7 +138,10 @@
<Compile Include="src\Toolbox\SideTabItemDesigner.cs" />
<Compile Include="src\Toolbox\ToolboxProvider.cs" />
<Compile Include="src\TypeProvider\AbstractItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\CircleItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\DataItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\LineItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\RectangleItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\SectionItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\TextItemTypeProvider.cs" />
<Compile Include="src\TypeProvider\TypeProviderHelper.cs" />

62
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/AbstractGraphicItem.cs

@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 05.04.2014
* Time: 17:26
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Drawing.Drawing2D;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
/// <summary>
/// Description of AbstractGraphicItem.
/// </summary>
public class AbstractGraphicItem:AbstractItem
{
float thickness;
DashStyle dashStyle;
public AbstractGraphicItem()
{
Thickness = 1;
DashStyle = DashStyle.Solid;
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
base.OnPaint(e);
Draw(e.Graphics);
}
public override void Draw(System.Drawing.Graphics graphics)
{
}
[Category("Appearance")]
public DashStyle DashStyle {
get { return dashStyle; }
set {
dashStyle = value;
Invalidate();
}
}
[Category("Appearance")]
public float Thickness {
get { return thickness; }
set {
thickness = value;
Invalidate();
}
}
}
}

48
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseCircleItem.cs

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 17.04.2014
* Time: 19:53
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Drawing;
using ICSharpCode.Reporting.Addin.Designer;
using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
/// <summary>
/// Description of BaseCircleItem.
/// </summary>
///
[Designer(typeof(ContainerDesigner))]
class BaseCircleItem:AbstractGraphicItem
{
public BaseCircleItem()
{
TypeDescriptor.AddProvider(new CircleItemTypeProvider(), typeof(BaseCircleItem));
}
public override void Draw(Graphics graphics)
{
if (graphics == null) {
throw new ArgumentNullException("graphics");
}
var rect = new Rectangle(ClientRectangle.Left,
ClientRectangle.Top,
ClientRectangle.Right -1,
ClientRectangle.Bottom -1);
using (var pen = new Pen(ForeColor,Thickness)) {
graphics.DrawEllipse(pen,rect);
}
}
}
}

42
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseDataItem.cs

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 04.04.2014
* Time: 20:10
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using ICSharpCode.Reporting.Addin.Designer;
using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
/// <summary>
/// Description of Class1.
/// </summary>
///
[Designer(typeof(DataItemDesigner))]
public class BaseDataItem:BaseTextItem
{
const string datatypeOfTheUnderlyingColumn = "Datatype of the underlying Column";
const string tableName = "TableName";
const string showIfColumnvalueIsEmpty = "Show if Column is empty";
public BaseDataItem() {
TypeDescriptor.AddProvider(new DataItemTypeProvider(), typeof(BaseDataItem));
}
[Category("Databinding"), Description(datatypeOfTheUnderlyingColumn)]
public string ColumnName {get;set;}
// [Category("Databinding"), Description(tableName)]
// public string BaseTableName {get;set;}
[Category("Databinding"), Description(showIfColumnvalueIsEmpty)]
public string NullValue {get;set;}
}
}

75
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs

@ -16,25 +16,23 @@ using ICSharpCode.Reporting.Addin.TypeProvider; @@ -16,25 +16,23 @@ using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
[Designer(typeof(LineDesigner))]
public class BaseLineItem:AbstractItem
public class BaseLineItem:AbstractGraphicItem
{
Point fromPoint;
Point toPoint;
LineCap startLineCap;
LineCap endLineCap;
DashCap dashLineCap;
DashStyle dashStyle;
float thickness;
public BaseLineItem()
{
this.thickness = 1;
this.dashStyle = DashStyle.Solid;
this.Size = new Size(50,10);
TypeDescriptor.AddProvider(new LineItemTypeProvider(), typeof(BaseLineItem));
this.SetStartEndPoint();
}
void SetStartEndPoint ()
{
fromPoint = new Point(ClientRectangle.Left + 10,ClientRectangle.Height / 2);
@ -59,9 +57,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -59,9 +57,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
if (graphics == null) {
throw new ArgumentNullException("graphics");
}
using (Pen p = new Pen(this.ForeColor,this.Thickness)) {
p.SetLineCap(this.StartLineCap,this.EndLineCap,this.DashLineCap);
graphics.DrawLine(p,this.fromPoint,this.toPoint);
using (var p = new Pen(ForeColor,Thickness)) {
p.SetLineCap(StartLineCap,EndLineCap,DashLineCap);
graphics.DrawLine(p,fromPoint,toPoint);
}
}
@ -70,13 +68,13 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -70,13 +68,13 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
get { return fromPoint; }
set {
Point x = value;
if (!this.ClientRectangle.Contains(x)) {
this.fromPoint = new Point(x.X - this.Location.X,
x.Y - this.Location.Y);
if (!ClientRectangle.Contains(x)) {
fromPoint = new Point(x.X - Location.X,x.Y - Location.Y);
} else {
this.fromPoint = x;
fromPoint = x;
}
this.Invalidate();
Invalidate();
}
}
@ -86,8 +84,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -86,8 +84,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
set {
Point x = value;
if (!ClientRectangle.Contains(x)) {
this.toPoint = new Point(x.X - this.Location.X,
x.Y - this.Location.Y);
toPoint = new Point(x.X - Location.X,x.Y - Location.Y);
}
else {
toPoint = x;
@ -97,63 +95,34 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -97,63 +95,34 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
}
// [Browsable(true),
// Category("Appearance"),
// Description("LineStyle")]
public DashStyle DashStyle {
get { return dashStyle; }
set {
dashStyle = value;
this.Invalidate();
}
}
// [Browsable(true),
// Category("Appearance"),
// Description("Thickness of Line")]
public float Thickness {
get { return thickness; }
set {
thickness = value;
this.Invalidate();
}
}
// [Browsable(true),
// Category("Appearance"),
// Description("LineCap at Startposition")]
[ Category("Appearance")]
public LineCap StartLineCap {
get { return startLineCap; }
set {
startLineCap = value;
this.Invalidate();
Invalidate();
}
}
// [Browsable(true),
// Category("Appearance"),
// Description("Linecap at Endposition")]
[ Category("Appearance")]
public LineCap EndLineCap {
get { return endLineCap; }
set {
endLineCap = value;
this.Invalidate();
Invalidate();
}
}
// [Browsable(true),
// Category("Appearance"),
// Description("Dashlinecap")]
[Category("Appearance")]
public DashCap DashLineCap {
get { return dashLineCap; }
set {
dashLineCap = value;
this.Invalidate();
Invalidate();
}
}
}
}
}

162
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseRectangleItem.cs

@ -0,0 +1,162 @@ @@ -0,0 +1,162 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 05.04.2014
* Time: 17:23
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using ICSharpCode.Reporting.Addin.DesignableItems;
using ICSharpCode.Reporting.Addin.Designer;
using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
/// <summary>
/// Description of BaseRectangleItem.
/// </summary>
///
[Designer(typeof(ContainerDesigner))]
class BaseRectangleItem:AbstractGraphicItem
{
int cornerRadius = 1;
public BaseRectangleItem()
{
TypeDescriptor.AddProvider(new RectangleItemTypeProvider(), typeof(BaseRectangleItem));
}
public override void Draw(Graphics graphics)
{
if (graphics == null) {
throw new ArgumentNullException("graphics");
}
var rect = new Rectangle(ClientRectangle.Left,
ClientRectangle.Top,
ClientRectangle.Right -1,
ClientRectangle.Bottom -1);
var path = RoundedRectangle.Create(rect,CornerRadius,
RoundedRectangle.RectangleCorners.All);
using (var pen = new Pen(this.ForeColor,Thickness)) {
graphics.DrawPath(pen, path);
}
}
[Category("Appearance")]
public int CornerRadius {
get { return cornerRadius; }
set {
cornerRadius = value;
Invalidate();
}
}
}
static class RoundedRectangle
{
public enum RectangleCorners
{
None = 0, TopLeft = 1, TopRight = 2, BottomLeft = 4, BottomRight = 8,
All = TopLeft | TopRight | BottomLeft | BottomRight
}
public static GraphicsPath Create(int x, int y, int width, int height,
int radius, RectangleCorners corners)
{
int xw = x + width;
int yh = y + height;
int xwr = xw - radius;
int yhr = yh - radius;
int xr = x + radius;
int yr = y + radius;
int r2 = radius * 2;
int xwr2 = xw - r2;
int yhr2 = yh - r2;
var p = new GraphicsPath();
p.StartFigure();
//Top Left Corner
if ((RectangleCorners.TopLeft & corners) == RectangleCorners.TopLeft)
{
p.AddArc(x, y, r2, r2, 180, 90);
}
else
{
p.AddLine(x, yr, x, y);
p.AddLine(x, y, xr, y);
}
//Top Edge
p.AddLine(xr, y, xwr, y);
//Top Right Corner
if ((RectangleCorners.TopRight & corners) == RectangleCorners.TopRight)
{
p.AddArc(xwr2, y, r2, r2, 270, 90);
}
else
{
p.AddLine(xwr, y, xw, y);
p.AddLine(xw, y, xw, yr);
}
//Right Edge
p.AddLine(xw, yr, xw, yhr);
//Bottom Right Corner
if ((RectangleCorners.BottomRight & corners) == RectangleCorners.BottomRight)
{
p.AddArc(xwr2, yhr2, r2, r2, 0, 90);
}
else
{
p.AddLine(xw, yhr, xw, yh);
p.AddLine(xw, yh, xwr, yh);
}
//Bottom Edge
p.AddLine(xwr, yh, xr, yh);
//Bottom Left Corner
if ((RectangleCorners.BottomLeft & corners) == RectangleCorners.BottomLeft)
{
p.AddArc(x, yhr2, r2, r2, 90, 90);
}
else
{
p.AddLine(xr, yh, x, yh);
p.AddLine(x, yh, x, yhr);
}
//Left Edge
p.AddLine(x, yhr, x, yr);
p.CloseFigure();
return p;
}
public static GraphicsPath Create(Rectangle rect, int radius, RectangleCorners c)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height, radius, c); }
public static GraphicsPath Create(int x, int y, int width, int height, int radius)
{ return Create(x, y, width, height, radius, RectangleCorners.All); }
public static GraphicsPath Create(Rectangle rect, int radius)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height, radius); }
public static GraphicsPath Create(int x, int y, int width, int height)
{ return Create(x, y, width, height, 5); }
public static GraphicsPath Create(Rectangle rect)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height); }
}
}

13
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs

@ -12,6 +12,7 @@ using System.Drawing; @@ -12,6 +12,7 @@ using System.Drawing;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.Globals;
using ICSharpCode.Reporting.Addin.Designer;
using ICSharpCode.Reporting.Addin.Dialogs;
using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.DesignableItems
@ -22,6 +23,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -22,6 +23,8 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
[Designer(typeof(TextItemDesigner))]
public class BaseTextItem:AbstractItem
{
const string datatypeOfTheUnderlyingColumn = "Datatype of the underlying Column";
string formatString;
StringFormat stringFormat;
@ -130,6 +133,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -130,6 +133,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
}
}
#endregion
#region RighToLeft
@ -145,11 +149,10 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -145,11 +149,10 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
#region DataType
// [Browsable(true),
// Category("Databinding"),
// Description("Datatype of the underlying Column")]
// [DefaultValue("System.String")]
// [TypeConverter(typeof(DataTypeStringConverter))]
[Category("Databinding"),Description(datatypeOfTheUnderlyingColumn)]
[DefaultValue("System.String")]
[TypeConverter(typeof(DataTypeStringConverter))]
public string DataType {get;set;}

108
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ContainerDesigner.cs

@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 05.04.2014
* Time: 18:06
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using ICSharpCode.Reporting.Addin.TypeProvider;
namespace ICSharpCode.Reporting.Addin.Designer{
/// <summary>
/// Description of RectangleDesigner.
/// </summary>
public class ContainerDesigner:ParentControlDesigner{
ISelectionService selectionService;
IComponentChangeService componentChangeService;
public override void Initialize(IComponent component){
if (component == null) {
throw new ArgumentNullException("component");
}
base.Initialize(component);
GetService ();
}
protected override void PostFilterProperties(System.Collections.IDictionary properties){
TypeProviderHelper.RemoveProperties(properties);
base.PostFilterProperties(properties);
}
protected override void OnDragDrop(DragEventArgs de){
base.OnDragDrop(de);
var toolboxService = (IToolboxService)this.GetService(typeof(IToolboxService));
toolboxService.SetSelectedToolboxItem(null);
}
// public override bool CanBeParentedTo(IDesigner parentDesigner)
// {
// base.CanBeParentedTo(parentDesigner);
// }
public override bool CanParent(Control control)
{
return base.CanParent(control);
}
public override bool CanParent(ControlDesigner controlDesigner)
{
return base.CanParent(controlDesigner);
}
void OnSelectionChanged(object sender, EventArgs e){
Control.Invalidate( );
}
void OnComponentRename(object sender,ComponentRenameEventArgs e) {
if (e.Component == this.Component) {
Control.Name = e.NewName;
Control.Invalidate();
}
}
void GetService (){
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
if (selectionService != null)
{
selectionService.SelectionChanged += OnSelectionChanged;
}
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
if (componentChangeService != null) {
componentChangeService.ComponentRename += OnComponentRename;
componentChangeService.ComponentAdding += (sender, e) => {
};
}
}
#region Dispose
protected override void Dispose(bool disposing){
if (selectionService != null) {
selectionService.SelectionChanged -= OnSelectionChanged;
}
if (componentChangeService != null) {
componentChangeService.ComponentRename -= OnComponentRename;
}
base.Dispose(disposing);
}
#endregion
}
}

66
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/DataItemDesigner.cs

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 04.04.2014
* Time: 20:18
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel.Design;
namespace ICSharpCode.Reporting.Addin.Designer
{
/// <summary>
/// Description of DataItemDesigner.
/// </summary>
class DataItemDesigner:TextItemDesigner
{
public DataItemDesigner () {
}
/*
#region SmartTags
public override DesignerActionListCollection ActionLists {
get {
DesignerActionListCollection actions = new DesignerActionListCollection ();
actions.Add (new TextBasedDesignerActionList(this.Component));
return actions;
}
}
#endregion
private void OnSelectionChanged(object sender, EventArgs e)
{
Control.Invalidate( );
}
private void OnComponentRename(object sender,ComponentRenameEventArgs e) {
if (e.Component == this.Component) {
Control.Name = e.NewName;
Control.Invalidate();
}
}
private void GetService ()
{
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
if (selectionService != null)
{
selectionService.SelectionChanged += OnSelectionChanged;
}
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
if (componentChangeService != null) {
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename);
}
}
*/
}
}

16
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/LineDesigner.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -18,7 +18,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// <summary>
/// Description of LineDesigner.
/// </summary>
public class LineDesigner:AbstractDesigner
class LineDesigner:AbstractDesigner
{
BaseLineItem baseLine;
bool dragging;
@ -97,21 +97,12 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -97,21 +97,12 @@ namespace ICSharpCode.Reporting.Addin.Designer
protected override void OnMouseDragBegin(int x, int y)
{
System.Console.WriteLine("DragBegib");
Point p = this.baseLine.PointToClient(new Point(x, y));
overFromPoint = GetHandle(baseLine.FromPoint).Contains(p);
this.overToPoint = GetHandle(baseLine.ToPoint).Contains(p);
overToPoint = GetHandle(baseLine.ToPoint).Contains(p);
if (overFromPoint || overToPoint )
{
dragging = true;
// PropertyDescriptor pd =
// TypeDescriptor.GetProperties(this.baseLine)["FromPoint"];
// pd.SetValue(this.baseLine, p);
// dragDirection = overToPoint;
// Point current = dragDirection ?
// (label.Origin + label.Direction) :
// label.Origin;
// dragOffset = current - new Size(p);
}
else
{
@ -125,7 +116,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -125,7 +116,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
{
if (dragging)
{
Point p = this.baseLine.PointToClient(new Point(x, y));
Point p = baseLine.PointToClient(new Point(x, y));
if (overToPoint) {
baseLine.ToPoint = p;
} else {
@ -177,7 +168,6 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -177,7 +168,6 @@ namespace ICSharpCode.Reporting.Addin.Designer
base.OnMouseDragEnd(cancel);
}
//
#endregion

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -37,7 +37,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// Description of ReportRootDesigner.
/// </summary>
public class ReportRootDesigner: DocumentDesigner
class ReportRootDesigner: DocumentDesigner
{
ICollection currentSelection;
IDesignerHost host;

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportSettingsDesigner.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -15,7 +15,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// <summary>
/// Description of ReportSettingsDesigner.
/// </summary>
public class ReportSettingsDesigner:ComponentDesigner
class ReportSettingsDesigner:ComponentDesigner
{
static string settingsName = "ReportSettings";
public ReportSettingsDesigner()

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/RootReportModel.cs

@ -21,7 +21,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -21,7 +21,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
///
public class RootReportModel:RootDesignedComponent
class RootReportModel:RootDesignedComponent
{
@ -45,8 +45,8 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -45,8 +45,8 @@ namespace ICSharpCode.Reporting.Addin.Designer
void PrintMargin( Graphics graphics)
{
string header = String.Format(System.Globalization.CultureInfo.CurrentCulture,
"[Size : {0}] [Landscape : {1}] [Bounds : {2}]",
Page.Size, Landscape, PageMargin);
"[Size : {0}] [Landscape : {1}] [Bounds : {2}]",
Page.Size, Landscape, PageMargin);
using (var font = DesignerGlobals.DesignerFont){
SizeF size = graphics.MeasureString(header,font);
graphics.DrawString(header,font,

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/SectionDesigner.cs

@ -19,7 +19,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -19,7 +19,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// <summary>
/// Description of SectionDesigner.
/// </summary>
public class SectionDesigner:ParentControlDesigner
class SectionDesigner:ParentControlDesigner
{
BaseSection section;
ISelectionService selectionService;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save