Creating embedded classes .NET components

E

Edward Diener

I am creating a component and I want one of my properties to be an embedded
class with its own properties. When the component designer shows this
property I want it to be able to expand this property in-line to enable the
end-user to set its values. While my component is derived from
System::ComponentModel::Component, my embedded class has to be derived from
something else in order for it to be shown as an embedded class but be
serializable and marshallable at the same time. What is this something else
? Does my embedded class need to be of a value type to be embedded in this
way or does it just need to be derived from a different .NET framework base
class ?

As an example in C++ Builder, if I derived my component from TComponent, it
was treated as a component. If I derived my class from TPersistent, it was
treated as an embeddable class. What is the .NET equivalent to the latter ?
 
J

Jan Tielens

http://msdn.microsoft.com/library/en-us/dndotnet/html/vsnetpropbrow.asp
Make Your Components Really RAD with Visual Studio .NET Property Browser
Summary: This article will help you explore the Microsoft Visual Studio .NET
property browser and take advantage of its new features. (23 printed pages)

Check out this section:
Expandable Properties and String Conversion: TypeConverters and the Property
Browser
One of the great features of the Visual Studio .NET property browser is the
ability to display nested properties, allowing for a more granular and
logical level of grouping than categories. Nested properties are also
available in both categorized and alphabetical sort mode. It helps keep
property lists compact-instead of both a Left and Top property, just a
Location property that is expandable into X and Y will do for a separate
entry.
--
Greetz


Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
E

Edward Diener

Jan said:
http://msdn.microsoft.com/library/en-us/dndotnet/html/vsnetpropbrow.asp
Make Your Components Really RAD with Visual Studio .NET Property
Browser Summary: This article will help you explore the Microsoft
Visual Studio .NET property browser and take advantage of its new
features. (23 printed pages)

Thanks for the link. I see I have the article on my own local copy of MSDN
and I will take a look at it. If I still can't find answers in the article,
I will continue this thread or repost.
 
E

Edward Diener

Jan said:
http://msdn.microsoft.com/library/en-us/dndotnet/html/vsnetpropbrow.asp
Make Your Components Really RAD with Visual Studio .NET Property
Browser Summary: This article will help you explore the Microsoft
Visual Studio .NET property browser and take advantage of its new
features. (23 printed pages)

That doesn't really answer my question. Let's see if I can put it another
way.

Let's call my main component, with properties, X.
I want to create two different types of properties:

1) This property called Y is a reference to another component Z. The
property gets set at component design time by the end-user dropping the
component Z into the component editor, setting Z's properties, then setting
Y to be the Z.

2) This property called A is an actual sub-component of X. The property gets
set at component design time by the end-user expand the sub-component and
setting its property values.

Does property A have to be a value type ( struct in C#, __value class in
MC++ ) in order to be a sub-component ? If not, how do I distinguish between
the case where my property is a reference to another component or a
sub-component itself ?

I hope this is clear.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top