Subscription events accumulating

Topics: CAB & Smart Client Software Factory
Aug 8, 2006 at 9:43 AM
originally posted by: kos1

I have a smart part which publishes to another smart part's subscription and populates a gridview. When I close the subscribing smart part and return to the smartpart that publishes, everything seems fine but when I trigger the publication again, the subscribing smart part runs through it's subscription twice. This subscription will continue to accumulate as I go back to the receiving smart part. Any suggestions? I'm not triggering multiple publications, I've confirmed that.

After further troubleshooting, it seems that as I remove the smartpart from the workitem and add it back in, the subscription list is adding additional subscriptions for that same smart part even though one instance of the smart part is in the workitem.
Aug 10, 2006 at 5:56 AM
originally posted by: ForumUserRCC

Try this when removing the smart part -

WorkItem.WorkspacesWorkspaceNames.RightWorkspace.Close(view);
WorkItem.Items.Remove(view);
view.Dispose();
WorkItem.EventTopicsEventTopicNames.YOURTOPIC.Enabled = false;
Aug 10, 2006 at 8:48 AM
originally posted by: kos1

Thank you, I was implementing everything you've stated above with the exception of disabling the event topic. Although, wouldn't it be better if I removed it so it's not added in again when and if the smart part is added to the work item.