This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyHyperlinkEdit.cs
57 lines (52 loc) · 1.72 KB
/
MyHyperlinkEdit.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraEditors.Registrator;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.ViewInfo;
using DevExpress.Utils.Drawing;
namespace WindowsApplication1
{
[System.ComponentModel.DesignerCategory("")]
public class MyHyperlinkEdit : HyperLinkEdit, IAutoHeightControl
{
static MyHyperlinkEdit()
{
RepositoryItemMyHyperlinkEdit.Register();
}
public override string EditorTypeName
{
get { return RepositoryItemMyHyperlinkEdit.EditorName; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public new RepositoryItemMyHyperlinkEdit Properties
{
get { return base.Properties as RepositoryItemMyHyperlinkEdit; }
}
#region IAutoHeightControl Members
int IAutoHeightControl.CalcHeight(GraphicsCache cache)
{
if (ViewInfo.IsReady)
{
IHeightAdaptable ih = ViewInfo as IHeightAdaptable;
if (ih != null) return ih.CalcHeight(cache, Width);
}
return Height;
}
bool IAutoHeightControl.SupportsAutoHeight { get { return true; } }
EventHandler heightChanged;
event EventHandler IAutoHeightControl.HeightChanged
{
add { heightChanged += value; }
remove { heightChanged -= value; }
}
protected void RaiseHeightChanged()
{
if (heightChanged != null) heightChanged(this, EventArgs.Empty);
}
#endregion
}
}