Namespace hell

  • Thread starter Thread starter Abbott Fleur
  • Start date Start date
A

Abbott Fleur

I have a user control class = guideway in namespace guideway.

The guideway control dynamically adds GuideNodeBox usercontrols to its .controls collection. At the same time it attaches 3 events from the GuideNodeBox to itself ...

private GuideNodeBox CreateGuideNodeBox(GuidewayNode newNode, eGuidewayNodeType gNodeType)

{

GuideNodeBox newNodeBox = new GuideNodeBox( newNode, gNodeType);

newNodeBox.GuideNodeBoxClick += new GuidewayEventHandler(GuideBoxClicked);

newNodeBox.GuideNodeBoxHover += new GuidewayEventHandler(GuideBoxHover);

newNodeBox.GuideNodeBoxRemove += new GuidewayEventHandler(GuideBoxRemove);

newNodeBox.Leave += new EventHandler(GuideBoxLeave);

return newNodeBox;

}



The 3 new GuidewayEventHandler lines give a compile error ...

Cannot implicitly convert type Guideway.Guideway.GuidewayEventHandler to Guideway,GuidewayEventHandler



Anyone have any suggestions ?



Thanks in advance - Abbott
 
Maqsood Ahmed said:
Hello,
You will need to use fully qualified name for the handler.

HTH. Cheers.
Maqsood Ahmed [MCP C#,SQL Server]
Kolachi Advanced Technologies
http://www.kolachi.net

It's strange. I had to qualify the the name as ...

newNodeBox.GuideNodeBoxClick += new
global::Guideway.GuidewayEventHandler(GuideBoxClicked);

There's got to be a better way!

Thanks for the feedback

Abbott

Abbott Fleur
 
Back
Top