개정판 a6272c57
issue #923: add ICommentUserInfo interface
Change-Id: Id0b65251436a5aa647eef78026dfad90d3ca64ab
MarkupToPDF/Common/CommentUserInfo.cs | ||
---|---|---|
6 | 6 |
using System.Linq; |
7 | 7 |
using System.Text; |
8 | 8 |
using System.Windows; |
9 |
using System.Windows.Input; |
|
9 | 10 |
using System.Windows.Media; |
10 | 11 |
|
11 | 12 |
namespace MarkupToPDF.Common |
12 | 13 |
{ |
13 |
public class CommentUserInfo : System.Windows.Controls.Control |
|
14 |
public interface ICommentUserInfo |
|
15 |
{ |
|
16 |
void OnCreatingMouseMove(Point pt, bool bAxisLocked, bool bShiftKeyPressed); |
|
17 |
} |
|
18 |
|
|
19 |
public class CommentUserInfo : System.Windows.Controls.Control, ICommentUserInfo |
|
14 | 20 |
{ |
15 | 21 |
public static readonly string[] delimiterChars = { "|DZ|" }; |
16 | 22 |
public static readonly string[] delimiterChars2 = { "|" }; |
... | ... | |
61 | 67 |
} |
62 | 68 |
} |
63 | 69 |
|
70 |
public virtual void OnCreatingMouseMove(Point pt, bool bAxisLocked, bool bShiftKeyPressed) { } |
|
71 |
|
|
64 | 72 |
/// <summary> |
65 | 73 |
/// subclass has to override this property |
66 | 74 |
/// </summary> |
... | ... | |
119 | 127 |
{ |
120 | 128 |
get; |
121 | 129 |
} |
130 |
|
|
131 |
/// <summary> |
|
132 |
/// 정원, 정사각형, 정삼각형을 그리기 위한 EndPoint계산 |
|
133 |
/// </summary> |
|
134 |
/// <param name="StartP">StartPoint</param> |
|
135 |
/// <param name="EndP">EndPoint</param> |
|
136 |
/// <returns>Return_EndPoint</returns> |
|
137 |
public Point GetSquareEndPoint(Point StartP, Point EndP) |
|
138 |
{ |
|
139 |
Point? res = null; |
|
140 |
|
|
141 |
double dx = EndP.X - StartP.X; |
|
142 |
double dy = EndP.Y - StartP.Y; |
|
143 |
double length; |
|
144 |
|
|
145 |
switch (this.ControlType) |
|
146 |
{ |
|
147 |
case ControlType.Triangle: |
|
148 |
{ |
|
149 |
//삼각형의 StartPoint기준으로 반지름 만큼 증가하기 때문에 곱하기2 필요 |
|
150 |
length = Math.Max(Math.Abs(dx) * 2, Math.Abs(dy)); |
|
151 |
res = (dy < 0) ? new Point(StartP.X + length / 2, StartP.Y - length) : new Point(StartP.X + length / 2, StartP.Y + length); |
|
152 |
} |
|
153 |
break; |
|
154 |
default: |
|
155 |
{ |
|
156 |
length = Math.Max(Math.Abs(dx), Math.Abs(dy)); |
|
157 |
res = new Point((dx > 0) ? StartP.X + length : StartP.X - length, (dy > 0) ? StartP.Y + length : StartP.Y - length); |
|
158 |
} |
|
159 |
break; |
|
160 |
} |
|
161 |
|
|
162 |
return res.Value; |
|
163 |
} |
|
122 | 164 |
} |
123 | 165 |
} |
내보내기 Unified diff