Collection Editor woes...

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; }
}
}
 
T

timnels

This _seems_ to have something to do with rebuilding the entire
solution that contains the application and the control. I don't even
have to change a line of code and once I rebuild it blows out that
form. Could it be something with versioning on the control and it
doesn't know how to regenerate the control from the resource file?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top