Browse Source
Conflicts: src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csprojpull/521/head
819 changed files with 3154 additions and 78291 deletions
@ -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. |
@ -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) |
@ -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 |
@ -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(); |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
|
||||
|
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
|
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
||||
} |
@ -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> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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; } |
||||
} |
||||
} |
@ -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; } |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
@ -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;} |
||||
} |
||||
} |
@ -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); } |
||||
} |
||||
} |
@ -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
|
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
||||
*/ |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue