private void CategoryButtonClicked(object sender, RoutedEventArgs e) { Button button = sender as Button; Category actionableCategory = button.CommandParameter as Category; CategoryList catList = actionableCategory.ParentCategoryList; switch (button.Content as String) { case "5": catList.MoveCategory(actionableCategory, -1); break; case "6": catList.MoveCategory(actionableCategory, 1); break; case "r": //Don't allow removal of special category if (actionableCategory.Type > 0) { return; } Category uncategorized = catList.GetSpecialCategory(AppCategoryType.Uncategorized); for (int i = actionableCategory.Count - 1; i >= 0; i--) { ApplicationInfo app = actionableCategory[i]; actionableCategory.RemoveAt(i); uncategorized.Add(app); } catList.Remove(actionableCategory); break; } }
private void CategoryButtonClicked(object sender, RoutedEventArgs e) { Button button = sender as Button; Category actionableCategory = button.CommandParameter as Category; CategoryList catList = actionableCategory.ParentCategoryList; switch (button.Content as string) { case "5": catList.MoveCategory(actionableCategory, -1); break; case "6": catList.MoveCategory(actionableCategory, 1); break; case "r": catList.Remove(actionableCategory); break; } }
private void CategoryButtonClicked(object sender, RoutedEventArgs e) { Button button = sender as Button; Category actionableCategory = button.CommandParameter as Category; CategoryList catList = actionableCategory.ParentCategoryList; switch (button.Content as String) { case "<": catList.MoveCategory(actionableCategory, -1); break; case ">": catList.MoveCategory(actionableCategory, 1); break; case "X": //Don't allow removal of uncategorized or quick launch if (actionableCategory.Name == "Quick Launch") { return; } if (actionableCategory.Name == "Uncategorized") { return; } Category uncategorized = catList.GetCategory("Uncategorized"); for (int i = actionableCategory.Count - 1; i >= 0; i--) { ApplicationInfo app = actionableCategory[i]; actionableCategory.RemoveAt(i); uncategorized.Add(app); } catList.Remove(actionableCategory); break; } }