internal Block(string name, bool checkName) : base(name, DxfObjectCode.Block, checkName) { this.reserved = name.Equals("*Model_Space", StringComparison.OrdinalIgnoreCase); this.description = string.Empty; this.position = Vector3.Zero; this.layer = Layer.Default; this.entities = new EntityCollection(); this.entities.BeforeAddItem += this.Entities_BeforeAddItem; this.entities.AddItem += this.Entities_AddItem; this.entities.BeforeRemoveItem += this.Entities_BeforeRemoveItem; this.entities.RemoveItem += this.Entities_RemoveItem; this.attributes = new AttributeDefinitionDictionary(); this.attributes.BeforeAddItem += this.AttributeDefinitions_BeforeAddItem; this.attributes.AddItem += this.AttributeDefinitions_ItemAdd; this.attributes.BeforeRemoveItem += this.AttributeDefinitions_BeforeRemoveItem; this.attributes.RemoveItem += this.AttributeDefinitions_RemoveItem; this.owner = new BlockRecord(name); this.flags = BlockTypeFlags.None; this.end = new BlockEnd { Layer = this.layer, Owner = this.owner }; }
/// <summary> /// Initializes a new instance of the <c>Block</c> class. /// </summary> /// <param name="name">Block name.</param> public Block(string name) : base(DxfObjectCode.Block) { if (string.IsNullOrEmpty(name)) throw (new ArgumentNullException("name")); this.name = name; this.basePoint = Vector3d.Zero; this.layer = Layer.Default; this.attributes = new Dictionary<string, AttributeDefinition>(); this.entities = new List<IEntityObject>(); this.record=new BlockRecord(name); this.end = new BlockEnd(this.layer); }
/// <summary> /// Initializes a new instance of the <c>Block</c> class. /// </summary> /// <param name="name">Block name.</param> public Block(string name) : base(DxfObjectCode.Block) { if (string.IsNullOrEmpty(name)) { throw (new ArgumentNullException("name")); } this.name = name; this.basePoint = Vector3d.Zero; this.layer = Layer.Default; this.attributes = new Dictionary <string, AttributeDefinition>(); this.entities = new List <IEntityObject>(); this.record = new BlockRecord(name); this.end = new BlockEnd(this.layer); }
public void WriteBlockEnd(BlockEnd blockEnd) { this.WriteCodePair(0, blockEnd.CodeName); this.WriteCodePair(5, blockEnd.Handle); this.WriteCodePair(100, SubclassMarker.Entity); this.WriteCodePair(8, blockEnd.Layer); this.WriteCodePair(100, SubclassMarker.BlockEnd); }