我如何知道活动是否已在工作流程设计器中删除或重新定位?
我如何知道活动是否已在工作流程设计器中删除或重新定位?活动的卸载事件两次都会触发
How do i know if an activity has been deleted or repositioned in the workflow designer? the unloaded event of the activity fires on both occasions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
戴夫的回答是部分正确的。当您移动活动时,还会调用删除事件,因此两种情况下的验证都是正确的。我使用活动的 modelItem.Parent。
当 Activity 实际被删除时,modelItem.Parent 为 null;当 Activity 刚刚移动时,modelItem.Parent 为 null。
Dave's answer is partial correct. When you move your activity a remove event is also called, so that verification will be true for both cases. I use the activity's modelItem.Parent.
modelItem.Parent is null when the activity is actually deleted, and != null when it's just moved.
您应该能够通过使用以下事件查明活动是否已被删除:
然后,您可以通过执行以下操作找到已删除的活动:
查看 Bruce Bukovics 的 Pro WF Windows Workflow in .NET 4 一书
You should be able to find out if an activity has been deleted by using the following event:
You can then find the deleted activities by doing something like:
Check out the book Pro WF Windows Workflow in .NET 4 by Bruce Bukovics