Creating embedded classes .NET components

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Edward Diener

    #1

    Creating embedded classes .NET components

    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::Compone ntModel::Compon ent, 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 ?


  • Jan Tielens

    #2
    Re: Creating embedded classes .NET components

    http://msdn.microsoft.com/library/en...etpropbrow.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


    "Edward Diener" <eddielee@tropi csoft.com> wrote in message
    news:eHQUmj10DH A.2872@TK2MSFTN GP09.phx.gbl...[color=blue]
    > I am creating a component and I want one of my properties to be an[/color]
    embedded[color=blue]
    > 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[/color]
    the[color=blue]
    > end-user to set its values. While my component is derived from
    > System::Compone ntModel::Compon ent, my embedded class has to be derived[/color]
    from[color=blue]
    > 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[/color]
    else[color=blue]
    > ? 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[/color]
    base[color=blue]
    > class ?
    >
    > As an example in C++ Builder, if I derived my component from TComponent,[/color]
    it[color=blue]
    > 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[/color]
    ?[color=blue]
    >
    >[/color]


    Comment

    • Edward Diener

      #3
      Re: Creating embedded classes .NET components

      Jan Tielens wrote:[color=blue]
      > http://msdn.microsoft.com/library/en...etpropbrow.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)[/color]

      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.
      [color=blue]
      >
      > 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.
      >
      > "Edward Diener" <eddielee@tropi csoft.com> wrote in message
      > news:eHQUmj10DH A.2872@TK2MSFTN GP09.phx.gbl...[color=green]
      >> 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::Compone ntModel::Compon ent, 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 ?[/color][/color]


      Comment

      • Edward Diener

        #4
        Re: Creating embedded classes .NET components

        Jan Tielens wrote:[color=blue]
        > http://msdn.microsoft.com/library/en...etpropbrow.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)[/color]

        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.
        [color=blue]
        >
        > "Edward Diener" <eddielee@tropi csoft.com> wrote in message
        > news:eHQUmj10DH A.2872@TK2MSFTN GP09.phx.gbl...[color=green]
        >> 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::Compone ntModel::Compon ent, 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 ?[/color][/color]


        Comment

        Working...