Re: Once again - Object of type x...
Peter Osucha <[email protected]> Tue, 19 Dec 2006 15:19:32 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
OK. I have made many changes as you suggested, Chris, and have not, in the
end, seen any real difference with the way the projects in the IDE work.
Let me ask an additional piece of information...
The 'base' user control in this nested control project is called
'BaseGraph'. It has a property GraphConfig of type GraphConfiguration -
this is the type I have been seeing that error/warning message about
'conversion'.
A second user control (SpGraph) in the project has a 'BaseGraph' sited on it
(and is, I believe, the source of the error/warning). If I look through the
IDE generated form code for the SpGraph control, there is a line...
private void InitializeComponent ( )
{
...
//
// baseGraph1
//
...
this.baseGraph1.GraphConfiguration = ( (
ETI.GraphSupport.GraphConfiguration )( resources.GetObject (
"baseGraph1.GraphConfiguration" ) ) );
...
}
I am wondering why the IDE generates this line (which seems to be a cast to
ETI.GraphSupport.GraphConfiguration from the 'resources' GetObject() method.
The BaseGraph and the SpGraph objects both use the exact same
GraphConfiguration object (and even instance - hmmm, I guess I could inherit
from BaseGraph, eh?). I mean, why the conversion?
Sincerely,
Peter
> -----Original Message-----
> From: Discussion relating to the specifics of the C# and
> Managed C++ languages [mailto:[email protected]]
> On Behalf Of Peter Osucha
> Sent: Monday, December 18, 2006 4:31 PM
> To: [email protected]
> Subject: Re: [DOTNET-CX] Once again - Object of type x...
>
> Thank you Chris. I'll get all these changes made and repost soon...
>
> Peter
>
> > -----Original Message-----
> > From: Discussion relating to the specifics of the C# and
> Managed C++
> > languages [mailto:[email protected]]
> > On Behalf Of Chris Anderson
> > Sent: Monday, December 18, 2006 4:30 PM
> > To: [email protected]
> > Subject: Re: [DOTNET-CX] Once again - Object of type x...
> >
> > Only if they need to be used at design-time. Otherwise simply stop
> > using them at design-time based on the this.DesignMode checks.
> >
> > > -----Original Message-----
> > > From: Discussion relating to the specifics of the C# and
> > Managed C++
> > > languages [mailto:[email protected]] On
> Behalf Of Peter
> > > Osucha
> > > Sent: 18 December 2006 21:16
> > > To: [email protected]
> > > Subject: Re: [DOTNET-CX] Once again - Object of type x...
> > >
> > > OK. So the 'nested' user controls - although the concept
> > still seems
> > a
> > > bit
> > > strange - is not necessarily a bad idea. However, the
> > classes those
> > > controls use ought to be split out to a separate project.
> > >
> > > Peter
> > >
> > > > -----Original Message-----
> > > > From: Discussion relating to the specifics of the C# and
> > Managed C++
> > > > languages [mailto:[email protected]]
> > > > On Behalf Of Chris Anderson
> > > > Sent: Monday, December 18, 2006 3:36 PM
> > > > To: [email protected]
> > > > Subject: Re: [DOTNET-CX] Once again - Object of type x...
> > > >
> > > > > > This is the generally recommended approach.
> > > > > > If you get into a habit of checking this.DesignMode it
> > > > stops a lot
> > > > > > of unexpected problems (and helps to stop the IDE feeling
> > > > sluggish
> > > > > > as it runs runtime code (possibly trying to access
> > > > databases, etc!))
> > > > >
> > > > > How will this (or better yet, will it at all) help the
> > > > situation where
> > > > > the project has 'nested' controls?
> > > >
> > > > The "in-design" usercontrols and their nested controls
> > will not be
> > > > communicating with each other (at least they will not
> be passing
> > > > user classes between each other) because that code will
> be hidden
> > > > behind a check for DesignMode and will therefore not be
> executed.
> > > >
> > > > Chris
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com