How can i add list in a generic class? Firstly My generic Class is that:
[Serializable] public class ScheduleSelectedItems { private string Frequency; List FrequencyDays = new List(); private string Time; private string StartTime; private string EndTime; private string StartDate; private string EndDate; private string Name; public ScheduleSelectedItems(string frequency,List frequencydays, string time, string starttime, string endtime, string startdate, string enddate, string name) { Frequency = frequency; FrequencyDays = frequencydays; Time = time; StartTime = starttime; EndTime = endtime; StartDate = startdate; EndDate = enddate; Name = name; } } [Serializable] public class ScheduleSelectedItemsList { public List Items; public ScheduleSelectedItemsList() { Items = new List(); } } and i want to add ScheduleSelectedItems into ScheduleSelectedItemsList in form1.cs Form1.cs codes is here : private void timer1_Tick(object sender, EventArgs e) { string saat = DateTime.Now.ToShortTimeString(); string bugun = DateTime.Today.ToShortDateString(); ScheduleMng smgr = new ScheduleMng(); ScheduleItemsList schlist = smgr.LoadXml(); List list = new List(); for (int i = 0; i = Convert.ToDateTime(schlist.Items[i].StartDate.ToString()) && Convert.ToDateTime(bugun)
slist.Items.Add(list); ----> i don't use theese codes . These error "included some invalid argument" how can you help me? :)