コード例 #1
0
 private void btn_Remove_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int index = int.Parse(tB_RemoveAtIndex.Text);
         list.Remove(index);
         CUtilities.FillListView(lV_Items, list);
     }
     catch { MessageBox.Show("Revisa los datos."); }
 }
コード例 #2
0
        private void btn_AddLast_Click(object sender, RoutedEventArgs e)
        {
            // validar datos
            string item = tB_ItemToAdd.Text;

            if (string.IsNullOrEmpty(item))
            {
                return;
            }
            list.AddLast(item);
            CUtilities.FillListView(lV_Items, list);
        }
コード例 #3
0
 private void btn_RemoveLast_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         list.RemoveLast();
         CUtilities.FillListView(lV_Items, list);
     }
     catch
     {
         MessageBox.Show("Error.");
     }
 }
コード例 #4
0
 private void btn_AddPos_Click(object sender, RoutedEventArgs e)
 {
     // validar datos
     try
     {
         string item  = tB_ItemToAdd.Text;
         int    index = int.Parse(tB_AddAtIndex.Text);
         // realizar operacion
         list.Add(index, item);
         CUtilities.FillListView(lV_Items, list);
     }
     catch { MessageBox.Show("Revisa los datos."); }
 }
コード例 #5
0
 private void btn_Set_Click(object sender, RoutedEventArgs e)
 {
     // validar datos
     try
     {
         string item  = tB_ItemToAdd.Text;
         int    index = lV_Items.SelectedIndex;
         if (string.IsNullOrEmpty(item))
         {
             return;
         }
         list.Set(index, item);
         CUtilities.FillListView(lV_Items, list);
     }
     catch { MessageBox.Show("Revisa los datos."); }
 }
コード例 #6
0
        private void btn_AddBefore_Click(object sender, RoutedEventArgs e)
        {
            // validar datos
            string item  = tB_ItemToAdd.Text;
            int    index = lV_Items.SelectedIndex;

            if (string.IsNullOrEmpty(item))
            {
                return;
            }
            if (index < 0 || index > list.Size())
            {
                return;
            }
            Node <string> node = list.AtIndex(index);

            // realizar operacion
            list.AddBefore(node, item);
            CUtilities.FillListView(lV_Items, list);
        }