class Program
{
static void Main(string[] args)
{
mylist myitems1 = new mylist("Yusuf","Karatoprak");
SelectedItemsList slist = new SelectedItemsList();
slist.Items.Add(myitems1);
foreach( object o in slist.Items)
Console.Write(o.ToString()+"\n");
Console.ReadKey();
}
}
public class mylist
{
private string Ad;
private string SoyAd;
public mylist(string ad, string soyad)
{
Ad = ad;
SoyAd = soyad;
}
public override string ToString()
{
return "Ad:" + this.Ad;
}
}
public class SelectedItemsList
{
public List Items;
public SelectedItemsList()
{
Items = new List();
}
}
i want to return an arraylist or list form mylist class but how? return this.Ad, also retun this.SoayAd etch.
Please look ToString() procedure: it is return Ad but i want to return Ad also SoyAd together. Not only Ad ,but also Ad,SoyAd in a List.