DrawingCollection Class
- Namespace
TXTextControl.DataVisualization
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Inherits
- Frame
Base Collection - Drawing
Collection
- Frame
- Implements
- ICollection, IEnumerable
Description
An instance of the DrawingCollection class contains all drawings in a document represented through objects of the type DataVisualization.DrawingFrame. An instance of this class can be obtained with the TextControl.Drawings, WPF.TextControl.Drawings or ServerTextControl.Drawings property. The DrawingCollection class implements the IEnumerable and the ICollection interfaces.
Syntax
public class DrawingCollection : FrameBaseCollectionPublic Class DrawingCollection
Inherits FrameBaseCollectionExamples
The following example includes the count value from a Drawing Collection object in application diagnostics. The created object is then available to the surrounding document workflow.
Console.WriteLine($"Count: {drawingCollection.Count}");
Console.WriteLine("Drawing Collection is ready for use.");Console.WriteLine($"Count: {drawingCollection.Count}")
Console.WriteLine("Drawing Collection is ready for use.")Members
Properties
| Property | Description |
|---|---|
| Count | Gets the number of elements contained in the collection. (Inherited from FrameBaseCollection.) |
| IsSynchronized | Returns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from FrameBaseCollection.) |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. (Inherited from FrameBaseCollection.) |
Methods
| Method | Description |
|---|---|
| Add | Inserts a new drawing in a Text Control document. |
| Clear | Removes all objects from the collection and from the document. (Inherited from FrameBaseCollection.) |
| CopyTo | Copies the elements of the collection to an array, starting at a particular index. |
| DeactivateItem | Deactivates the activated drawing and sets the input focus back to the text part that contains the drawing. |
| GetActivatedItem | Returns the currently activated drawing. An activated drawing has the input focus and can be edited. The method returns null, if no drawing is activated. |
| GetEnumerator | Returns an enumerator that can be used to iterate through the collection. (Inherited from FrameBaseCollection.) |
| GetItem | Gets a particular drawing from the collection. |
| Remove | Removes a drawing from a Text Control document. |