Skip to content

Instantly share code, notes, and snippets.

@hatelove
Created May 28, 2012 13:20
Show Gist options
  • Save hatelove/2819125 to your computer and use it in GitHub Desktop.
Save hatelove/2819125 to your computer and use it in GitHub Desktop.
internal class Program
{
private static void Main(string[] args)
{
IList<CellPhone> o = new CellPhones();
o.Add(new CellPhone());
Console.WriteLine("item count:{0}", o.Count.ToString());
}
}
[Serializable]
public class CellPhone
{
public string CountryCode { get; set; }
public string Phone { get; set; }
private string _FullCellPhone;
public string FullCellPhone
{
get
{
_FullCellPhone = CountryCode + Phone;
return _FullCellPhone;
}
}
}
[Serializable]
public class CellPhones : List<CellPhone>, IList<CellPhone>
{
public new void Add(CellPhone item)
{
Console.WriteLine("test");
base.Add(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment