M
Mike
I ran into a problem with circular dependencies. My code
looks somthing like:
using B
namespace A
{
class formA
{
void foo()
{
formB B = new formB();
B.show();
}
void changeMenu()
{
...
}
}
}
--------------------------------------------------------
//using A // this would create a circular dependency
namespace B
{
class formB
{
formA A;
void formB()
{
A = (formA)this.parentForm;
A.changeMenu(); //formA is the parent MDI
//form and I want to change
//the menu of formA when
//formB gets displayed inside
//it.
}
}
}
The way it's written, the .cs file that contains
namespace B won't compile because there is no reference
to namespace A. But I can't add a reference because it
would create a circular dependency. Is there anything I
can do without putting these into the same project? Does
C# have something similar to forward references in C++?
This has been driving crazy so any suggestions would be
most geatly appreciated. Thank you for your reply.
Mike
looks somthing like:
using B
namespace A
{
class formA
{
void foo()
{
formB B = new formB();
B.show();
}
void changeMenu()
{
...
}
}
}
--------------------------------------------------------
//using A // this would create a circular dependency
namespace B
{
class formB
{
formA A;
void formB()
{
A = (formA)this.parentForm;
A.changeMenu(); //formA is the parent MDI
//form and I want to change
//the menu of formA when
//formB gets displayed inside
//it.
}
}
}
The way it's written, the .cs file that contains
namespace B won't compile because there is no reference
to namespace A. But I can't add a reference because it
would create a circular dependency. Is there anything I
can do without putting these into the same project? Does
C# have something similar to forward references in C++?
This has been driving crazy so any suggestions would be
most geatly appreciated. Thank you for your reply.
Mike