Could you please decorate it with design time attributes?

Discussion in 'ASP .Net' started by Umut Tezduyar, Nov 22, 2005.

  1. I really hate working with .net framework design time attributes. I have
    read asp.net server controls and components (Nikhil Kothari, Vandana Datye)
    book, chapter 15 but still i can't handle the complex tasks on designer. The
    thing i want to do is so simple (I hope so). I want my control to understand
    the Menu and SubMenus under Menu. Ex:

    <cc1:MyConrol runat="server" id="MyControl1">
    <Menu name="level1">
    <SubMenus>
    <Menu name="level2">
    <SubMenus>
    <Menu name="level3"/>
    </SubMenus>
    </Menu>
    <Menu name="level4"/>
    </SubMenus>
    </Menu>
    </cc1:MyControl>

    It should parse child controls and also by using the property browser, i
    should add 'Menu' and 'SubMenus' to my control. Should i use
    'ExpandableObjectConverter' for my MyControl control?

    Could you please fully decorate this control and Menu to give a full design
    time support?

    Here is the code:

    [ToolboxData("<{0}:MyControl runat=server></{0}:MyControl>")]
    public class MyControl : System.Web.UI.Control
    {
    private Menu _menu;

    // This is not the only propery. Not DefaultInnerPropery
    public Menu Menu
    {
    get
    {
    return this._menu;
    }
    set
    {
    this._menu = value;
    }
    }
    }

    // This is not a control
    public class Menu
    {
    private string _name;

    // Menu collection is a collection only holds Menu in it.
    private MenuCollection _subMenus;

    public Menu()
    {

    }

    public string Name
    {
    get
    {
    return this._name;
    }
    set
    {
    this._name = value;
    }
    }

    public MenuCollection SubMenus
    {
    get
    {
    return this._subMenus;
    }
    set
    {
    this._subMenus = value;
    }
    }

    }

    Thank you for spending time on it.
    Umut Tezduyar, Nov 22, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger Varley

    Extend or Decorate?

    Roger Varley, Jan 18, 2006, in forum: Java
    Replies:
    3
    Views:
    661
    Michael Redlich
    Jan 18, 2006
  2. Thomas Philips
    Replies:
    2
    Views:
    336
    Paul McGuire
    Jun 23, 2004
  3. Tom Anderson
    Replies:
    1
    Views:
    446
    Benji York
    Aug 3, 2005
  4. Replies:
    10
    Views:
    621
    Xah Lee
    Sep 8, 2006
  5. Replies:
    18
    Views:
    517
    Xah Lee
    Sep 8, 2006
Loading...

Share This Page