ActivityToolboxItem.CreateComponentsCore(IDesignerHost) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
protected:
override cli::array <System::ComponentModel::IComponent ^> ^ CreateComponentsCore(System::ComponentModel::Design::IDesignerHost ^ host);
protected override System.ComponentModel.IComponent[] CreateComponentsCore (System.ComponentModel.Design.IDesignerHost host);
override this.CreateComponentsCore : System.ComponentModel.Design.IDesignerHost -> System.ComponentModel.IComponent[]
Protected Overrides Function CreateComponentsCore (host As IDesignerHost) As IComponent()
Parameters
- host
- IDesignerHost
The IDesignerHost to host the toolbox item.
Returns
An array of created IComponent objects.
Examples
The following example shows a complete ActivityToolboxItem class for a custom activity. In this example, the CreateComponentsCore method is overridden in order to insert 2 custom activities within a ParallelActivity.
[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 };
}
}
<Serializable()> _
Friend Class CustomActivityToolboxItem
Inherits ActivityToolboxItem
Public Sub New(ByVal type As Type)
MyBase.new(type)
End Sub
Private Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
Deserialize(info, context)
End Sub
Protected Overrides Function CreateComponentsCore(ByVal designerHost As IDesignerHost) As IComponent()
Dim parallel As New ParallelActivity()
parallel.Activities.Add(New CustomActivity())
parallel.Activities.Add(New CustomActivity())
Return New IComponent() {parallel}
End Function
End Class
Remarks
The CreateComponentsCore method returns the component or components that the ActivityToolboxItem creates.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기