NLineShape Does not appear


Author
Message
Montford Chelliah
Montford Chelliah
Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)
Group: Forum Members
Posts: 12, Visits: 1

Hi,

I am doing a workflow application (something similar windows workflow) using Nevron diagram. This workflow, I am planning to add few custom controls that can be dragged and dropped into designer surface.

I have created a sample application (attached with this mail), that contains "IfElseActivity" and "RootActivity" custom controls. I am adding "RootActivity" control at the load event of the form and "IfElseActivity" user can drag and drop on to the surface.

Either case I am facing a problem with the NLineShape object. The NLineShape does not display on designer surface. Please advice me.

Thanks

Anslum

 


Attachments
NevronWorkflow.zip (110 views, 64.00 KB)
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

Let me explain you in more details: you will need a dummy drawing document to place the dragged shape in, in order to get the connectors working. You can easily do this by in the AdaptTableFormat of the data object adaptor:

 

protected virtual NDrawingDataObject AdaptTableFormat(string tableName)

{

      NDrawingDocument dummy = new NDrawingDocument();

      NShape shape = null;

      if (tableName == "1")

      {

            shape = new IfElseActivity(dummy);

      }

      else

      {

            shape = new NRectangleShape(0, 0, 50, 50);

      }

 

      NDrawingDataObject ddo = new NDrawingDataObject(dummy, new INDiagramElement[] { shape });

      return ddo;

}

 

Do not forget to add the shape to the document as soon as it is created (for example in the constructor):

 

public IfElseActivity()

{

}

 

public IfElseActivity(NDrawingDocument document)

{

      document.ActiveLayer.AddChild(this);

      CreateBranches();

}

 



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search