PDA

View Full Version : [CLOSED] Change property ComponentDirectEvents.Parent from internal to protected



Fredrik
Jun 01, 2012, 2:34 PM
I'm trying to create my own GridPanel with a custom DirectEvent by inheriting from Ext.Net.GridPanelBase and adding a custom GridPanelDirectEvent-property. To make the class more extendable in the future I'm using generics to set the type of the DirectEvents-property



public class MyGridPanel<T> : Ext.Net.GridPanelBase where T : TemplateGridPanelDirectEvents, new()
{
public T DirectEvents {get; set;}
}

public class TemplateGridPanelDirectEvents : GridPanelDirectEvents
{
...my new DirectEvent..
}


When you create a new instance of GridPanelDirectEvents the constructor expects observable Parent. Since I'm using generics I can only create my instance with a parameterless constructor. My idea was to set Parent after I created my instance but unfortunately the property have an internal set so I can't set it in my class. Would it be possible for you to change it from internal to protected?



public partial class ComponentDirectEvents : BaseItem
{
public virtual Observable Parent
{
get;
internal set; // <- can you please change this to protected?
}
...
}

Daniil
Jun 01, 2012, 4:52 PM
Hi,

Thanks for the suggestion.

Please update from SVN.

Fredrik
Jun 04, 2012, 6:49 AM
I'm afraid you changed the property in the wrong class.

I ment the Parent-property in: public partial class ComponentDirectEvents : BaseItem

declared the file /Ext.Net/Event/DirectEvents/Component.cs

Daniil
Jun 04, 2012, 10:45 AM
Please update again.

Fredrik
Jun 04, 2012, 12:47 PM
Thank you. Everything works fine now.