Click here to Skip to main content
15,888,521 members
Articles / Programming Languages / Visual Basic

TeamVision

Rate me:
Please Sign up or sign in to vote.
3.08/5 (11 votes)
16 Nov 2009CPL3 min read 84.2K   5.4K   69  
A simple project task management application. A managed approach to help keep on top of your projects.
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:2.0.50727.3082
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.Data
Imports System.Runtime.Serialization
Imports System.Xml

Namespace Schema
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class DisplayTable
        Inherits DataTable
        Implements System.Collections.IEnumerable
        
        Private m_DisplayIDColumn As DataColumn
        
        Private m_DescriptionColumn As DataColumn
        
        Private m_NameColumn As DataColumn
        
        Friend Sub New()
            MyBase.New("DisplayTable")
            Me.InitClass
        End Sub
        
        Friend Sub New(ByVal table As DataTable)
            MyBase.New(table.TableName)
            If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
                Me.CaseSensitive = table.CaseSensitive
            End If
            If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
                Me.Locale = table.Locale
            End If
            If (table.Namespace <> table.DataSet.Namespace) Then
                Me.Namespace = table.Namespace
            End If
            Me.Prefix = table.Prefix
            Me.MinimumCapacity = table.MinimumCapacity
            Me.DisplayExpression = table.DisplayExpression
        End Sub
        
        <System.ComponentModel.Browsable(false)>  _
        Public ReadOnly Property Count() As Integer
            Get
                Return Me.Rows.Count
            End Get
        End Property
        
        Public Default ReadOnly Property Item(ByVal index As Integer) As DisplayRow
            Get
                Return CType(Me.Rows(index),DisplayRow)
            End Get
        End Property
        
        Friend ReadOnly Property DisplayIDColumn() As DataColumn
            Get
                Return Me.m_DisplayIDColumn
            End Get
        End Property
        
        Friend ReadOnly Property DescriptionColumn() As DataColumn
            Get
                Return Me.m_DescriptionColumn
            End Get
        End Property
        
        Friend ReadOnly Property NameColumn() As DataColumn
            Get
                Return Me.m_NameColumn
            End Get
        End Property
        
        Public Overloads Sub AddDisplayRow(ByVal row As DisplayRow)
            Me.Rows.Add(row)
        End Sub
        
        Public Function FindByPrimaryKey(ByVal DisplayID As Integer) As DisplayRow
            Return CType(Me.Rows.Find(New Object() {DisplayID}),DisplayRow)
        End Function
        
        Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Me.Rows.GetEnumerator
        End Function
        
        Public Overrides Function Clone() As DataTable
            Dim cln As DisplayTable = CType(MyBase.Clone,DisplayTable)
            cln.InitVars
            Return cln
        End Function
        
        Protected Overrides Function CreateInstance() As DataTable
            Return New DisplayTable
        End Function
        
        Friend Sub InitVars()
            Me.m_DisplayIDColumn = Me.Columns("DisplayID")
            Me.m_DescriptionColumn = Me.Columns("Description")
            Me.m_NameColumn = Me.Columns("Name")
        End Sub
        
        Private Sub InitClass()
            Me.m_DisplayIDColumn = New DataColumn("DisplayID", GetType(Integer), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.m_DisplayIDColumn)
            Me.m_DisplayIDColumn.AllowDBNull = true
            Me.m_DisplayIDColumn.Caption = "Display"
            Me.m_DisplayIDColumn.DefaultValue = 0
            Me.m_DescriptionColumn = New DataColumn("Description", GetType(String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.m_DescriptionColumn)
            Me.m_DescriptionColumn.AllowDBNull = true
            Me.m_DescriptionColumn.Caption = "Description"
            Me.m_DescriptionColumn.DefaultValue = String.Empty
            Me.m_NameColumn = New DataColumn("Name", GetType(String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.m_NameColumn)
            Me.m_NameColumn.AllowDBNull = true
            Me.m_NameColumn.Caption = "Name"
            Me.m_NameColumn.DefaultValue = String.Empty
        End Sub
        
        Public Function NewDisplayRow() As DisplayRow
            Return CType(Me.NewRow,DisplayRow)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New DisplayRow(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(DisplayRow)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
        End Sub
        
        Public Sub RemoveDisplayRow(ByVal row As DisplayRow)
            Me.Rows.Remove(row)
        End Sub
        
        Public Overloads Function AddDisplayRow(ByVal DisplayID As Integer, ByVal Description As String, ByVal Name As String) As DisplayRow
            Dim rowTableRow As DisplayRow = CType(Me.NewRow,DisplayRow)
            rowTableRow.ItemArray = New Object() {DisplayID, Description, Name}
            Me.Rows.Add(rowTableRow)
            Return rowTableRow
        End Function
    End Class
End Namespace

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.

License

This article, along with any associated source code and files, is licensed under The Common Public License Version 1.0 (CPL)


Written By
Founder Arkitech EBC Corporation
United States United States
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.

Comments and Discussions