프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Common / CommentUserInfo.cs @ a5b465dc

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

1
using KCOMDataModel.DataModel;
2
using MarkupToPDF.Controls.Common;
3
using MarkupToPDF.Controls.Parsing;
4
using System;
5
using System.Collections.Generic;
6
using System.Linq;
7
using System.Text;
8
using System.Windows;
9
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
        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
        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
        public string SymbolID { get; set; }
30
        public long GroupID { get; set; }
31

    
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

    
71
        /// <summary>
72
        /// subclass has to override this property
73
        /// </summary>
74
        public virtual bool IsSelected { get; set; }
75

    
76
        /// <summary>
77
        /// subclass has to override this property
78
        /// </summary>
79
        public virtual ControlType ControlType { get; set; }
80

    
81
        /// <summary>
82
        /// subclass has to override this method
83
        /// </summary>
84
        /// <returns>serialized string</returns>
85
        public virtual string Serialize() { return string.Empty; }
86

    
87
        /// <summary>
88
        /// return MARKUP_DATA
89
        /// </summary>
90
        /// <param name="sUserID"></param>
91
        /// <param name="iPageNo"></param>
92
        /// <returns></returns>
93
        public virtual MARKUP_DATA GetMarkupData(string sUserID, int iPageNo, string sMarkupVersionID)
94
        {
95
            var root = MarkupParser.MarkupToString(this, sUserID);
96
            return new MARKUP_DATA
97
            {
98
                ID = this.CommentID,
99
                DATA = root.ConvertData,
100
                DATA_TYPE = root.DATA_TYPE,
101
                PAGENUMBER = iPageNo,
102
                MARKUPINFO_VERSION_ID = sMarkupVersionID,
103
                SYMBOL_ID = this.SymbolID,
104
                GROUP_ID = this.GroupID
105
            };
106
        }
107

    
108
        /// <summary>
109
        /// return item's area
110
        /// </summary>
111
        public virtual Rect ItemRect
112
        {
113
            get;
114
        }
115
    }
116
}
클립보드 이미지 추가 (최대 크기: 500 MB)