In This Article

IDataModel Interface

Provides the requirements for a data model class that can represent a property or category in a property grid.

public interface IDataModel : IDisposable

Properties

CanAutoDispose

Gets whether the data model should be automatically disposed when it is removed from a parent data model.

bool CanAutoDispose { get; }

Property Value

bool:

true if the data model should be automatically disposed when it is removed from a parent data model; otherwise, false.

Children

Gets the collection of child data models.

DataModelCollection Children { get; }

Property Value

DataModelCollection:

The collection of child data models.

Description

Gets the description of the data model, often displayed in a summary area or a tooltip.

string Description { get; }

Property Value

string:

The description of the data model, often displayed in a summary area or a tooltip.

DisplayName

Gets the name to use when displaying the data model, often the same as Name.

string DisplayName { get; }

Property Value

string:

The name to use when displaying the data model, often the same as Name.

IsExpanded

Gets or sets whether the data model is expanded.

bool IsExpanded { get; set; }

Property Value

bool:

true if the data model is expanded; otherwise, false.

IsInitialized

Gets or sets whether the data model has been initialized.

bool IsInitialized { get; set; }

Property Value

bool:

true if the data model has been initialized; otherwise, false.

IsModified

Gets whether the data model has been modified.

bool IsModified { get; }

Property Value

bool:

true if the data model has been modified; otherwise, false.

IsRoot

Gets whether the data model is the root.

bool IsRoot { get; }

Property Value

bool:

true if the data model is the root; otherwise, false.

IsSelected

Gets or sets whether the data model is selected.

bool IsSelected { get; set; }

Property Value

bool:

true if the data model is selected; otherwise, false.

Name

Gets the name of the data model.

string Name { get; }

Property Value

string:

The name of the data model.

Parent

Gets or sets the parent data model.

IDataModel Parent { get; set; }

Property Value

IDataModel:

The parent data model.

Remarks

Do not set this property directly, as it will be set when a data model is added as a child of another data model.

SortComparer

Gets or sets the DataModelSortComparer to use for sorting this data model's children.

DataModelSortComparer SortComparer { get; set; }

Property Value

DataModelSortComparer:

The DataModelSortComparer to use for sorting this data model's children.

Remarks

If this property doesn't return anything, the default SortComparer will be used.

SortImportance

Gets a DataModelSortImportance that indicates the sort importance of this data model.

DataModelSortImportance SortImportance { get; }

Property Value

DataModelSortImportance:

A DataModelSortImportance that indicates the sort importance of this data model.

SortOrder

Gets a numeric sort order for sorting the data model within other data models of the same sort importance.

int SortOrder { get; }

Property Value

int:

A numeric sort order for sorting the data model within other data models of the same sort importance.

Tag

Gets or sets custom data for the data model.

object Tag { get; set; }

Property Value

object:

The custom data for the data model.

Inherited Members