c# - Problem with declaring List<myClass> property in VS2010 -
hi created 2 usercontrol (the line & station) , use station in line usercontrol , use "line" usercontrol in forms.
there no problem @ design time, whem want add "line" usercontrol form. in case, visual studio stop working , closed.
i comment changes in code , find problem property number of stations in line. whem comment every thing go ok need property. code
[serializable] public class actionpoint { public string carinfo; public string rightstationname; public string rightstationinfo; public string leftstationname; public string leftstationinfo; public actionpoint() { } }
and use class in property. use property define stations in line.
public class line : usercontrol { public list<actionpoint> stations { { return stations; } set { stations = value; } } }
i think problem property, not list, try this.
list<actionpoint> _stations; public list<actionpoint> stations { { return _stations; } set { _stations = value; } }
or
public list<actionpoint> stations { get; set; }
Comments
Post a Comment