Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using a namespace between 2 partial classes

1 view
Skip to first unread message

Peted

unread,
May 9, 2008, 6:50:00 AM5/9/08
to
im using c# vs2008

is it possible to define two partial classes in two different named
code modules in this case the class and its attched designer class,
and have a using statement at the top of the main class that allows
access to a 3rd class/control/dll etc etc

if i have the using statment at the top of the main class is it
possible to have that using statement used in a partial class there,
and have the using statment propogate through to the partial class in
the designer code that is auto generated, so that referenced objects
can also be called by code in the designer


thanks for any insight or help

Peted

Jon Skeet [C# MVP]

unread,
May 9, 2008, 7:01:15 AM5/9/08
to

I'm having a hard time understanding exactly what you mean (and what
relationship it has to the subject line). Could you give an example?

The designer-generated code shouldn't need any using directives - the
designer should understand and possibly fully-qualify all types it
uses.

Jon

Peter Duniho

unread,
May 9, 2008, 1:28:21 PM5/9/08
to

If I understand your question correctly, the answer is "no". The "using"
directive applies only to the code file being compiled.

If you can explain more specifically how it is you'd think the
Designer-generated code file would use your other assembly reference, it's
possible that someone could come up with a different idea for solving
whatever problem you're trying to address. For example, how is it that
you'd expect the Designer-generated code file to even be aware of this
other assembly? What action in the Designer would you take that would
cause the Designer-generated code to use the other assembly?

Pete

0 new messages