[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.ContentObject

Class ContentObject

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll
public class ContentObject
Inheritance
object
ContentObject
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Children

Gets the collection of the children of this content object.

public IEnumerable<ContentObject> Children { get; }

Property Value

System.Collections.Generic.IEnumerable<T><ContentObject>

Document

Gets the DocumentBase that contains this content object.

public DocumentBase Document { get; }

Property Value

DocumentBase

End

Gets the Marker representing the end of this content object in the parent body.

public Marker End { get; }

Property Value

Marker

Guid

Gets the content unique identifier.

public string Guid { get; }

Property Value

string

ParentBody

Gets the parent Body of this content object.

public Body ParentBody { get; }

Property Value

Body

ParentContent

Gets the parent ContentObject of this content object.

public ContentObject ParentContent { get; }

Property Value

ContentObject

Start

Gets the Marker representing the start of this content object in the parent body.

public Marker Start { get; }

Property Value

Marker

Methods

CanAdd(Type, out Exception)

Checks whether a ContentObject of the specified type can be added to the current object.

public bool CanAdd(Type contentObjectType, out Exception ex)

Parameters

contentObjectType System.Type

The type of the content object to add.

ex System.Exception

OUT: the exception that would be thrown if a content object of the specified type was added.

Returns

bool

true if a content object of the specified type can be added, false otherwise.

CanAdd(Type)

Checks whether a ContentObject of the specified type can be added to the current object.

public bool CanAdd(Type contentObjectType)

Parameters

contentObjectType System.Type

The type of the content object to add.

Returns

bool

true if a content object of the specified type can be added, false otherwise.

CanAddContentControl(ContentControlType, out Exception)

Checks whether a ContentControl of the specified type can be added to the current object.

public bool CanAddContentControl(ContentControlType type, out Exception ex)

Parameters

type ContentControlType

The type of the content control to add.

ex System.Exception

OUT: the exception that would be thrown if a content control of the specified type was added.

Returns

bool

true if a content control of the specified type can be added, false otherwise.

CanAddContentControl(ContentControlType)

Checks whether a ContentControl of the specified type can be added to the current object.

public bool CanAddContentControl(ContentControlType type)

Parameters

type ContentControlType

The type of the content control to add.

Returns

bool

true if a content control of the specified type can be added, false otherwise.

Delete()

Deletes this content object from the parent Body.

Note that the position occupied by this content object in the parent can still be accessed (e.g. to insert new content) via a PersistentRange if one has previously been created with GetPersistentRange().

public virtual void Delete()

GetChildren<T>()

Gets the collection of this content object's children of a specified type.

public IReadOnlyList<T> GetChildren<T>() where T : ContentObject

Returns

System.Collections.Generic.IReadOnlyList<T><T>

A readonly list of this object's children with the specified type.

Type Parameters

T

The requested type of child objects.

GetPersistentRange()

Creates and returns a PersistentRange associated with this content object.

Unlike the Range returned by GetRange(), this persistent range and any markers on it (see Start and End) can still be used if the object is deleted.

Note that PersistentRange should be disposed when no longer needed to improve performance.

public PersistentRange GetPersistentRange()

Returns

PersistentRange

A new PersistentRange instance associated with this content object.

GetRange()

Creates and returns a Range associated with this content object.

To get a range that can be used after the object has been deleted, see GetPersistentRange().

public Range GetRange()

Returns

Range

A new Range instance associated with this content object.

ToString()

Gets string representation of the content.

public override string ToString()

Returns

string

String representation of the content.