public void LoadFromList(IPriorityList source)
 {
     Collection.Clear();
     foreach (Priority priority in source.GetPriorities())
     {
         //keys.Add(priority);
         foreach (object item in source.GetItems(priority))
         {
             Collection.Add(new PriorityElement(StringConv, priority, item));
         }
     }
 }
예제 #2
0
        public void LoadFromList(Type type, IPriorityList source)
        {
            Collection = (IPriorityList)Activator.CreateInstance(type);
            keys       = new List <Priority>();
            foreach (Priority priority in source.GetPriorities())
            {
                keys.Add(priority);
                foreach (object item in source.GetItems(priority))
                {
                    Collection.Add(priority, item);
                }
            }

            keys.Sort();
            for (int ii = 0; ii < keys.Count; ii++)
            {
                Priority priority = keys[ii];
                foreach (object item in Collection.GetItems(priority))
                {
                    lbxCollection.Items.Add(getEntryString(priority, item));
                }
            }
        }