|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2011-12-12 23:38:00
Posts: 37,
Visits: 168
|
|
Hi,
I am using a DirtyObjectCatcher in my Eco 5 Winforms application.
This has been working well for some time. Now when specific actions are performed I get a Null reference exception in the DirtyObjectCatcher.SubscribeToUndoblock method:
private void SubscribeToUndoblock()
{
IUndoBlock block = this.UndoService.UndoList[this.UndoBlockName];
if (block != null)
{
block.Subscribe(this.Subscriber.AsISubscriber());
}
}
The Null reference is caused by this.UndoService returning null;
SubscribeToUndoblock is called by private void CheckDirtyListChanged(object sender, EventArgs e) which is attached to the Application.Idle event here in DirtyObjectCatcher.
private void Subscriber_Receive(object sender, EventArgs e)
{
Application.Idle += new EventHandler(this.CheckDirtyListChanged);
}
Is there any chance of a fix to this problem?
A suggested work around?
The source to DroopyEyes.EcoExtensions.WinForm.dll?
This is a showstopper for me and my client!!
Regards AndyB
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-07-14 17:05:00
Posts: 290,
Visits: 2 617
|
|
AndyB (2010-04-30) Hi,
I am using a DirtyObjectCatcher in my Eco 5 Winforms application.
This has been working well for some time. Now when specific actions are performed I get a Null reference exception in the DirtyObjectCatcher.SubscribeToUndoblock method:
private void SubscribeToUndoblock()
{
IUndoBlock block = this.UndoService.UndoList[this.UndoBlockName];
if (block != null)
{
block.Subscribe(this.Subscriber.AsISubscriber());
}
}
The Null reference is caused by this.UndoService returning null;
SubscribeToUndoblock is called by private void CheckDirtyListChanged(object sender, EventArgs e) which is attached to the Application.Idle event here in DirtyObjectCatcher.
private void Subscriber_Receive(object sender, EventArgs e)
{
Application.Idle += new EventHandler(this.CheckDirtyListChanged);
}
Is there any chance of a fix to this problem?
A suggested work around?
The source to DroopyEyes.EcoExtensions.WinForm.dll?
This is a showstopper for me and my client!!
Regards AndyB
Can you provide a test case + instructions on how to reproduce? If so I will fix it.
====
Pete
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2011-12-12 23:38:00
Posts: 37,
Visits: 168
|
|
Hi Pete,
Thank you very much for your response. Really appreciated.
I would love to be able to demonstrate this problem in a test case but it seems pretty obscure and the budget for this project is already spent!!
Tracing the problem indicates that the Application.Idle event is raised after the call to DirtyObjectCatcher.Dispose and the DirtyObjectCatcher instance CheckDirtyListChanged method is still subscribed to this event.
This would explain why the DirtyObjectCatcher.ServiceProvider reference is null.
I may be doing something dumb elsewhere to cause the problem but if you add:
Application.Idle -= new EventHandler(this.CheckDirtyListChanged)
to the DirtyObjectCatcher.Dispose() the problem may just go away.
I am in New Zealand and 12 hours out of synch with your time zone so may take time to respond.
Once again - thanks for the help.
Best regards
Andy
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-07-14 17:05:00
Posts: 290,
Visits: 2 617
|
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: Today @ 14:58:14
Posts: 16,
Visits: 2 746
|
|
Hi Pete,
Send me this update too;
Thanks
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-07-14 17:05:00
Posts: 290,
Visits: 2 617
|
|
http://pastebin.com/sRPGpAUF
:-)
====
Pete
|
|
|
|