|
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Public Class BVToolBarButtonCollectionExt
Inherits CollectionBase
Implements ICustomTypeDescriptor
Public Event Change(ByVal sender As Object, ByVal e As EventArgs)
Public Sub Add(ByVal Btn As BVToolBarButton)
List.Add(Btn)
RaiseEvent Change(Me, New EventArgs)
End Sub
Public Sub Remove(ByVal Btn As BVToolBarButton)
List.Remove(Btn)
RaiseEvent Change(Me, New EventArgs)
End Sub
Default Public ReadOnly Property Item(ByVal index As Integer) As BVToolBarButton
Get
Return Me.List(index)
End Get
End Property
Public Function GetAttributes() As System.ComponentModel.AttributeCollection Implements ICustomTypeDescriptor.GetAttributes
Return TypeDescriptor.GetAttributes(Me, True)
End Function
Public Function GetClassName() As String Implements ICustomTypeDescriptor.GetClassName
Return TypeDescriptor.GetClassName(Me, True)
End Function
Public Function GetComponentName() As String Implements ICustomTypeDescriptor.GetComponentName
TypeDescriptor.GetComponentName(Me, True)
End Function
Public Function GetConverter() As TypeConverter Implements ICustomTypeDescriptor.GetConverter
Return TypeDescriptor.GetConverter(Me, True)
End Function
Public Function GetDefaultEvent() As System.ComponentModel.EventDescriptor Implements System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent
Return TypeDescriptor.GetDefaultEvent(Me, True)
End Function
Public Function GetDefaultProperty() As System.ComponentModel.PropertyDescriptor Implements System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty
Return TypeDescriptor.GetDefaultProperty(Me, True)
End Function
Public Function GetEditor(ByVal editorBaseType As System.Type) As Object Implements System.ComponentModel.ICustomTypeDescriptor.GetEditor
Return TypeDescriptor.GetEditor(Me, editorBaseType, True)
End Function
Public Overloads Function GetEvents() As System.ComponentModel.EventDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetEvents
Return TypeDescriptor.GetEvents(Me, True)
End Function
Public Overloads Function GetEvents(ByVal attributes() As System.Attribute) As System.ComponentModel.EventDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetEvents
Return TypeDescriptor.GetEvents(Me, attributes, True)
End Function
Public Overloads Function GetProperties() As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetProperties
'Create a collection object to hold property descriptors
Dim pds As PropertyDescriptorCollection = New PropertyDescriptorCollection(Nothing)
Dim i As Integer
' Iterate the list of employees
Do While i < Me.List.Count
' Create a property descriptor for the employee item and add to the property descriptor collection
Dim pd As BVToolBarCollectionPropertyDescriptor
pd = New BVToolBarCollectionPropertyDescriptor(Me, i)
pds.Add(pd)
i += 1
Loop
' return the property descriptor collection
Return pds
End Function
Public Overloads Function GetProperties(ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetProperties
Return GetProperties()
End Function
Public Function GetPropertyOwner(ByVal pd As System.ComponentModel.PropertyDescriptor) As Object Implements System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner
Return Me
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.