12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using System.Collections.Generic;
- using System.Collections;
- using System.Text;
- namespace SysBaseLibs
- {
- public class IdCollection : CollectionBase
- {
- // Methods
- public IdCollection()
- { }
- public int Add(INpId poObject)
- {
- return base.InnerList.Add(poObject);
- }
- public bool Contains(INpId poObject)
- {
- return (this.IndexOf(poObject) >= 0);
- }
- public bool Contains(string pcId)
- {
- return (this.IndexOf(pcId) >= 0);
- }
- public int IndexOf(INpId poObject)
- {
- return this.IndexOf(poObject.Id);
- }
- public int IndexOf(string pcId)
- {
- int num1 = -1;
- pcId = UtilStr.UAndT(pcId);
- for (int num2 = 0; num2 < base.InnerList.Count; num2++)
- {
- INpId id1 = (INpId)base.InnerList[num2];
- if (UtilStr.UAndT(id1.Id) == pcId)
- {
- return num2;
- }
- }
- return num1;
- }
- public void Remove(INpId poObject)
- {
- base.InnerList.Remove(poObject);
- }
- public void Remove(string pcId)
- {
- int num1 = this.IndexOf(pcId);
- if (num1 >= 0)
- {
- base.RemoveAt(num1);
- }
- }
- // Properties
- public INpId this[int piIndex]
- {
- get
- {
- if ((piIndex < base.InnerList.Count) && (piIndex >= 0))
- {
- return (INpId)base.InnerList[piIndex];
- }
- return null;
- }
- }
- public INpId this[string pcId]
- {
- get
- {
- int num1 = this.IndexOf(pcId);
- if (num1 >= 0)
- {
- return (INpId)base.InnerList[num1];
- }
- return null;
- }
- }
- }
- }
|