Пример #1
0
 public void ResetGenericList <T>(IEnumerable <T> list)
 {
     OnGenericList(() => {
         lock (GenericListLocker) {
             if (GenericList == null)
             {
                 SetGenericList(list);
             }
             else
             {
                 while (GenericList.Count > 0)
                 {
                     GenericList.RemoveAt(0);
                 }
                 list.ForEach(l => {
                     GenericList.AddNewItem(l);
                     GenericList.CommitNew();
                 });
                 //GenericList.MoveCurrentToPosition(selectedIndex);
             }
         }
     });
 }