Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Method Override problem with XmlPersistContext (Read 2802 times)
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Method Override problem with XmlPersistContext
Feb 23rd, 2009 at 8:36am
Print Post  
Dear All
I was working with FlowChart.Net for quite some time without any problem. Now I am stuck with a strange problem. I didnot find any option to attach files otherwise  I will attach a solution (vs 2008) with three projects inside. Explanation for the problem is below:

1) I made a class called "PurchasedComponent" in a project called "ThirdPartyComponent"

2) I made a class called "MyBaseClass" Inheriting from ShapeNode. I declared two methods in it which will be overrided in the sub classes. One of them is using ThirdPartyComponent.PurchasedComponent as a parameter.The class is placed in a project called "MyComponents"

Protected Overridable Sub SavePurchasedComponent(ByVal purComp As ThirdPartyComponent.PurchasedComponent)
Protected Overridable Sub SaveInteger(ByVal someInt As Integer)

3) I made one more class called "MyOwnSubClass" inheriting from "MyBaseClass". This means that MyOwnSubClass is grandchild of ShapeNode class. Both of these classes are placed in a project called "MyComponents". Now this class is going to override two methods of "MyBaseClass" as well as one method of "ShapeNode" class.
From ShapeNode
Protected Overrides Sub SaveToXml(ByVal xmlElement As System.Xml.XmlElement, ByVal context As MindFusion.Diagramming.XmlPersistContext)
From MyBaseClass
Protected Overrides Sub SavePurchasedComponent(ByVal purComp As ThirdPartyComponent.PurchasedComponent)
Protected Overrides Sub SaveInteger(ByVal someInt As Integer)

4) I made one more class called "OtherSubClass" inheriting from "MyComponents.MyOwnSubClass". Please notice that this class will be placed in a seperate project called "TestWin". A reference to MyComponents project has already been added. Now this class is going to override the same methods.

From ShapeNode
Protected Overrides Sub SaveToXml(ByVal xmlElement As System.Xml.XmlElement, ByVal context As MindFusion.Diagramming.XmlPersistContext)
From MyBaseClass
Protected Overrides Sub SavePurchasedComponent(ByVal purComp As ThirdPartyComponent.PurchasedComponent)
Protected Overrides Sub SaveInteger(ByVal someInt As Integer)

5) Compilation Failed. The two methods of MyBaseClass has been overriden successfully but not SaveToXml method of Shapenode class.  Check the image attached. If you try to override some other method e.g.
Public Overrides Function AcceptLinks(ByVal outgoing As Boolean) As Boolean
It will work just fine. After investigating I found out that the problem is with the parameter "ByVal context As MindFusion.Diagramming.XmlPersistContext".  You can override any method that does not have XmlPersistContext as a parameter.

6) You can declare a new overridable  method in MyBaseClass having XmlPersistContext as one of its parameter. Try to override in MyOwnSubClass (WHICH IS IN THE SAME PROJECT). It will work fine. Try to override it in "OtherSubClass" (WHICH IS IN ANOTHER PROJECT) and it will fail...

Can someone put some light?
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Method Override problem with XmlPersistContext
Reply #1 - Feb 23rd, 2009 at 9:05am
Print Post  
Hi,

Please email the solution to support@mindfusion.eu.

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: Method Override problem with XmlPersistContext
Reply #2 - Feb 23rd, 2009 at 9:08am
Print Post  
Already emailed to support with full solution.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: Method Override problem with XmlPersistContext
Reply #3 - Feb 23rd, 2009 at 10:31am
Print Post  
Let me know if you received the email with attachment or not.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Method Override problem with XmlPersistContext
Reply #4 - Feb 23rd, 2009 at 11:30am
Print Post  
Yes, we have received it.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Method Override problem with XmlPersistContext
Reply #5 - Feb 23rd, 2009 at 12:15pm
Print Post  
There is some problem with the references. We removed the MindFusion.* references from the MyComponents and TestWin projects, and added again references to the MindFusion.* assemblies that were in TestWin\Components\bin\Debug, and  now the solution is compiled without errors.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Aziz ur Rahman
YaBB Newbies
*
Offline



Posts: 43
Joined: Feb 23rd, 2009
Re: Method Override problem with XmlPersistContext
Reply #6 - Mar 2nd, 2009 at 12:06pm
Print Post  
First it worked .. second I don't know why.  Smiley ... Both the projects were referencing the copies of the same Dlls placed insided their bin folders.


Anyway thanks for such a quick help.
  

Syed Aziz ur Rahman
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint