From 3346f22641550e0e1394f72ace01d019e02759c9 Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Dec 2024 10:54:56 +0100 Subject: [PATCH] docs --- .../BlockVisibilityParameter.State.cs | 57 +++++++++++++++++++ .../Evaluations/BlockVisibilityParameter.cs | 57 ++----------------- 2 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.State.cs diff --git a/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.State.cs b/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.State.cs new file mode 100644 index 00000000..13e1e351 --- /dev/null +++ b/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.State.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using ACadSharp.Attributes; +using ACadSharp.Entities; + +namespace ACadSharp.Objects.Evaluations +{ + public partial class BlockVisibilityParameter + { + /// + /// Represents a named state containing objects.
+ /// The state controls the visibility of the entities assigned to it. + ///
+ public class State : ICloneable + { + /// + /// Gets the name of the state. + /// + [DxfCodeValue(303)] + public string Name { get; set; } + + /// + /// Get the list of objects in this state. + /// + [DxfCodeValue(DxfReferenceType.Count, 94)] + [DxfCollectionCodeValue(DxfReferenceType.Handle, 332)] + public List Entities { get; private set; } = new(); + + /// + /// Get the list of objects. + /// + [DxfCodeValue(DxfReferenceType.Count, 95)] + [DxfCollectionCodeValue(DxfReferenceType.Handle, 333)] + public List Expressions { get; private set; } = new(); + + /// + public object Clone() + { + State clone = (State)MemberwiseClone(); + + clone.Entities = new List(); + 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; + } + } + } +} \ No newline at end of file diff --git a/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.cs b/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.cs index 36f9c9d2..5b9a9337 100644 --- a/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.cs +++ b/src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using ACadSharp.Attributes; using ACadSharp.Entities; -using CSMath; namespace ACadSharp.Objects.Evaluations { @@ -10,7 +8,7 @@ namespace ACadSharp.Objects.Evaluations /// Represents a BLOCKVISIBILITYPARAMETER object, in AutoCAD used to /// control the visibility state of entities in a dynamic block. /// - public class BlockVisibilityParameter : Block1PtParameter + public partial class BlockVisibilityParameter : Block1PtParameter { /// public override string ObjectName => DxfFileToken.ObjectBlockVisibilityParameter; @@ -33,13 +31,13 @@ public class BlockVisibilityParameter : Block1PtParameter public List States { get; private set; } = new List(); /// - /// Gets a title for the dialog to select the subblock that is to be set visible. + /// Visibility parameter name. /// [DxfCodeValue(301)] public string Name { get; set; } /// - /// Gets a description presumably for the dialog to select the subblock that is to be set visible. + /// Visibility parameter description. /// [DxfCodeValue(302)] public string Description { get; set; } @@ -47,53 +45,6 @@ public class BlockVisibilityParameter : Block1PtParameter [DxfCodeValue(91)] internal bool Value91 { get; set; } - /// - /// Represents a named state containing objects.
- /// The state controls the visibility of the entities assigned to it. - ///
- public class State : ICloneable - { - /// - /// Gets the name of the state. - /// - [DxfCodeValue(303)] - public string Name { get; set; } - - /// - /// Get the list of objects in this state. - /// - [DxfCodeValue(DxfReferenceType.Count, 94)] - [DxfCollectionCodeValue(DxfReferenceType.Handle, 332)] - public List Entities { get; private set; } = new(); - - /// - /// Get the list of objects. - /// - [DxfCodeValue(DxfReferenceType.Count, 95)] - [DxfCollectionCodeValue(DxfReferenceType.Handle, 333)] - public List Expressions { get; private set; } = new(); - - /// - public object Clone() - { - State clone = (State)MemberwiseClone(); - - clone.Entities = new List(); - 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; - } - } - /// public override CadObject Clone() {