Class LayerDictionary
A class that holds layers using a dictionary structure with the layer names being used as the keys.
Inheritance
Inherited Members
Namespace: Dxflib.AcadEntities
Assembly: Dxflib.dll
Syntax
public class LayerDictionary
Constructors
| Improve this Doc View SourceLayerDictionary()
Constructor that initializes the Layer Dictionary to an empty System.Collections.Generic.Dictionary`2
Declaration
public LayerDictionary()
Properties
| Improve this Doc View SourceCount
The number of objects in the dictionary
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
GetAllLayers
Returns all layers as a
Declaration
public List<Layer> GetAllLayers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Layer> |
Methods
| Improve this Doc View SourceContainsLayer(String)
Returns true or false if the layer is in this dictionary
Declaration
public bool ContainsLayer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the layer you want to search |
Returns
Type | Description |
---|---|
System.Boolean | True: If the layer does exits, False: If the layer does not exist |
GetLayer(String)
Get a Layer from the dictionary by its name
Declaration
public Layer GetLayer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the layer |
Returns
Type | Description |
---|---|
Layer | The layer that corresponds with the
|
NewLayer(String)
Adding a new layer to the dictionary
Declaration
public void NewLayer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the layer |
Exceptions
Type | Condition |
---|---|
LayerException | Thrown when the |
RemoveLayer(String)
Remove a layer by its name
Declaration
public bool RemoveLayer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the layer that is to be removed |
Returns
Type | Description |
---|---|
System.Boolean | True: if Successful |
UpdateDictionary(IEnumerable<Entity>)
Updates the dictionary. If a layer does not exist then it adds it to the dictionary and adds entities to their respective layers.
Declaration
public void UpdateDictionary(IEnumerable<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Entity> | entities | Entities that you want the dictionary to have |