개정판 036650a0
issue #999: Add serialize method to all of controls
Change-Id: I74e404885e8cd107b48ad1921e768137ed14a3da
MarkupToPDF/Controls/Line/ArrowControl_Multi.cs | ||
---|---|---|
12 | 12 |
using System.Collections.Generic; |
13 | 13 |
using MarkupToPDF.Controls.Common; |
14 | 14 |
using MarkupToPDF.Common; |
15 |
using MarkupToPDF.Serialize.S_Control; |
|
16 |
using MarkupToPDF.Serialize.Core; |
|
15 | 17 |
|
16 | 18 |
namespace MarkupToPDF.Controls.Line |
17 | 19 |
{ |
18 |
|
|
19 | 20 |
public class ArrowControl_Multi : CommentUserInfo, IDisposable, INotifyPropertyChanged, IMarkupCommonData, IDashControl |
20 | 21 |
{ |
21 | 22 |
|
... | ... | |
41 | 42 |
#region Dependency Properties |
42 | 43 |
|
43 | 44 |
public static readonly DependencyProperty IsSelectedProperty = |
44 |
DependencyProperty.Register("IsSelected", typeof(bool), typeof(ArrowControl_Multi), new FrameworkPropertyMetadata(false, IsSelectedChanged)); |
|
45 |
DependencyProperty.Register("IsSelected", typeof(bool), typeof(ArrowControl_Multi), new FrameworkPropertyMetadata(false, IsSelectedChanged));
|
|
45 | 46 |
|
46 | 47 |
public static readonly DependencyProperty ControlTypeProperty = |
47 |
DependencyProperty.Register("ControlType", typeof(ControlType), typeof(ArrowControl_Multi), new FrameworkPropertyMetadata(ControlType.ArrowMultiLine)); |
|
48 |
DependencyProperty.Register("ControlType", typeof(ControlType), typeof(ArrowControl_Multi), new FrameworkPropertyMetadata(ControlType.ArrowMultiLine));
|
|
48 | 49 |
|
49 | 50 |
public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register( |
50 | 51 |
"OverViewPathData", typeof(Geometry), typeof(ArrowControl_Multi), new PropertyMetadata(null)); |
... | ... | |
158 | 159 |
} |
159 | 160 |
} |
160 | 161 |
|
161 |
public ControlType ControlType |
|
162 |
override public ControlType ControlType
|
|
162 | 163 |
{ |
163 | 164 |
get |
164 | 165 |
{ |
... | ... | |
294 | 295 |
this.PathData = instanceGroup; |
295 | 296 |
OverViewPathData = PathData; |
296 | 297 |
} |
297 |
//public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
|
298 |
//{ |
|
299 |
// double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
300 |
// PathGeometry pathGeometry = new PathGeometry(); |
|
301 |
// PathFigure pathFigure = new PathFigure(); |
|
302 |
// pathFigure.StartPoint = p1; |
|
303 |
|
|
304 |
// Point lpoint = new Point(p1.X + lineSize * 3, p1.Y + lineSize * 6); |
|
305 |
// Point rpoint = new Point(p1.X - lineSize * 3, p1.Y + lineSize * 6); |
|
306 |
|
|
307 |
// //Point lpoint = new Point(p1.X + lineSize, p1.Y + lineSize * 4); |
|
308 |
// //Point rpoint = new Point(p1.X - lineSize, p1.Y + lineSize * 4); |
|
309 |
|
|
310 |
// //Point lpoint = new Point(p1.X + lineSize * 3, p1.Y + lineSize * 6); |
|
311 |
// //Point rpoint = new Point(p1.X - lineSize * 3, p1.Y + lineSize * 6); |
|
312 |
|
|
313 |
// LineSegment seg1 = new LineSegment(); |
|
314 |
// seg1.Point = lpoint; |
|
315 |
// pathFigure.Segments.Add(seg1); |
|
316 |
|
|
317 |
// LineSegment seg2 = new LineSegment(); |
|
318 |
// seg2.Point = rpoint; |
|
319 |
// pathFigure.Segments.Add(seg2); |
|
320 |
|
|
321 |
// LineSegment seg3 = new LineSegment(); |
|
322 |
// seg3.Point = p1; |
|
323 |
// pathFigure.Segments.Add(seg3); |
|
324 |
|
|
325 |
// pathFigure.IsClosed = true; |
|
326 |
// pathFigure.IsFilled = true; |
|
327 |
|
|
328 |
// pathGeometry.Figures.Add(pathFigure); |
|
329 |
// pathGeometry.FillRule = FillRule.Nonzero; |
|
330 |
// RotateTransform transform = new RotateTransform(); |
|
331 |
// transform.Angle = theta - 90; |
|
332 |
// transform.CenterX = p1.X; |
|
333 |
// transform.CenterY = p1.Y; |
|
334 |
// pathGeometry.Transform = transform; |
|
335 |
// return pathGeometry; |
|
336 |
//} |
|
337 | 298 |
|
338 | 299 |
protected void OnPropertyChanged(string propName) |
339 | 300 |
{ |
... | ... | |
346 | 307 |
this.MiddlePoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
347 | 308 |
this.EndPoint = new Point(this.PointSet[2].X, this.PointSet[2].Y); |
348 | 309 |
} |
310 |
|
|
311 |
/// <summary> |
|
312 |
/// Serialize this |
|
313 |
/// </summary> |
|
314 |
/// <param name="sUserId"></param> |
|
315 |
/// <returns></returns> |
|
316 |
public override string Serialize() |
|
317 |
{ |
|
318 |
using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi()) |
|
319 |
{ |
|
320 |
STemp.TransformPoint = "0|0"; |
|
321 |
STemp.PointSet = this.PointSet; |
|
322 |
STemp.SizeSet = String.Format("{0}", this.LineSize); |
|
323 |
STemp.StrokeColor = this.StrokeColor.Color.ToString(); |
|
324 |
STemp.StartPoint = this.StartPoint; |
|
325 |
STemp.EndPoint = this.EndPoint; |
|
326 |
STemp.UserID = this.UserID; |
|
327 |
STemp.Opac = this.Opacity; |
|
328 |
STemp.DashSize = this.DashSize; |
|
329 |
STemp.MidPoint = this.MiddlePoint; |
|
330 |
STemp.Name = this.GetType().Name.ToString(); |
|
331 |
|
|
332 |
///강인구 추가(2017.11.02) |
|
333 |
///Memo 추가 |
|
334 |
STemp.Memo = this.Memo; |
|
335 |
|
|
336 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
|
337 |
}; |
|
338 |
} |
|
339 |
|
|
349 | 340 |
public void Dispose() |
350 | 341 |
{ |
351 | 342 |
GC.Collect(); |
내보내기 Unified diff