TX Text Control .NET for Windows Forms

ShapeCollection Class

Class|Introduced in 23.0
Namespace
TXTextControl.Drawing
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXDrawing.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXDrawing.dll from the setup.
Inherits
  1. CollectionBase
  2. ShapeCollection
Implements
IEnumerable, IEnumerator

Description

An instance of the ShapeCollection class contains all displayed shapes represented through objects of type Shape. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Syntax

public class ShapeCollection : CollectionBase, IEnumerable, IEnumerator

Examples

The following example includes the current value from a Shape Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

Console.WriteLine($"Current: {shapeCollection.Current}");
Console.WriteLine("Shape Collection is ready for use.");

Members

Properties

PropertyDescription
CurrentNot described in the reference. public object Current { get; }
ItemGets an object of type Shape from the collection. This property is the indexer for the ShapeCollection class.

Methods

MethodDescription
AddAdds an object of the type Shape to the collection.
InsertInserts an object of the type Shape to the collection at a specified index.
MoveNextNot described in the reference. public bool MoveNext();
RemoveRemoves an object of the type Shape from the collection.
RemoveAtNot described in the reference. public void RemoveAt(int index);
ResetNot described in the reference. public void Reset();