markus / MarkupToPDF / Common / CommentUserInfo.cs @ 05009a0e
이력 | 보기 | 이력해설 | 다운로드 (3.91 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 CommentUserInfo : System.Windows.Controls.Control |
14 |
{ |
15 |
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 |
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 |
public string SymbolID { get; set; } |
25 |
public long GroupID { get; set; } |
26 |
|
27 |
private SolidColorBrush _TempBorderBrush { get; set; } |
28 |
private SolidColorBrush _HoverBorderBrush = new SolidColorBrush(Color.FromRgb(255, 0, 255)); |
29 |
|
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 |
if (this.StrokeColor != null) |
47 |
{ |
48 |
this.StrokeColor = this._TempBorderBrush; |
49 |
this.UpdateLayout(); |
50 |
} |
51 |
} |
52 |
|
53 |
private void CommentUserInfo_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) |
54 |
{ |
55 |
this.IsMouseOver = true; |
56 |
if (this.StrokeColor != null) |
57 |
{ |
58 |
this._TempBorderBrush = this.StrokeColor; |
59 |
this.StrokeColor = this._HoverBorderBrush; |
60 |
this.UpdateLayout(); |
61 |
} |
62 |
} |
63 |
|
64 |
/// <summary> |
65 |
/// subclass has to override this property |
66 |
/// </summary> |
67 |
public virtual bool IsSelected { get; set; } |
68 |
|
69 |
/// <summary> |
70 |
/// subclass has to override this property |
71 |
/// </summary> |
72 |
public virtual ControlType ControlType { get; set; } |
73 |
|
74 |
public virtual SolidColorBrush StrokeColor { get; set; } |
75 |
|
76 |
/// <summary> |
77 |
/// 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 |
/// subclass has to override this method |
85 |
/// </summary> |
86 |
/// <returns>serialized string</returns> |
87 |
public virtual string Serialize() { return string.Empty; } |
88 |
|
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 |
//GROUP_ID = this.GroupID |
107 |
}; |
108 |
} |
109 |
|
110 |
/// <summary> |
111 |
/// return item's area |
112 |
/// </summary> |
113 |
public virtual Rect ItemRect |
114 |
{ |
115 |
get; |
116 |
} |
117 |
} |
118 |
} |