markus / MarkupToPDF / Common / CommentUserInfo.cs @ 959b3ef2
이력 | 보기 | 이력해설 | 다운로드 (3.57 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.Media; |
9 |
|
10 |
namespace MarkupToPDF.Common |
11 |
{ |
12 |
//public class MyEventArgs : System.EventArgs |
13 |
//{ |
14 |
// public bool isMouseOver { get; set; } |
15 |
//} |
16 |
|
17 |
public class CommentUserInfo : System.Windows.Controls.Control |
18 |
{ |
19 |
public static readonly string[] delimiterChars = { "|DZ|" }; |
20 |
public static readonly string[] delimiterChars2 = { "|" }; |
21 |
public static readonly SolidColorBrush DefaultColor = new SolidColorBrush(MarkupToPDF.Controls.Common.ValueConverter.StringToColorConverter.Parse("")); |
22 |
|
23 |
public string Memo { get; set; } |
24 |
public string MarkupInfoID { get; set; } |
25 |
public bool IsMouseOver { get; set; } |
26 |
public bool IsNew { get; set; } |
27 |
public string CommentID { get; set; } |
28 |
public string SymbolID { get; set; } |
29 |
public long GroupID { get; set; } |
30 |
|
31 |
//public event EventHandler<MyEventArgs> StateChanged; |
32 |
|
33 |
public CommentUserInfo() |
34 |
{ |
35 |
//this.BorderThickness = new System.Windows.Thickness(5.0); |
36 |
this.BorderThickness = new System.Windows.Thickness(20.0); |
37 |
|
38 |
|
39 |
this.MouseEnter += CommentUserInfo_MouseEnter; |
40 |
this.MouseLeave += CommentUserInfo_MouseLeave; |
41 |
} |
42 |
|
43 |
protected override GeometryHitTestResult HitTestCore(GeometryHitTestParameters hitTestParameters) |
44 |
{ |
45 |
var temp = base.HitTestCore(hitTestParameters); |
46 |
return temp; |
47 |
//return base.HitTestCore(hitTestParameters); |
48 |
} |
49 |
|
50 |
private void CommentUserInfo_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) |
51 |
{ |
52 |
this.IsMouseOver = false; |
53 |
//if (StateChanged !=null) |
54 |
//{ |
55 |
// StateChanged(this, new MyEventArgs { isMouseOver = false }); |
56 |
//} |
57 |
//this.Opacity = 1; |
58 |
} |
59 |
|
60 |
private void CommentUserInfo_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) |
61 |
{ |
62 |
this.IsMouseOver = true; |
63 |
//this.Opacity = 0.5; |
64 |
//if (StateChanged != null) |
65 |
//{ |
66 |
// StateChanged(this, new MyEventArgs { isMouseOver = true }); |
67 |
//} |
68 |
} |
69 |
|
70 |
/// <summary> |
71 |
/// subclass has to override this property |
72 |
/// </summary> |
73 |
public virtual bool IsSelected{ get; set; } |
74 |
|
75 |
/// <summary> |
76 |
/// subclass has to override this property |
77 |
/// </summary> |
78 |
public virtual ControlType ControlType { get; set; } |
79 |
|
80 |
/// <summary> |
81 |
/// subclass has to override this method |
82 |
/// </summary> |
83 |
/// <returns>serialized string</returns> |
84 |
public virtual string Serialize() { return string.Empty; } |
85 |
|
86 |
/// <summary> |
87 |
/// return MARKUP_DATA |
88 |
/// </summary> |
89 |
/// <param name="sUserID"></param> |
90 |
/// <param name="iPageNo"></param> |
91 |
/// <returns></returns> |
92 |
public virtual MARKUP_DATA GetMarkupData(string sUserID, int iPageNo, string sMarkupVersionID) |
93 |
{ |
94 |
var root = MarkupParser.MarkupToString(this, sUserID); |
95 |
return new MARKUP_DATA |
96 |
{ |
97 |
ID = this.CommentID, |
98 |
DATA = root.ConvertData, |
99 |
DATA_TYPE = root.DATA_TYPE, |
100 |
PAGENUMBER = iPageNo, |
101 |
MARKUPINFO_VERSION_ID = sMarkupVersionID, |
102 |
SYMBOL_ID = this.SymbolID, |
103 |
GROUP_ID = this.GroupID |
104 |
}; |
105 |
} |
106 |
} |
107 |
} |