By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 2,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Using a namespace between 2 partial classes

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 9, 11:50 am, Peted wrote:
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
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
Jun 27 '08 #2

P: n/a
On Fri, 09 May 2008 03:50:00 -0700, <Petedwrote:
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
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
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.