Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Some problems with 2.5 version copy operations (Read 2377 times)
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Some problems with 2.5 version copy operations
Mar 4th, 2011 at 1:07pm
Print Post  
Hello, Stoyo. I tried to use CopyToClipboard call and after that I set the breakpoint in the public virtual DiagramItem Clone(bool clipboard) call in the DiagramItem class into your source code. And I see that the following returns null
Code
Select All
ConstructorInfo constructor =




GetType().GetConstructor(new[] { GetType() }); 


My class has th default constructor
Code
Select All
public class TechnologicalOperation: TPDENode, IComparable
{
        public TechnologicalOperation(): base()
        {
            Type = NodeType.SimpleProcess;
            HandlesStyle = HandlesStyle.Custom;
        }
}
 


Where is the problem?
  
Back to top
 
IP Logged
 
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Re: Some problems with 2.5 version copy operations
Reply #1 - Mar 4th, 2011 at 1:08pm
Print Post  
The TPDENode class also has the default constructor
Code
Select All
    public class TPDENode: ShapeNode
    {
	  public TPDENode(): base()
	  {
		CustomDraw = CustomDraw.Additional2;
		InputNumber = 0;
		OutputNumber = 0;
		Type = NodeType.Bus;
		m_ShadowProps.ShadowDepth = 5;
		HandlesStyle = HandlesStyle.Custom;
	  }
 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Some problems with 2.5 version copy operations
Reply #2 - Mar 4th, 2011 at 1:14pm
Print Post  
Hi,

That code tries to get a copy constructor. You can either override the Clone method, or add copy constructors to your classes:

public TechnologicalOperation(TechnologicalOperation prototype) {...}
public TPDENode(TPDENode prototype) {...}

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Re: Some problems with 2.5 version copy operations
Reply #3 - Mar 4th, 2011 at 1:31pm
Print Post  
Thanks. Clone methods had been overriden but some classes doesn't have the copy constructor
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint