Click or drag to resize
XTableDefMap Class
This is a real Generic.KeyedCollection, so that all usual operations on a collection work on it. the encapsulation of the source TTableDefMap is made at the TableDef level, being here a XTableDef pointing to the original object
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionXTableDef
    System.Collections.ObjectModelKeyedCollectionInt64, XTableDef
      Biolomics.BioCallbackXTableDefMap

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class XTableDefMap : KeyedCollection<long, XTableDef>

The XTableDefMap type exposes the following members.

Constructors
  NameDescription
Public methodXTableDefMap
Initializes a new instance of the XTableDefMap class.
Public methodXTableDefMap(TTableDefMap)
Initializes a new instance of the XTableDefMap class.
Top
Properties
  NameDescription
Public propertyComparer
Gets the generic equality comparer that is used to determine equality of keys in the collection.
(Inherited from KeyedCollectionInt64, XTableDef.)
Public propertyCount (Inherited from CollectionXTableDef.)
Protected propertyDictionary (Inherited from KeyedCollectionInt64, XTableDef.)
Public propertyItemTKey
Gets the element with the specified key.
(Inherited from KeyedCollectionInt64, XTableDef.)
Public propertyItemInt32
Gets or sets the element at the specified index.
(Inherited from CollectionXTableDef.)
Protected propertyItems (Inherited from CollectionXTableDef.)
Top
Methods
  NameDescription
Public methodAdd (Inherited from CollectionXTableDef.)
Protected methodChangeItemKey
Changes the key associated with the specified element in the lookup dictionary.
(Inherited from KeyedCollectionInt64, XTableDef.)
Public methodClear (Inherited from CollectionXTableDef.)
Protected methodClearItems (Inherited from KeyedCollectionInt64, XTableDef.)
Public methodClone
Clones this instance.
Public methodContains(TKey)
Determines whether the collection contains an element with the specified key.
(Inherited from KeyedCollectionInt64, XTableDef.)
Public methodContains(T) (Inherited from CollectionXTableDef.)
Public methodCopyTo (Inherited from CollectionXTableDef.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator (Inherited from CollectionXTableDef.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetItemByIdx
Gets the item by index.
Protected methodGetKeyForItem
When implemented in a derived class, extracts the key from the specified element.
(Overrides KeyedCollectionTKey, TItemGetKeyForItem(TItem).)
Public methodGetTableByDBName
Gets the table definition by database name.
Public methodGetTableByUserName
Gets the table definition by database name.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf (Inherited from CollectionXTableDef.)
Public methodInsert (Inherited from CollectionXTableDef.)
Protected methodInsertItem (Inherited from KeyedCollectionInt64, XTableDef.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove(Int64)
Removes the specified element by key.
Public methodRemove(T) (Inherited from CollectionXTableDef.)
Public methodRemoveAt (Inherited from CollectionXTableDef.)
Protected methodRemoveItem (Inherited from KeyedCollectionInt64, XTableDef.)
Protected methodSetItem
Replaces the item at the specified index with the specified item.
(Inherited from KeyedCollectionInt64, XTableDef.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Implements the operator = operator.
Public operatorStatic memberInequality
Implements the operator <> operator.
Top
Examples
This is an example shows how to get table definitions from connection.
Example VB.Net
Imports System
Imports Biolomics.BioCallback
Imports Biolomics.SharedClasses
Imports Biolomics.Utility.DatabaseConstants
Imports Biolomics.BaseLibrary

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim c As New Program
        c.Test()
    End Sub

    '    Write sub functions here
    Public Sub Test()
        '    get the current connection
        Dim SqlCo As XConnection = Run.GetCurrentConnection()
        If SqlCo Is Nothing Then
            Return
        End If

        '    get the current layout
        Dim Layout As XDataLayout = Run.GetCurrentLayout()
        If Layout Is Nothing Then  '    no current layout in a search page
            Return
        End If

        '    scan table names from the current connection and get all tables with name (in the database) starting with "taxons_"
        Dim TaxonTableDeflist As New XTableDefMap
        For Each TableDef As XTableDef In SqlCo.TableDefMap
            If TableDef.UserName.Length >= 7 AndAlso TableDef.UserName.ToLower.Substring(0, 7) = "Searching_String" Then
                TaxonTableDeflist.Add(TableDef)
            End If
        Next
        Console.Write("There is " & TaxonTableDeflist.Count.ToString & " table in this list")
    End Sub

End Class
See Also

Reference

[!:System.Collections.ObjectModel.KeyedCollection{System.Int64, Biolomics.BioCallback.XTableDef}]