Skip to content

ControlInfo and ControlDef Classes

Gary edited this page Aug 27, 2014 · 1 revision

Table of Contents

The ControlInfo and ControlDef classes describe a control's appearance and location in the UI. WinForms uses ControlInfo; WPF uses ControlDef. Both have similar information. Information in these classes is needed to register a control.

ControlInfo Class

ControlInfo offers a variety of constructors with varying information. This one has all the options:

public ControlInfo(string name, string description, StandardControlGroup group, Image image)
{
    m_name = name;
    m_description = description;
    m_group = group;
    m_image = image;
}

These parameters are:

  • name: Control name, which may be displayed as the title of a hosting control or form.
  • description: Control description, which may be displayed as a tooltip.
  • group: StandardControlGroup for initial control hosting group. For details, see ATF Control Groups.
  • image: Optional control image, which can be displayed on a hosting control tab or form.

ControlDef Class

ControlDef does not provide a constructor with parameters, but has the following gettable and settable properties:

  • Name: Control's name, which may be displayed as the title of a hosting control tab or form.
  • Description: Description, which may be displayed as a tooltip.
  • Group: StandardControlGroup indicating where controls are initially docked. For details, see ATF Control Groups.
  • ImageSourceKey: Optional control image, which may be displayed on a hosting control or form.
  • Id: Unique ID for control.
This information is the same as in ControlInfo except for the additional ID.

This line, from the ATF Model Viewer Sample, shows instantiating a ControlInfo for a 3D rendering control:

ControlInfo cinfo = new ControlInfo("3D View", "3d viewer", StandardControlGroup.CenterPermanent);

This example, from the IControlHostService interface for WPF, shows instantiating a ControlDef:

var def = new ControlDef() { Name = name, Description = description, Group = group, Id = id,
    ImageSourceKey = imageSourceKey };

Topics in this section

Clone this wiki locally