Exemplo n.º 1
0
 private void RemoveExisting(SortOrderListElement element)
 {
     for (int i = 0; i < Items.Count; ++i)
     {
         if (Items[i].Key.Equals(element.Key))
         {
             Items.RemoveAt(i);
             i--;
         }
     }
 }
Exemplo n.º 2
0
        private string SafeGetString(int n)
        {
            if (n < Items.Count)
            {
                SortOrderListElement item = Items[n];

                string header = (item.Direction == ListSortDirection.Ascending) ? "1" : "0";
                return(header + item.Key);
            }
            return("");
        }
Exemplo n.º 3
0
 private void RemoveExisting(SortOrderListElement element)
 {
     for (int i = 0; i < Items.Count; ++i)
     {
         if (Items[i].Key.Equals(element.Key))
         {
             Items.RemoveAt(i);
             i--;
         }
     }
 }
Exemplo n.º 4
0
 public void Push(string key, ListSortDirection direction)
 {
     SortOrderListElement item = new SortOrderListElement(key, direction);
     RemoveExisting(item);
     Items.Insert(0, item);
     while( Items.Count > 5 )
     {
         Items.RemoveAt(Items.Count - 1);
     }
     SaveToSettings();
 }
Exemplo n.º 5
0
        public void Push(string key, ListSortDirection direction)
        {
            SortOrderListElement item = new SortOrderListElement(key, direction);

            RemoveExisting(item);
            Items.Insert(0, item);
            while (Items.Count > 5)
            {
                Items.RemoveAt(Items.Count - 1);
            }
            SaveToSettings();
        }
Exemplo n.º 6
0
 private void AddUnique(SortOrderListElement element)
 {
     RemoveExisting(element);
     Items.Add(element);
 }
Exemplo n.º 7
0
 private void AddUnique(SortOrderListElement element)
 {
     RemoveExisting(element);
     Items.Add(element);
 }