all groups > dotnet windows forms designtime > april 2004 >
You're in the

dotnet windows forms designtime

group:

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


Re: Is it possible to reach a property within another property's UIType Editor? Chris Ellis
4/7/2004 11:04:06 AM
dotnet windows forms designtime:
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

[quoted text, click to view]

Is it possible to reach a property within another property's UIType Editor? Özden Irmak
4/7/2004 2:19:16 PM
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

Re: Is it possible to reach a property within another property's UIType Editor? Özden Irmak
4/7/2004 7:41:07 PM
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

[quoted text, click to view]

Re: Is it possible to reach a property within another property's UIType Editor? Özden Irmak
4/7/2004 7:53:11 PM
Chris,

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

Could solve with this...

Thank you very very much...

Özden

[quoted text, click to view]

Re: Is it possible to reach a property within another property's UIType Editor? draiko NO[at]SPAM rhenus.de
4/8/2004 9:20:39 AM
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.

[quoted text, click to view]
AddThis Social Bookmark Button