[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.FontInfoCollection

Class FontInfoCollection

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents a collection of FontInfo objects.

public class FontInfoCollection : IReadOnlyCollection<FontInfo>, IEnumerable<FontInfo>, IEnumerable
Inheritance
object
FontInfoCollection
Implements
System.Collections.Generic.IReadOnlyCollection<T><FontInfo>
System.Collections.Generic.IEnumerable<T><FontInfo>
System.Collections.IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Count

public int Count { get; }

Property Value

int

Document

Gets the document that contains this collection.

public DocumentBase Document { get; }

Property Value

DocumentBase

IsReadOnly

Gets a value indicating whether the containing document is in reading mode.

public bool IsReadOnly { get; }

Property Value

bool

this[int]

Gets a font by its index in this collection.

public FontInfo this[int index] { get; }

Parameters

index int

The font index in the collection.

Property Value

FontInfo

The font with the specified index in the collection.

this[string]

Gets a font by its primary name.

public FontInfo this[string name] { get; }

Parameters

name string

The font primary name.

Property Value

FontInfo

The font with the specified primary name.

Methods

Add(Font, bool)

Adds a new font into the collection.

public FontInfo Add(Font font, bool embed = false)

Parameters

font GrapeCity.Documents.Text.Font

The GrapeCity.Documents.Text.Font to add.

embed bool

Whether to embed the specified font.

Returns

FontInfo

A newly created FontInfo if embed is false, otherwise it can be existing FontInfo that now contains the embedded font.

Add(string)

Adds a font with a specified primary name to the collection.

public FontInfo Add(string name)

Parameters

name string

The primary name of the font to add.

Returns

FontInfo

The newly created FontInfo instance.

Append(IList<Font>, bool)

Appends a list of GrapeCity.Documents.Text.Font objects to the collection. Fonts that already exist in the collection are ignored.

public void Append(IList<Font> fonts, bool embed = false)

Parameters

fonts System.Collections.Generic.IList<T><GrapeCity.Documents.Text.Font>

The list of fonts to append.

embed bool

Specifies whether to embed appended fonts.

Clear()

Removes all fonts from the collection.

public void Clear()

Contains(string)

Checks whether the collection contains a font with the specified primary name.

public bool Contains(string name)

Parameters

name string

The font primary name.

Returns

bool

true if the collection contains a font with the specified primary name, false otherwise.

Find(string)

Finds a FontInfo in this collection by its primary or alternate name.

public FontInfo Find(string name)

Parameters

name string

The primary or alternate font name to find.

Returns

FontInfo

The FontInfo that was found, or null if no match was found.

GetEnumerator()

public IEnumerator<FontInfo> GetEnumerator()

Returns

System.Collections.Generic.IEnumerator<T><FontInfo>

Remove(FontInfo)

Removes a specified font from the collection.

public bool Remove(FontInfo item)

Parameters

item FontInfo

The font to remove.

Returns

bool

true if the specified font was found and removed from the collection, false otherwise.

Remove(string)

Removes a font with the specified primary name from the collection.

public bool Remove(string name)

Parameters

name string

The primary name of the font to remove.

Returns

bool

true if a font with the specified primary name was found and removed from the collection, false otherwise.

TryGetValue(string, out FontInfo)

Tries to get a font from the collection by its primary name.

public bool TryGetValue(string name, out FontInfo item)

Parameters

name string

The font primary name.

item FontInfo

OUT: if this method returns true, contains the font with the specified primary name, otherwise null.

Returns

bool

true if a font with the specified primary name was found, otherwise false.