Exemplo n.º 1
0
 public XmlCommandField Field(String Name, bool ignoreCase = true)
 {
     if (ignoreCase)
     {
         foreach (String name in _fields.Keys)
         {
             if (name.ToLower().Equals(Name.ToLower()))
             {
                 return(_fields[name]);
             }
         }
         return(null);
     }
     else
     {
         if (_fields.ContainsKey(Name))
         {
             return(_fields[Name]);
         }
         else
         {
             return(null);
         }
     }
 }
        internal void Add(wTreeNode node, bool occurEvent)
        {
            string name = node.Name;

            if (name == null)
            {
                name = GetNewName("node");
            }
            else if (_list.ContainsKey(name))
            {
                name = GetNewName(name);
            }
            _list.Add(name, node);

            whenAddNode(node);
            if (occurEvent)
            {
                if (E_TreeListChanged != null)
                {
                    E_TreeListChanged(_parent);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 다른 item들의 위치를 변경시키지 않고 그냥 지운다.
        /// </summary>
        /// <param name="index"></param>
        public void RemoveAt(int index, bool eventEnabled)
        {
            BitItem itemToRemoved = _items[index];

            if (_items.ContainsKey(index))
            {
                _items.Remove(index);
                if (_bitArea != null)
                {
                    for (int i = itemToRemoved.StartOffset; i < itemToRemoved.StartOffset + itemToRemoved.BitSize; i++)
                    {
                        _bitArea[i] = -1;
                    }
                }
            }
            else
            {
                throw new Exception("BitItemCollection.RemoveAt - no item in index[" + index + "]");
            }
            if (E_BitItemRemoved != null && eventEnabled)
            {
                E_BitItemRemoved(_parent, itemToRemoved);
            }
        }