1

I have a simple custom activity with a private member variable (integer).

When i put it inside a sequence activity which is inside a while activity and start iterating i have a problem:

My member variable is zeroed in each iteration even though i increment it by one every time the activity is executed.

What am i doing wrong?

Thanks,

Adi Barda

4

1 回答 1

2

没有看到代码很难说,但是当您在 While 活动中工作时,您必须小心如何修改子活动的状态。While 活动产生多个执行执行上下文,并将从模板克隆您的活动(换句话说 - 您没有多次执行相同的活动,工作流会创建自定义活动的多个实例)。请参阅:http: //blogs.msdn.com/advancedworkflow/archive/2006/03/21/557121.aspxhttp://msdn.microsoft.com/en-us/magazine/cc163414.aspx

于 2009-01-15T16:27:21.403 回答