Show / Hide Table of Contents

Class TableObjects<T>

Represents a list of table objects

Inheritance
System.Object
DxfObject
TableObjects<T>
ApplicationRegistries
BlockRecords
DimensionStyles
Groups
ImageDefinitions
Layers
Layouts
Linetypes
MLineStyles
ShapeStyles
TextStyles
UCSs
UnderlayDgnDefinitions
UnderlayDwfDefinitions
UnderlayPdfDefinitions
Views
VPorts
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Inherited Members
DxfObject.CodeName
DxfObject.Handle
DxfObject.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Collections
Assembly: CADability.dll
Syntax
public abstract class TableObjects<T> : DxfObject, IEnumerable<T>, IEnumerable where T : TableObject
Type Parameters
Name Description
T

TableObject.

Constructors

| Improve this Doc View Source

TableObjects(DxfDocument, String, String)

Declaration
protected TableObjects(DxfDocument document, string codeName, string handle)
Parameters
Type Name Description
DxfDocument document
System.String codeName
System.String handle

Fields

| Improve this Doc View Source

list

Declaration
protected readonly Dictionary<string, T> list
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, T>
| Improve this Doc View Source

references

Declaration
protected Dictionary<string, List<DxfObject>> references
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<DxfObject>>

Properties

| Improve this Doc View Source

Count

Gets the number of table objects.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Item[String]

Gets a table object from the list by name.

Declaration
public T this[string name] { get; }
Parameters
Type Name Description
System.String name

Table object name.

Property Value
Type Description
T

The table object with the specified name.

Remarks

Table object names are case insensitive.

| Improve this Doc View Source

Items

Gets the table object list.

Declaration
public ICollection<T> Items { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<T>
| Improve this Doc View Source

MaxCapacity

Gets the maximum number of objects the collection can hold.

Declaration
public int MaxCapacity { get; }
Property Value
Type Description
System.Int32
Remarks

This is an approximate value, the actual exact value is unknown. In any case is not recommended to get even close to this number for any practical use.

| Improve this Doc View Source

Names

Gets the ObjectTable names.

Declaration
public ICollection<string> Names { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<System.String>
| Improve this Doc View Source

Owner

Gets the owner of the actual DXF object.

Declaration
public DxfDocument Owner { get; }
Property Value
Type Description
DxfDocument

Methods

| Improve this Doc View Source

Add(T)

Adds a table object to the list.

Declaration
public T Add(T item)
Parameters
Type Name Description
T item

TableObject to add to the list.

Returns
Type Description
T

If a table object already exists with the same name as the instance that is being added the method returns the existing table object, if not it will return the new table object.

| Improve this Doc View Source

Clear()

Removes all table objects that are not reserved and have no references.

Declaration
public void Clear()
| Improve this Doc View Source

Contains(T)

Checks if a table object already exists in the list.

Declaration
public bool Contains(T item)
Parameters
Type Name Description
T item

Table object.

Returns
Type Description
System.Boolean

True is a table object exists, false otherwise.

| Improve this Doc View Source

Contains(String)

Checks if a table object already exists in the list.

Declaration
public bool Contains(string name)
Parameters
Type Name Description
System.String name

Table object name.

Returns
Type Description
System.Boolean

True is a table object exists with the specified name, false otherwise.

| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that iterates through the table object collection.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T>

An enumerator for the table object collection.

| Improve this Doc View Source

GetReferences(T)

Gets the DxfObject referenced by a T.

Declaration
public List<DxfObject> GetReferences(T item)
Parameters
Type Name Description
T item

Table object.

Returns
Type Description
System.Collections.Generic.List<DxfObject>

The list of DxfObjects that reference the specified table object.

Remarks

If there is no table object with the specified name in the list the method an empty list.
The Groups collection method GetReferences will always return an empty list since there are no DxfObjects that references them.

| Improve this Doc View Source

GetReferences(String)

Gets the DxfObject referenced by a T.

Declaration
public List<DxfObject> GetReferences(string name)
Parameters
Type Name Description
System.String name

Table object name.

Returns
Type Description
System.Collections.Generic.List<DxfObject>

The list of DxfObjects that reference the specified table object.

Remarks

If there is no table object with the specified name in the list the method an empty list.
The Groups collection method GetReferences will always return an empty list since there are no DxfObjects that references them.

| Improve this Doc View Source

Remove(T)

Removes a table object.

Declaration
public abstract bool Remove(T item)
Parameters
Type Name Description
T item

TableObject to remove from the document.

Returns
Type Description
System.Boolean

True is the table object has been successfully removed, or false otherwise.

Remarks

Reserved table objects or any other referenced by objects cannot be removed.

| Improve this Doc View Source

Remove(String)

Removes a table object.

Declaration
public abstract bool Remove(string name)
Parameters
Type Name Description
System.String name

Table object name to remove from the document.

Returns
Type Description
System.Boolean

True is the table object has been successfully removed, or false otherwise.

Remarks

Reserved table objects or any other referenced by objects cannot be removed.

| Improve this Doc View Source

TryGetValue(String, out T)

Gets the table object associated with the specified name.

Declaration
public bool TryGetValue(string name, out T item)
Parameters
Type Name Description
System.String name

The name of the table object to get.

T item

When this method returns, contains the table object associated with the specified name, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns
Type Description
System.Boolean

True if the table contains an element with the specified name; otherwise, false.

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the table object collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An enumerator for the table object collection.

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX