T
timnels
I have a control that is subclassing a label control and I want to a a
property that is a List of a custom class. The collection editor
_seems_ to work fine. I can add new items to the list and it saves
them. I can even run the application and everything works...then at
some point later (between other changes, rebuilds), the designer
errors on the form/user control where that control is placed.
Warning 2 Object of type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]' cannot be
converted to type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]'. C:
\Projects\Falcon\Applications\CashReceipts.designer.cs 1603 0
What is more bizzare is it appears it can't convert the type into the
same type as itself! No amount of rebuilds will fix this. I have to
remove this line from the designer code by hand:
this.menuLinkLabel2.MenuEvents =
((System.Collections.Generic.List<Lbm.Falcon.UI.MenuEvent>)
(resources.GetObject("menuLinkLabel2.MenuEvents")));
Code for the class is below... I just don't see the problem :-(
public class MenuLinkLabel : UltraLabel
{
public MenuLinkLabel()
: base()
{
_menuEvents = new
List<MenuEvent>();
}
private List<MenuEvent> _menuEvents;
public List<MenuEvent> MenuEvents
{
get { return _menuEvents; }
set { _menuEvents = value; }
}
}
[Serializable]
public class MenuEvent
{
private string _menuText;
public string MenuText
{
get { return _menuText; }
set { _menuText = value; }
}
private string _application;
public string Application
{
get { return _application; }
set { _application = value; }
}
private bool _defaultChoice;
public bool DefaultChoice
{
get { return _defaultChoice; }
set { _defaultChoice = value; }
}
private string _eventKey;
public string EventKey
{
get { return _eventKey; }
set { _eventKey = value; }
}
}
property that is a List of a custom class. The collection editor
_seems_ to work fine. I can add new items to the list and it saves
them. I can even run the application and everything works...then at
some point later (between other changes, rebuilds), the designer
errors on the form/user control where that control is placed.
Warning 2 Object of type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]' cannot be
converted to type
'System.Collections.Generic.List`1[Lbm.Falcon.UI.MenuEvent]'. C:
\Projects\Falcon\Applications\CashReceipts.designer.cs 1603 0
What is more bizzare is it appears it can't convert the type into the
same type as itself! No amount of rebuilds will fix this. I have to
remove this line from the designer code by hand:
this.menuLinkLabel2.MenuEvents =
((System.Collections.Generic.List<Lbm.Falcon.UI.MenuEvent>)
(resources.GetObject("menuLinkLabel2.MenuEvents")));
Code for the class is below... I just don't see the problem :-(
public class MenuLinkLabel : UltraLabel
{
public MenuLinkLabel()
: base()
{
_menuEvents = new
List<MenuEvent>();
}
private List<MenuEvent> _menuEvents;
public List<MenuEvent> MenuEvents
{
get { return _menuEvents; }
set { _menuEvents = value; }
}
}
[Serializable]
public class MenuEvent
{
private string _menuText;
public string MenuText
{
get { return _menuText; }
set { _menuText = value; }
}
private string _application;
public string Application
{
get { return _application; }
set { _application = value; }
}
private bool _defaultChoice;
public bool DefaultChoice
{
get { return _defaultChoice; }
set { _defaultChoice = value; }
}
private string _eventKey;
public string EventKey
{
get { return _eventKey; }
set { _eventKey = value; }
}
}