ActivityToolboxItem Constructors

Definition

Initializes a new instance of the ActivityToolboxItem class.

Overloads

ActivityToolboxItem()

Initializes a new instance of the ActivityToolboxItem class.

ActivityToolboxItem(Type)

Initializes a new instance of the ActivityToolboxItem class that creates the specified type of Activity component.

ActivityToolboxItem(SerializationInfo, StreamingContext)

Initializes a new instance of the ActivityToolboxItem class by using the specified SerializationInfo and StreamingContext.

ActivityToolboxItem()

Initializes a new instance of the ActivityToolboxItem class.

C#
public ActivityToolboxItem();

Remarks

The parameterless constructor for the ActivityToolboxItem class.

Applies to

.NET Framework 4.8.1 ja muut versiot
Tuote Versiot
.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

ActivityToolboxItem(Type)

Initializes a new instance of the ActivityToolboxItem class that creates the specified type of Activity component.

C#
public ActivityToolboxItem(Type type);

Parameters

type
Type

The type of the Activity that the toolbox item will create.

Applies to

.NET Framework 4.8.1 ja muut versiot
Tuote Versiot
.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

ActivityToolboxItem(SerializationInfo, StreamingContext)

Initializes a new instance of the ActivityToolboxItem class by using the specified SerializationInfo and StreamingContext.

C#
protected ActivityToolboxItem(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

The SerializationInfo that holds information to deserialize the toolbox item.

context
StreamingContext

The StreamingContext that provides the deserialization context for the toolbox item.

Examples

The following example shows a complete ActivityToolboxItem class for a custom activity. The Deserialize method is called within the constructor in order to initialize a new instance of the ActivityToolboxItem.

C#
[Serializable]
internal sealed class CustomActivityToolboxItem : ActivityToolboxItem
{
    public CustomActivityToolboxItem(Type type)
        : base(type)
    {
    }

    private CustomActivityToolboxItem(SerializationInfo info, StreamingContext context)
    {
        Deserialize(info, context);
    }

    protected override IComponent[] CreateComponentsCore(IDesignerHost designerHost)
    {
        CompositeActivity parallel = new ParallelActivity();
        parallel.Activities.Add(new CustomActivity());
        parallel.Activities.Add(new CustomActivity());

        return new IComponent[] { parallel };
    }
}

Remarks

When ActivityToolboxItem is called, it deserializes the toolbox item.

Applies to

.NET Framework 4.8.1 ja muut versiot
Tuote Versiot
.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