CollectionBase实现强类型
1using System; 2using System.Collections; 3 4namespace Relaction.Collections 5{ 6 /**//// <summary> 7 /// MyStrongTypeCollection 的摘要说明。 8 /// </summary> 9 public class MyStrongTypeCollection:CollectionBase10 {11 public MyStrongTypeCollection()12 {13 }14 public void Insert(string s)15 {16 List.Add(s);17 }18 public void Remove(string s)19 {20 List.Remove(s);21 }22 public void Add(string s)23 {24 List.Add(s);25 }26 public bool Contains(string s)27 {28 return List.Contains(s);29 }30 public int IndexOf(string s)31 {32 return List.IndexOf(s);33 }34 }35}36
转载于:https://www.cnblogs.com/nanshouyong326/archive/2006/11/28/575071.html
转载请注明原文地址: https://win8.8miu.com/read-1482237.html