프로젝트

일반

사용자정보

개정판 3f1068a7

ID3f1068a73db77837b8e72109223b434637698d10
상위 cb3444cd
하위 86143026

백흠경이(가) 11달 전에 추가함

Fix: CloudControl, InkControl, PolygonControl 에 대하여 Undo/Redo 구현

Change-Id: Iff07dcdae6c85c620d58128a67667e432bb0e30a

차이점 보기:

MarkupToPDF/Controls/Polygon/CloudControl.cs
18 18

  
19 19
namespace MarkupToPDF.Controls.Polygon
20 20
{
21
    public class CloudControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IPath, IShapeControl, ICloudControl, IDashControl
21
    public class CloudControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IShapeControl, ICloudControl, IDashControl
22 22
    {
23 23
        private const string PART_CloudPath = "PART_CloudPath";
24 24
        private const string PART_CloudSubPath = "PART_CloudSubPath";
......
41 41
            //this.DefaultStyleKey = typeof(CloudControl);
42 42
        }
43 43

  
44
        public override void Copy(CommentUserInfo lhs)
45
        {
46
            if (lhs is CloudControl item)
47
            {
48
                this.LineSize = item.LineSize;
49
                this.Toler = item.Toler;
50
                this.PointSet = item.PointSet.ConvertAll(x => new Point(x.X, x.Y));
51
                this.ArcLength = item.ArcLength;
52
                this.Paint = item.Paint;
53
                this.Opacity = item.Opacity;
54
                this.StrokeColor = item.StrokeColor;
55
                this.isTransOn = item.isTransOn;
56
                this.isChain = item.isChain;
57
                this.DashSize = item.DashSize;
58
                this.UserID = item.UserID;
59
                this.StartPoint = new Point(item.StartPoint.X, item.StartPoint.Y);
60
                this.EndPoint = new Point(item.EndPoint.X, item.EndPoint.Y);
61
                this.Memo = item.Memo;
62
            }
63
        }
64

  
65
        public override CommentUserInfo Clone()
66
        {
67
            var clone = new CloudControl();
68
            clone.Copy(this);
69
            return clone;
70
        }
71

  
44 72
        #region Dependency Properties
45 73
        public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register(
46 74
                "UserID", typeof(string), typeof(CloudControl), new PropertyMetadata(null));
MarkupToPDF/Controls/Polygon/InkControl.cs
32 32
            //this.DefaultStyleKey = typeof(InkControl);
33 33
        }
34 34

  
35
        public override void Copy(CommentUserInfo lhs)
36
        {
37
            if(lhs is InkControl item)
38
            {
39
                this.LineSize = item.LineSize;
40
                this.IsCompleted = item.IsCompleted;
41
                this.Opacity = item.Opacity;
42
                this.StrokeColor = item.StrokeColor;
43
                this.ControlType = item.ControlType;
44
                this.DashSize = item.DashSize;
45
                this.StartPoint = new Point(item.StartPoint.X, item.StartPoint.Y);
46
                this.PointSet = item.PointSet.ConvertAll(x => new Point(x.X, x.Y));
47
                this.UserID = item.UserID;
48
                this.Paint = item.Paint;
49
                this.EndPoint = new Point(item.EndPoint.X, item.EndPoint.Y);
50
                this.Memo = item.Memo;
51
            }
52
        }
53

  
54
        public override CommentUserInfo Clone()
55
        {
56
            var clone = new InkControl();
57
            clone.Copy(this);
58
            return clone;
59
        }
60

  
35 61
        #endregion
36 62

  
37 63
        #region Variable
MarkupToPDF/Controls/Polygon/PolygonControl.cs
1
using MarkupToPDF.Common;
1
using iTextSharp.text;
2
using MarkupToPDF.Common;
2 3
using MarkupToPDF.Controls.Common;
3 4
using MarkupToPDF.Serialize.Core;
4 5
using MarkupToPDF.Serialize.S_Control;
......
33 34
        {
34 35
            //this.DefaultStyleKey = typeof(PolygonControl);
35 36
        }
36
        
37

  
38
        public override void Copy(CommentUserInfo lhs)
39
        {
40
            if(lhs is PolygonControl item)
41
            {
42
                this.LineSize = item.LineSize;
43
                this.IsCompleted = item.IsCompleted;
44
                this.Opacity = item.Opacity;
45
                this.StrokeColor = item.StrokeColor;
46
                this.ControlType = item.ControlType;
47
                this.DashSize = item.DashSize;
48
                this.StartPoint = new Point(item.StartPoint.X, item.StartPoint.Y);
49
                this.EndPoint = new Point(item.EndPoint.X, item.EndPoint.Y);
50
                this.PointSet = item.PointSet.ConvertAll(x => new Point(x.X, x.Y));
51
                this.UserID = item.UserID;
52
                this.Paint = item.Paint;
53
                this.Memo = item.Memo;
54
            }
55
        }
56

  
57
        public override CommentUserInfo Clone()
58
        {
59
            var clone = new PolygonControl();
60
            clone.Copy(this);
61
            return clone; 
62
        }
63

  
37 64
        #endregion
38 65

  
39 66
        #region Variable

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)