是否可以在Windows工作流基础中向ThrowActivity引发自定义错误消息?WF ThrowActivities和自定义错误消息?
例如。想象一下,我想抛出此异常,在我的WF: -
CutomException("This is my custom error message", myNumber, myObect);
欢呼:)
是否可以在Windows工作流基础中向ThrowActivity引发自定义错误消息?WF ThrowActivities和自定义错误消息?
例如。想象一下,我想抛出此异常,在我的WF: -
CutomException("This is my custom error message", myNumber, myObect);
欢呼:)
也许我不明白你的问题很好,但你可以在ThrowActivity
的Fault
属性设置特定异常活动执行前的任何地方,例如:
throwActivity1.Fault = new CustomException("This is my custom error message", myNumber, myObect);
您可以像这样抛出任何自定义异常。
public DiscontinuedProductException discontinuedProductException1 = new DiscontinuedProductException();
[SerializableAttribute()] 公共类DiscontinuedProductException:异常 { 公共DiscontinuedProductException() :碱() { }
public DiscontinuedProductException(string message)
: base(message)
{
}
public DiscontinuedProductException(string message, Exception innerException)
: base(message, innerException)
{
}
protected DiscontinuedProductException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
是的!完善!我无法弄清楚如何在设计器中做到这一点..所以我在后面的代码中做到了。再次检查设计师,它仍然没有感觉:P,但没关系:) – 2008-11-14 00:09:10