markus / MarkupToPDF / Common / CommentUserInfo.cs @ 91efe37a
이력 | 보기 | 이력해설 | 다운로드 (3.74 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 | /// subclass has to override this method |
||
83 | /// </summary> |
||
84 | /// <returns>serialized string</returns> |
||
85 | public virtual string Serialize() { return string.Empty; } |
||
86 | cb33ad14 | humkyung | |
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 | 91efe37a | humkyung | |
108 | /// <summary> |
||
109 | /// return item's area |
||
110 | /// </summary> |
||
111 | public virtual Rect ItemRect |
||
112 | { |
||
113 | get; |
||
114 | } |
||
115 | 787a4489 | KangIngu | } |
116 | } |