[CLOSED] Is it possible to make ItemsCollection.SingleItemMode setter public instead of internal

  1. #1

    [CLOSED] Is it possible to make ItemsCollection.SingleItemMode setter public instead of internal

    Hi,

    I'm trying to create a custom component which will contain additional components. I'd like other developers to use it either via markup or code behind. Looking at how you have done things like ensure just one item in a collection such as Menu (for a button) or some of your layout and other components, I'd also like to create a single item mode ItemsCollection for my own object.

    But the setter is internal:

    [Description("")]
    public bool SingleItemMode
    {
        get
        {
            return this.singleItemMode;
        }
        internal set
        {
            this.singleItemMode = value;
        }
    }
    Any chance to make it public, or have I missed a trick/better way to do it?

    Thanks!
    Last edited by Daniil; Jun 20, 2012 at 9:06 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Personally, I can't see any reason why we can't mark the property as public.

    I will discuss it with my colleagues and come back.
  3. #3
    Ext.Net container has protected property: SingleItemMode
    You have to override it and return 'true' from it
  4. #4
    Maybe I've misunderstood - I was looking at your PanelBase and Button classes as examples. Button for example has a Menu property which is a MenuCollection which does this in its constructor:

    public MenuCollection()
    {
    	this.SingleItemMode = true;
    }
    The SingleItemMode property being set to true there is this one inherited from ItemsMenuCollection which is defined like this:

    public bool SingleItemMode
    {
    	get
    	{
    		return this.singleItemMode;
    	}
    	internal set
    	{
    		this.singleItemMode = value;
    	}
    }

    As that has an internal setter, I cannot access it from my assembly so I cannot override it. I want to create a similar collection like MenuCollection above so that I can reuse it in one of my own additional components. In that case I believe I need to use the SingleItemMode in the same way MenuCollection is, right?
  5. #5
    I added additional constructor is accepted SingleItemMode argument
    By the way, you can use just generic list with own logic instead ItemsCollection
  6. #6
    Thanks Vladimir. Looks good. You can mark as closed.

    Yes, could use List<T> but I'd like to reuse your single item check so the handling is consistent for users of my own control ;)

Similar Threads

  1. [CLOSED] Make Ext.Net.ResourceManager.IsClientStyleIncludeRegist ered public
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 18, 2011, 1:30 AM
  2. Ext.Net Application for Public Administration
    By JoelAlejandro in forum Licensing
    Replies: 1
    Last Post: Jan 09, 2011, 1:16 PM
  3. [CLOSED] bug in ComboBoxBaseSingle.Value setter
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 20, 2010, 3:43 PM
  4. [CLOSED] Make AdditionalConfig public
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 13, 2009, 11:00 AM
  5. 0.8.0 Release to public?
    By Tbaseflug in forum 1.x Help
    Replies: 6
    Last Post: Mar 06, 2009, 9:30 AM

Posting Permissions