Show / Hide Table of Contents

Class Layer

The Layer Class is an modified wrapper for the System.Collections.Generic.Dictionary`2 class. The layer class has a dictionary backing field with custom functionality.

Inheritance
System.Object
Layer
Inherited Members
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)
System.Object.ToString()
Namespace: Dxflib.AcadEntities
Assembly: Dxflib.dll
Syntax
public class Layer

Constructors

| Improve this Doc View Source

Layer(String)

Layer Constructor: Create a layer and give it a name. This constructor will create a new blank System.Collections.Generic.Dictionary`2 backing field.

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

The Layer Name

Properties

| Improve this Doc View Source

Count

The Number of layers in the dictionary

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

Name

The Layer's Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AddEntity(String, Entity)

Adds an Entity to the dictionary

Declaration
public void AddEntity(string handle, Entity entity)
Parameters
Type Name Description
System.String handle

The entity's handle

Entity entity

The entity reference

Remarks

Always make sure that the entity is not already a member of the dictionary

Exceptions
Type Condition
LayerException

Will throw a new exception if the entity is already a member of the dictionary

| Improve this Doc View Source

ContainsEntity(String)

Returns true if the layer contains the entity with the provided handle

Declaration
public bool ContainsEntity(string handle)
Parameters
Type Name Description
System.String handle

Handle of the Entity

Returns
Type Description
System.Boolean

True: The entity is contained, False: the entity is not contained

| Improve this Doc View Source

GetAllEntities()

Get all of the entities on the layer

Declaration
public List<Entity> GetAllEntities()
Returns
Type Description
System.Collections.Generic.List<Entity>

a list of all of the entities on the layer

| Improve this Doc View Source

GetAllHandles()

Gets all of the handles from the dictionary

Declaration
public List<string> GetAllHandles()
Returns
Type Description
System.Collections.Generic.List<System.String>

A list of handles

| Improve this Doc View Source

GetEntity(String)

Gets a layer from it's handle

Declaration
public Entity GetEntity(string handle)
Parameters
Type Name Description
System.String handle

The handle of the entity

Returns
Type Description
Entity

The entity that corresponds to the handle

Exceptions
Type Condition
LayerException

Thrown when the layer does not contain the entity

| Improve this Doc View Source

RemoveEntity(String)

Removes the entity from the dictionary

Declaration
public void RemoveEntity(string handle)
Parameters
Type Name Description
System.String handle
Remarks

Always check to see if the entity is a member of the layer

Exceptions
Type Condition
LayerException

Will throw exception if the entity is not found to be a member of this layer

  • Improve this Doc
  • View Source
Back to top Generated by DocFX