Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / April 2004

Tip: Looking for answers? Try searching our database.

Is it possible to reach a property within another property's UIType Editor?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
?zden Irmak - 07 Apr 2004 12:19 GMT
Hello,

I'm developing a windows forms component deriving from
System.Windows.Forms.Control.

I've 4 complex properties which actually are classes and each also does a
part of drawing the control and each of them have also their custom
UITypeEditors.

What I want to achieve is that when one property shows it's cstom property
page, it has to take some variables/ call functions from other 3 properties
and show the combined result in that property page.

I couldn't find a way to reach the other properties when I show the custom
UITypeEditor of one of my properties. Is it possible or am I dreaming
something that is impossible? :o)

Thanks,

?zden
Chris Ellis - 07 Apr 2004 16:04 GMT
Hi ?zden,

   This may just amount to a hack and hopefully someone else will reply
with a better solution, but if the child classes (the ones used for the
properties) will be unique to the object to which they belong (meaning that
you're not using the same child/property object for several parent objects),
then you could probably solve this by exposing a parent pointer to the
parent object from within each of the child objects as properties
("Parent"), as components do.  Now, I don't know much about using
UITypeEditors.  That's one of my next goals is to learn how to do one, so
please forgive me if I'm totally wrong here.  But if you have access to the
particular child object (the property) from the UITypeEditor, then you
should have access to the newly exposed Parent property, which would give
you access to the parent object, which exposes the other three child objects
as properties of itself.  That should work, no?  Like I said, that might be
a bit of a hack.  Hopefully if it is, someone who knows what they're doing
will correct me.

Hope that helps,
Chris

> Hello,
>
[quoted text clipped - 16 lines]
>
> ?zden
?zden Irmak - 07 Apr 2004 17:41 GMT
Hi Chris,

This seems to be ok at first sight but as the control itself derives from
System.Windows.Forms.Control, I get error indicating that it is not marked
as serializable...

Thanks for taking time anyway...:)

?zden

> Hi ?zden,
>
[quoted text clipped - 38 lines]
> >
> > ?zden
?zden Irmak - 07 Apr 2004 17:53 GMT
Chris,

Ignore my last post...
[NonSerialized()]public GenericLabel Parent;

Could solve with this...

Thank you very very much...

?zden

> Hi Chris,
>
[quoted text clipped - 56 lines]
> > >
> > > ?zden
DRaiko - 08 Apr 2004 17:20 GMT
Hallo,

maybe i am missing the point, but why is it not possible simply to get
the current values of all needed properties from the "value" parameter
of EditValue?

public override object EditValue( ..., object value){
  YourCtl ctl = (YourCtl)value;
  int neededValue1 = ctl.AnObjectProp2.ItsProp;
  ...
 
}

HTH,
Dima.

"Özden Irmak" <ozdenirmak@isnet.net.tr> wrote in message news:<uNfhvIJHEHA.2876@TK2MSFTNGP09.phx.gbl>...
> Hello,
>
[quoted text clipped - 16 lines]
>
> Özden

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.