ActivityDesigner.Initialize(Activity) Method

Definition

Initializes the designer with the associated Activity.

C#
protected virtual void Initialize(System.Workflow.ComponentModel.Activity activity);

Parameters

activity
Activity

The Activity with which the designer should be initialized.

Examples

The following example shows how to override the base class implementation of the Initialize method. The Initialize method in this example is loading a Bitmap object from an embedded resource. The ToolboxImage resource is the Image that is used when the base ActivityDesigner class draws the custom ActivityDesigner.

C#
protected override void Initialize(Activity activity)
{
    base.Initialize(activity);
    Bitmap bmp = Resources.ToolboxImage;
    bmp.MakeTransparent();
    this.Image = bmp;
}

Remarks

Initialize loads the designer with the Activity specified. The designer loads the Activity service, updates the verbs associated with the activity and assigns the default text and image to the designer.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1