在自定义工作流活动中使用内部Microsoft编辑器

时间:2011-07-04 11:00:19

标签: c# workflow workflow-foundation-4

我正在使用Workflow 4.0创建自定义活动,我想使用现有的Microsoft属性编辑器。确切地说,我想使用SendContentPropertyEditor。这个类是内部的,但我希望我能够使用以下代码来使用它:

[Editor("System.ServiceModel.Activities.Presentation.SendContentPropertyEditor, System.Activities.Core.Presentation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", typeof(DialogPropertyValueEditor))]
[DefaultValue(null)]
public SendContent SendContent { get; set; }

问题是当我尝试在属性网格中为此属性设置值时,我得到NullPointerException。你可以在下面的截图中看到stacktrace:

enter image description here

您有任何想法如何解决此问题,以便可以使用该编辑器吗?

1 个答案:

答案 0 :(得分:0)

也许创建一个使用反射的包装器DialogPropertyValueEditor。