Back to Devexpress

DXFontRepository.IsEmpty Property

corelibraries-devexpress-dot-drawing-dot-dxfontrepository-2a39bb4d.md

latest2.3 KB
Original Source

DXFontRepository.IsEmpty Property

Indicates whether the font repository is empty.

Namespace : DevExpress.Drawing

Assembly : DevExpress.Drawing.v25.2.dll

NuGet Package : DevExpress.Drawing

Declaration

csharp
public bool IsEmpty { get; }
vb
Public ReadOnly Property IsEmpty As Boolean

Property Value

TypeDescription
Boolean

true if the font repository contains no fonts; otherwise, false.

|

Example

The following code sample retrieves the names of all fonts in the repository and displays this information in the console window:

csharp
using DevExpress.Drawing;
using System;
using System.Collections.Generic;
// ...

if (DXFontRepository.Instance.IsEmpty)
    Console.WriteLine("Font repository is empty.");
else
{
    Console.WriteLine("Font repository contains the following fonts:");
    IList<DXFontData> fonts = DXFontRepository.Instance.GetFonts();
    for (int i = 0; i < fonts.Count; i++)
    {
        Console.WriteLine($" \u002A {fonts[i].Name}");
    }
}
vb
Imports DevExpress.Drawing
Imports System
Imports System.Collections.Generic
' ...

If DXFontRepository.Instance.IsEmpty Then
    Console.WriteLine("Font repository is empty.")
Else
    Console.WriteLine("Font repository contains the following fonts:")
    Dim fonts As IList(Of DXFontData) = DXFontRepository.Instance.GetFonts()
    For i As Integer = 0 To fonts.Count - 1
        Console.WriteLine($" " & ChrW(&H002A).ToString() & " {fonts(i).Name}")
    Next i
End If

The following image demonstrates a sample console output:

See Also

DXFontRepository Class

DXFontRepository Members

DevExpress.Drawing Namespace