VS2010编辑器中的自定义活动设计器 [英] Custom Activity Designer in VS2010 Editor

查看:346
本文介绍了VS2010编辑器中的自定义活动设计器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使自定义活动在VS2010工作流编辑器中具有自定义设计器?我遇到的每个样本都向托管设计师展示了如何做到这一点.在VS2010中,Visual Studio托管了设计器,那么如何使我的自定义活动设计器用于我的自定义活动?

Is there a way to make a custom activity have a custom designer inside the VS2010 Workflow Editor?  Every sample that I've ever come across shows how to do this for a hosted designer.  In VS2010, Visual Studio is hosting the designer, so how do I make my custom activity designer work for my custom activity?

推荐答案


如何您是在重新托管的世界中进行关联吗?

在VS案例中,有两种方法可以使设计人员与活动相关联.

1.代码活动中的Designer属性.
2.如果您的自定义活动位于CustomActivities.dll中,则可以在CustomActivities.Design.dll中创建设计器.然后,如下所示使用IRegisterMetadata将活动注册到该类.请注意,CustomActivities和CustomActivities.Design dll应位于同一文件夹中.
3.您可以使用CustomActivities.VisualStudio.Design.dll


关联代码覆盖VS世界中的上述两个关联:

命名空间CustomActivities.Design
{
类元数据:IRegisterMetadata
{
public void Register()
AttributeTableBuilder builder = new AttributeTableBuilder();
设计器.//注册器.
builder.AddCustomAttributes(typeof(Prompt),new DesignerAttribute(typeof(CustomActivities.Design.BasicDesignerWithStyling)));
//应用元数据
MetadataStore.AddAttributeTable(er) ;


How are you associating in the re-hosted world?

There are a couple of ways you can associate the designer with the activity in the VS case.

1. Designer attribute on your code activity.
2. If your custom activity is in CustomActivities.dll, you can create your designer in the CustomActivities.Design.dll. Then use the IRegisterMetadata as below to register the activity to the class. Please note that the CustomActivities and the CustomActivities.Design dlls should be in the same folder.
3. You can override the above two associations in the VS world, with CustomActivities.VisualStudio.Design.dll


Association Code:

namespace CustomActivities.Design
{
    class Metadata : IRegisterMetadata
    {
        public void Register()
        {
            AttributeTableBuilder builder = new AttributeTableBuilder();
            // Register Designers.
            builder.AddCustomAttributes(typeof(Prompt), new DesignerAttribute(typeof(CustomActivities.Design.BasicDesignerWithStyling)));
            // Apply the metadata
            MetadataStore.AddAttributeTable(builder.CreateTable());

}


}
}



谢谢,
库什尔.


    }
}



Thanks,
Kushal.


这篇关于VS2010编辑器中的自定义活动设计器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆