-
Notifications
You must be signed in to change notification settings - Fork 0
/
RectangleShapeArray.vb
75 lines (57 loc) · 1.96 KB
/
RectangleShapeArray.vb
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Option Strict Off
Option Explicit On
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Microsoft.VisualBasic.Compatibility.VB6
Imports Microsoft.VisualBasic.PowerPacks
<ProvideProperty("Index", GetType(RectangleShape))> Friend Class RectangleShapeArray
Inherits BaseControlArray
Implements IExtenderProvider
Public Event [Click] As System.EventHandler
Public Sub New()
MyBase.New()
End Sub
Public Sub New(ByVal Container As IContainer)
MyBase.New(Container)
End Sub
Public Function CanExtend(ByVal Target As Object) As Boolean Implements IExtenderProvider.CanExtend
If TypeOf Target Is RectangleShape Then
Return BaseCanExtend(Target)
End If
End Function
Public Function GetIndex(ByVal o As RectangleShape) As Short
Return BaseGetIndex(o)
End Function
Public Sub SetIndex(ByVal o As RectangleShape, ByVal Index As Short)
BaseSetIndex(o, Index)
End Sub
Public Function ShouldSerializeIndex(ByVal o As RectangleShape) As Boolean
Return BaseShouldSerializeIndex(o)
End Function
Public Sub ResetIndex(ByVal o As RectangleShape)
BaseResetIndex(o)
End Sub
Public Shadows Sub Load(ByVal Index As Short)
MyBase.Load(Index)
CType(Item(0).Parent, ShapeContainer).Shapes.Add(Item(Index))
End Sub
Public Shadows Sub Unload(ByVal Index As Short)
CType(Item(0).Parent, ShapeContainer).Shapes.Remove(Item(Index))
MyBase.Unload(Index)
End Sub
Public Default ReadOnly Property Item(ByVal Index As Short) As RectangleShape
Get
Item = CType(BaseGetItem(Index), RectangleShape)
End Get
End Property
Protected Overrides Sub HookUpControlEvents(ByVal o As Object)
Dim ctl As RectangleShape
ctl = CType(o, RectangleShape)
If Not IsNothing(ClickEvent) Then
addHandler ctl.Click, ClickEvent
End If
End Sub
Protected Overrides Function GetControlInstanceType() As System.Type
Return GetType(RectangleShape)
End Function
End Class