Browse Source

LineHandlerExtension is now public to allow it to be overridden by an other extension.

Bounds is now a private class of LineHandlerExtension because its the only class where it is used.
pull/659/head
gumme 11 years ago
parent
commit
824094126a
  1. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineExtensionBase.cs
  2. 12
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineHandlerExtension.cs

8
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineExtensionBase.cs

@ -25,19 +25,11 @@ using ICSharpCode.WpfDesign;
using ICSharpCode.WpfDesign.Adorners; using ICSharpCode.WpfDesign.Adorners;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System;
using System.Collections; using System.Collections;
using System.ComponentModel; using System.ComponentModel;
namespace ICSharpCode.WpfDesign.Designer.Extensions namespace ICSharpCode.WpfDesign.Designer.Extensions
{ {
/// <summary>
/// Description of LineExtensionBase.
/// </summary>
class Bounds
{
public double X, Y, Left, Top;
}
/// <summary> /// <summary>
/// base class for the Line, Polyline and Polygon extension classes /// base class for the Line, Polyline and Polygon extension classes
/// </summary> /// </summary>

12
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineHandlerExtension.cs

@ -32,8 +32,16 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// Description of LineHandlerExtension. /// Description of LineHandlerExtension.
/// </summary> /// </summary>
[ExtensionFor(typeof(Line), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension), typeof(SkewThumbExtension) })] [ExtensionFor(typeof(Line), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension), typeof(SkewThumbExtension) })]
internal class LineHandlerExtension : LineExtensionBase public class LineHandlerExtension : LineExtensionBase
{ {
/// <summary>
/// Used instead of Rect to allow negative values on "Width" and "Height" (here called X and Y).
/// </summary>
class Bounds
{
public double X, Y, Left, Top;
}
// //
private double CurrentX2; private double CurrentX2;
private double CurrentY2; private double CurrentY2;
@ -60,7 +68,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
return designerThumb; return designerThumb;
} }
protected Bounds CalculateDrawing(double x, double y, double left, double top, double xleft, double xtop) Bounds CalculateDrawing(double x, double y, double left, double top, double xleft, double xtop)
{ {
Double theta = (180 / Math.PI) * Math.Atan2(y, x); Double theta = (180 / Math.PI) * Math.Atan2(y, x);

Loading…
Cancel
Save