- modelstudio_src.zip
- ModelStudio.App
- app.config
- app.ico
- bin
- EntryPoint.vb
- Framework
- Business
- Collections
- Members
- FrmMain.Designer.vb
- FrmMain.resx
- FrmMain.vb
- Gui
- Diagramer
- Forms
- Interfaces
- Lib
- ModelStudio.App.vbproj
- ModelStudio.App.vbproj.user
- Mods
- My Project
- Resources
- about16.png
- AboutImg.png
- BannerImg.png
- Class.png
- Code.png
- Collapse9.png
- Configurator.png
- Constructors16.png
- Draw16.png
- edging.png
- Events16.png
- Exit16.png
- Expand9.png
- Fields16.png
- Header.png
- help16.gif
- HideTree.png
- HideTree16.png
- Import.png
- Interfaces16.png
- Logo.png
- MainCollapse13.png
- MainExpand13.png
- Method.png
- Method16.png
- New.png
- Open.png
- open16.png
- Parameter.png
- print16.png
- Prop16.png
- Prop33.png
- Property.png
- Save.png
- save16.png
- SaveImg.png
- Setting16.png
- SettingImg.png
- ShowTree.png
- ShowTree16.png
- space.png
- View16.png
- ModelStudio.sln
- scrn.png
|
Imports System.ComponentModel
Imports System
Imports System.ComponentModel.Design
Imports System.ComponentModel.Design.CollectionEditor
Imports System.ComponentModel.Design.Serialization
Imports System.Globalization
Imports System.Collections
Imports System.Text
''' <summary>
''' A collection of CodeDomPropertyObjects
''' </summary>
''' <remarks></remarks>
<Serializable()> _
Public Class CodeDomClassCollection
Inherits CollectionBase
Implements ICustomTypeDescriptor
Private ctlParent As Object
Sub New()
End Sub
Sub New(ByVal ParentItem As ModelStudio.CodeDomNamespace)
cParent = ParentItem
End Sub
<Browsable(False)> _
Property cParent() As Object
Get
Return ctlParent
End Get
Set(ByVal value As Object)
ctlParent = value
End Set
End Property
Protected Overrides Sub OnSet(ByVal index As Integer, ByVal oldValue As Object, ByVal newValue As Object)
CType(newValue, CodeDomClass).Parent = cParent
MyBase.OnSet(index, oldValue, newValue)
End Sub
Protected Overrides Sub OnInsert(ByVal index As Integer, ByVal value As Object)
CType(value, CodeDomClass).Parent = cParent
MyBase.OnInsert(index, value)
End Sub
Default ReadOnly Property Item(ByVal Index As Integer) As CodeDomClass
Get
Return DirectCast(List(Index), CodeDomClass)
End Get
End Property
''' <summary>
''' Add a new CodeDomProperty Object
''' </summary>
Public Function Add(ByVal value As CodeDomClass) As CodeDomClass
List.Add(value)
Return value
End Function
''' <summary>
''' Add a new CodeDomProperty Object
''' </summary>
Public Function Add(ByVal Name As String, ByVal Type As ClassType) As Integer
Dim prop As New CodeDomClass(Name, Type)
Return List.Add(prop)
End Function
Public Function Contains(ByVal value As CodeDomClass) As Boolean
Return List.Contains(value)
End Function
Public Sub Remove(ByVal value As CodeDomClass)
List.Remove(value)
End Sub
Public Function IndexOf(ByVal value As CodeDomClass) As Integer
Return List.IndexOf(value)
End Function
Public Sub Insert(ByVal index As Integer, ByVal value As CodeDomClass)
List.Insert(index, value)
End Sub
Public Shadows Sub Clear()
MyBase.Clear()
End Sub
Public Function GetAttributes() As System.ComponentModel.AttributeCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetAttributes
Return TypeDescriptor.GetAttributes(Me, True)
End Function
Public Function GetClassName() As String Implements System.ComponentModel.ICustomTypeDescriptor.GetClassName
Return TypeDescriptor.GetClassName(Me, True)
End Function
Public Function GetComponentName() As String Implements System.ComponentModel.ICustomTypeDescriptor.GetComponentName
Return TypeDescriptor.GetComponentName(Me, True)
End Function
Public Function GetConverter() As System.ComponentModel.TypeConverter Implements System.ComponentModel.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
Return Nothing
End Function
Public Overloads Function GetProperties(ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetProperties
Dim pdcProperties As New PropertyDescriptorCollection(Nothing)
For i As Integer = 0 To List.Count - 1
Dim pdProperty As New ClassCollectionPropertyDescriptor(Me, i)
pdcProperties.Add(pdProperty)
Next
Return pdcProperties
End Function
Public Function GetPropertyOwner(ByVal pd As System.ComponentModel.PropertyDescriptor) As Object Implements System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner
Return Me
End Function
End Class
<EditorBrowsable(EditorBrowsableState.Never)> _
Public Class ClassCollectionPropertyDescriptor
Inherits PropertyDescriptor
Private _Collection As CodeDomClassCollection = Nothing
Private _Index As Integer = -1
Sub New(ByVal Collection As CodeDomClassCollection, ByVal Index As Integer)
MyBase.New("#" + Index.ToString(), Nothing)
_Collection = Collection
_Index = Index
End Sub
Public Overrides Function CanResetValue(ByVal component As Object) As Boolean
Return True
End Function
Public Overrides ReadOnly Property ComponentType() As System.Type
Get
Return _Collection.GetType
End Get
End Property
Public Overrides Function GetValue(ByVal component As Object) As Object
Return _Collection(_Index)
End Function
Public Overrides ReadOnly Property IsReadOnly() As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property PropertyType() As System.Type
Get
Return _Collection(_Index).GetType()
End Get
End Property
Public Overrides Sub ResetValue(ByVal component As Object)
End Sub
Public Overrides Sub SetValue(ByVal component As Object, ByVal value As Object)
End Sub
Public Overrides Function ShouldSerializeValue(ByVal component As Object) As Boolean
Return True
End Function
Public Overrides ReadOnly Property Attributes() As System.ComponentModel.AttributeCollection
Get
Return New AttributeCollection(Nothing)
End Get
End Property
Public Overrides ReadOnly Property DisplayName() As String
Get
Dim item As CodeDomClass = _Collection(_Index)
Return "Class " & _Index
End Get
End Property
Public Overrides ReadOnly Property Description() As String
Get
Return "Defines a class document."
End Get
End Property
Public Overrides ReadOnly Property Name() As String
Get
Return "#" + _Index.ToString()
End Get
End Property
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.
MS, BBA, software developer, consultant, and trainer. Specializing in building data-centric applications designed for business, university, community & faith based organizations. Started developing Excel VBA macros and never looked back. Freelance developer utilizing VB.Net, SQL Server, Microsoft Access, and ASP.Net.