markus / MarkupToPDF / Common / CommentUserInfo.cs @ c0977e97
이력 | 보기 | 이력해설 | 다운로드 (3.97 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 |
/// 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 |
/// subclass has to override this method |
90 |
/// </summary> |
91 |
/// <returns>serialized string</returns> |
92 |
public virtual string Serialize() { return string.Empty; } |
93 |
|
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 |
//GROUP_ID = this.GroupID |
112 |
}; |
113 |
} |
114 |
|
115 |
/// <summary> |
116 |
/// return item's area |
117 |
/// </summary> |
118 |
public virtual Rect ItemRect |
119 |
{ |
120 |
get; |
121 |
} |
122 |
} |
123 |
} |