Back to Devexpress

CustomItemMetadataTypes.Register<T>() Method

dashboard-devexpress-dot-dashboardcommon-dot-customitemmetadatatypes-dot-register-1.md

latest5.6 KB
Original Source

CustomItemMetadataTypes.Register<T>() Method

Adds a metadata type to the CustomItemMetadataTypes collection.

Namespace : DevExpress.DashboardCommon

Assembly : DevExpress.Dashboard.v25.2.Core.dll

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public void Register<T>()
    where T : CustomItemMetadata
vb
Public Sub Register(Of T As CustomItemMetadata)

Type Parameters

NameDescription
T

A CustomItemMetadata object.

|

Remarks

Pass a new metadata type to the Register<T>() method. You should call the method before the main application form is created. The following code snippet shows how to register the CustomFunnelMetadata metadata type:

csharp
using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;
using DevExpress.DashboardCommon;

namespace CustomItemsSample {
    static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
          //...
          Dashboard.CustomItemMetadataTypes.Register<CustomFunnelMetadata>();
          Application.Run(new Form1());
        }
    }
}
vb
Imports DevExpress.XtraEditors
Imports System
Imports System.Windows.Forms
Imports DevExpress.DashboardCommon

Namespace CustomItemsSample
    Friend NotInheritable Class Program
        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
        Private Sub New()
        End Sub
        <STAThread> _
        Shared Sub Main()
          '...
          Dashboard.CustomItemMetadataTypes.Register(Of CustomFunnelMetadata)()
          Application.Run(New Form1())
        End Sub
    End Class
End Namespace

The following code snippets (auto-collected from DevExpress Examples) contain references to the Register<T>() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items-extension/CS/CustomItemTest/DesignerForm1.cs#L19

csharp
public DesignerForm1() {
    Dashboard.CustomItemMetadataTypes.Register<SunburstItemMetadata>();
    Dashboard.CustomItemMetadataTypes.Register<SankeyItemMetadata>();

winforms-dashboard-custom-items/CS/TutorialsCustomItems/Program.cs#L21

csharp
Application.SetCompatibleTextRenderingDefault(false);
Dashboard.CustomItemMetadataTypes.Register<HelloWorldItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<SimpleTableMetadata>();

winforms-dashboard-trend-line-indicators/CS/WinformsIndicator/Program.cs#L19

csharp
Application.SetCompatibleTextRenderingDefault(false);
Dashboard.CustomItemMetadataTypes.Register<SimpleTableMetadata>();

winforms-dashboard-custom-items-extension/VB/CustomItemTest/DesignerForm1.vb#L20

vb
Public Sub New()
    Dashboard.CustomItemMetadataTypes.Register(Of SunburstItemMetadata)()
    Dashboard.CustomItemMetadataTypes.Register(Of SankeyItemMetadata)()

winforms-dashboard-custom-items/VB/TutorialsCustomItems/Program.vb#L18

vb
Application.SetCompatibleTextRenderingDefault(False)
Dashboard.CustomItemMetadataTypes.Register(Of HelloWorldItemMetadata)()
Dashboard.CustomItemMetadataTypes.Register(Of SimpleTableMetadata)()

winforms-dashboard-trend-line-indicators/VB/WinformsIndicator/Program.vb#L19

vb
Application.SetCompatibleTextRenderingDefault(False)
Dashboard.CustomItemMetadataTypes.Register(Of SimpleTableMetadata)()

See Also

CustomItemMetadataTypes Class

CustomItemMetadataTypes Members

DevExpress.DashboardCommon Namespace