프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Common / CommentUserInfo.cs @ 4913851c

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