i am trying to add nodes to a node dynamically ... and assign its
proerties to a node objects stored inside the array.... when the
ShapeAdded event is fired... ...inside the if block... instruction
pointer does not go pass the other line...
Can anyone tell me what is the reason? and how to solve this
problem ?
here is the code:
private void shapeAddedToPageEventHandler(
Microsoft.Office.Interop.Visio.Shape addedShape) {
Master vsoMaster = addedShape.Master;
//Check whether the shape has a master. If not,
//the shape was created locally.
if (vsoMaster != null)
{
//Check whether the master is "Ellipse".
if (vsoMaster.Name == "Ellipse")
{
nodeArray = new Node[NodeLimit]; // instruction pointer
does not go pass the first line
nodeArray[NodeCount].Name = "Node" +
NodeCount.ToString();
nodeArray[NodeCount].Id = NodeCount.ToString();
addedShape.Name=(string)"Node" +
NodeCount.ToString(); // Ellipse01
addedShape.Text = (string)"Node" +
NodeCount.ToString();
MessageBox.Show(addedShape.Name.ToString());
NodeCount++;
}
Need help
Regards