示例#1
0
 /// <summary>
 /// 添加一个存储单元
 /// </summary>
 /// <param name="item"></param>
 public void Add(DataUnit item) {
     item.Parent = gParent;
     gnIndex++;
     item.Index = gnIndex;
     gParent.Root.Regedit(item);
     gItems.Add(item);
 }
示例#2
0
 /// <summary>
 /// 获取存储单元
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public DataUnit this[string name] {
     get {
         for (int i = 0; i < gItems.Count; i++) {
             if (gItems[i].Name == name) return gItems[i];
         }
         DataUnit du = new DataUnit(name);
         this.Add(du);
         return du;
     }
 }
示例#3
0
 /// <summary>
 /// 申请单元注册,获得一个唯一识标符
 /// </summary>
 /// <param name="du"></param>
 internal void Regedit(DataUnit du) {
     glngID++;
     du.ID = glngID;
 }