Поделиться через


DataGridDesigner.Initialize(IComponent) Метод

Определение

Инициализирует конструктор заданным элементом управления DataGrid.

public:
 override void Initialize(System::ComponentModel::IComponent ^ component);
public override void Initialize (System.ComponentModel.IComponent component);
override this.Initialize : System.ComponentModel.IComponent -> unit
Public Overrides Sub Initialize (component As IComponent)

Параметры

component
IComponent

Редактируемый элемент управления.

Примеры

В следующем примере кода показано, как переопределить Initialize метод , чтобы убедиться, что конструктор инициализирован только экземплярами SimpleDataGrid класса .

Этот пример входит в состав более крупного примера использования класса DataGridDesigner.

' Override the Initialize method to ensure that
' only an instance of the SimpleDataList class is
' used by this designer class.
Public Overrides Sub Initialize(ByVal component As IComponent)
    simpleList = CType(component, SimpleDataList)

    If IsNothing(simpleList) Then
        Throw New ArgumentException("Must be a SimpleDataList.", "component")
    End If

    MyBase.Initialize(component)
End Sub

Применяется к

См. также раздел