예제 #1
0
 public T this[int i]
 {
     get { return(list[i].Value); }
     set
     {
         if (list[i] != null)
         {
             list[i].Value = value;
         }
         else
         {
             list[i] = new PropertyListItem <T>(value);
             BroadcastChange();
         }
     }
 }
예제 #2
0
        public void Add(T item)
        {
            PropertyListItem <T> listItem;

            if (pool.Count > 0)
            {
                listItem       = pool.Dequeue();
                listItem.Value = item;
            }
            else
            {
                listItem = new PropertyListItem <T>(item);
            }
            listItem.Changed += OnItemChanged;
            list.Add(listItem);

            BroadcastChange();
        }