프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / MarkupToPDF / Common / CommentUserInfo.cs @ c0977e97

이력 | 보기 | 이력해설 | 다운로드 (3.97 KB)

1 cb33ad14 humkyung
using KCOMDataModel.DataModel;
2
using MarkupToPDF.Controls.Common;
3
using MarkupToPDF.Controls.Parsing;
4 036650a0 humkyung
using System;
5 787a4489 KangIngu
using System.Collections.Generic;
6
using System.Linq;
7
using System.Text;
8 91efe37a humkyung
using System.Windows;
9 787a4489 KangIngu
using System.Windows.Media;
10
11
namespace MarkupToPDF.Common
12
{
13
    //public class MyEventArgs : System.EventArgs
14
    //{
15
    //    public bool isMouseOver { get; set; }
16
    //}
17
18
    public class CommentUserInfo : System.Windows.Controls.Control
19
    {
20 661b7416 humkyung
        public static readonly string[] delimiterChars = { "|DZ|" };
21
        public static readonly string[] delimiterChars2 = { "|" };
22
        public static readonly SolidColorBrush DefaultColor = new SolidColorBrush(MarkupToPDF.Controls.Common.ValueConverter.StringToColorConverter.Parse(""));
23
24 787a4489 KangIngu
        public string Memo { get; set; }
25
        public string MarkupInfoID { get; set; }
26
        public bool IsMouseOver { get; set; }
27
        public bool IsNew { get; set; }
28
        public string CommentID { get; set; }
29 c8e9b3e4 ljiyeon
        public string SymbolID { get; set; }
30 53880c83 ljiyeon
        public long GroupID { get; set; }
31 787a4489 KangIngu
32
        //public event EventHandler<MyEventArgs> StateChanged;
33
34
        public CommentUserInfo()
35
        {
36
            //this.BorderThickness = new System.Windows.Thickness(5.0);
37
            this.BorderThickness = new System.Windows.Thickness(20.0);
38
39
40
            this.MouseEnter += CommentUserInfo_MouseEnter;
41
            this.MouseLeave += CommentUserInfo_MouseLeave;
42
        }
43
44
        protected override GeometryHitTestResult HitTestCore(GeometryHitTestParameters hitTestParameters)
45
        {
46
            var temp = base.HitTestCore(hitTestParameters);
47
            return temp;
48
            //return base.HitTestCore(hitTestParameters);
49
        }
50
51
        private void CommentUserInfo_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
52
        {
53
            this.IsMouseOver = false;
54
            //if (StateChanged !=null)
55
            //{
56
            //    StateChanged(this, new MyEventArgs { isMouseOver = false });
57
            //}
58
            //this.Opacity = 1;
59
        }
60
61
        private void CommentUserInfo_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
62
        {
63
            this.IsMouseOver = true;
64
            //this.Opacity = 0.5;
65
            //if (StateChanged != null)
66
            //{
67
            //    StateChanged(this, new MyEventArgs { isMouseOver = true });
68
            //}
69
        }
70 036650a0 humkyung
71
        /// <summary>
72
        /// subclass has to override this property
73
        /// </summary>
74 91efe37a humkyung
        public virtual bool IsSelected { get; set; }
75 959b3ef2 humkyung
76
        /// <summary>
77
        /// subclass has to override this property
78
        /// </summary>
79
        public virtual ControlType ControlType { get; set; }
80 036650a0 humkyung
81
        /// <summary>
82 e6a9ddaf humkyung
        /// translate commeny by given dx, dy
83
        /// </summary>
84
        /// <param name="dx"></param>
85
        /// <param name="dy"></param>
86
        public virtual void Move(double dx, double dy) { }
87
88
        /// <summary>
89 036650a0 humkyung
        /// subclass has to override this method
90
        /// </summary>
91
        /// <returns>serialized string</returns>
92
        public virtual string Serialize() { return string.Empty; }
93 cb33ad14 humkyung
94
        /// <summary>
95
        /// return MARKUP_DATA
96
        /// </summary>
97
        /// <param name="sUserID"></param>
98
        /// <param name="iPageNo"></param>
99
        /// <returns></returns>
100
        public virtual MARKUP_DATA GetMarkupData(string sUserID, int iPageNo, string sMarkupVersionID)
101
        {
102
            var root = MarkupParser.MarkupToString(this, sUserID);
103
            return new MARKUP_DATA
104
            {
105
                ID = this.CommentID,
106
                DATA = root.ConvertData,
107
                DATA_TYPE = root.DATA_TYPE,
108
                PAGENUMBER = iPageNo,
109
                MARKUPINFO_VERSION_ID = sMarkupVersionID,
110
                SYMBOL_ID = this.SymbolID,
111 c0977e97 djkim
                //GROUP_ID = this.GroupID
112 cb33ad14 humkyung
            };
113
        }
114 91efe37a humkyung
115
        /// <summary>
116
        /// return item's area
117
        /// </summary>
118
        public virtual Rect ItemRect
119
        {
120
            get;
121
        }
122 787a4489 KangIngu
    }
123
}
클립보드 이미지 추가 (최대 크기: 500 MB)