-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
53 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.State.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using ACadSharp.Attributes; | ||
using ACadSharp.Entities; | ||
|
||
namespace ACadSharp.Objects.Evaluations | ||
{ | ||
public partial class BlockVisibilityParameter | ||
{ | ||
/// <summary> | ||
/// Represents a named state containing <see cref="Entity"/> objects. <br/> | ||
/// The state controls the visibility of the entities assigned to it. | ||
/// </summary> | ||
public class State : ICloneable | ||
{ | ||
/// <summary> | ||
/// Gets the name of the state. | ||
/// </summary> | ||
[DxfCodeValue(303)] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Get the list of <see cref="Entity"/> objects in this state. | ||
/// </summary> | ||
[DxfCodeValue(DxfReferenceType.Count, 94)] | ||
[DxfCollectionCodeValue(DxfReferenceType.Handle, 332)] | ||
public List<Entity> Entities { get; private set; } = new(); | ||
|
||
/// <summary> | ||
/// Get the list of <see cref="EvaluationExpression"/> objects. | ||
/// </summary> | ||
[DxfCodeValue(DxfReferenceType.Count, 95)] | ||
[DxfCollectionCodeValue(DxfReferenceType.Handle, 333)] | ||
public List<EvaluationExpression> Expressions { get; private set; } = new(); | ||
|
||
/// <inheritdoc/> | ||
public object Clone() | ||
{ | ||
State clone = (State)MemberwiseClone(); | ||
|
||
clone.Entities = new List<Entity>(); | ||
foreach (var item in this.Entities) | ||
{ | ||
clone.Entities.Add((Entity)item.Clone()); | ||
} | ||
|
||
clone.Expressions = new(); | ||
foreach (var item in this.Expressions) | ||
{ | ||
clone.Expressions.Add((EvaluationExpression)item.Clone()); | ||
} | ||
|
||
return clone; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters