Ejemplo n.º 1
0
        /**<summary>Saves the application settings.</summary>*/
        private void SaveSettings()
        {
            if (Config.Modified)
            {
                Config.SaveConfig();
            }

            Settings.Default.WindowWidth  = (int)Width;
            Settings.Default.WindowHeight = (int)Height;
            Settings.Default.CurrentTab   = currentTab.ToString();
            Settings.Default.Save();
        }
Ejemplo n.º 2
0
        private void OnRemove(object sender, RoutedEventArgs e)
        {
            TreeViewItem item = treeView.SelectedItem as TreeViewItem;

            TreeViewItem parent = item.Parent as TreeViewItem;

            if (item != null && parent != null)
            {
                string type = "Folder";
                if (item.Tag is Setup)
                {
                    type = setupType.ToString();
                }
                var result = TriggerMessageBox.Show(Window.GetWindow(this), MessageIcon.Question, "Are you sure you want to remove this " + type.ToLower() + "?", "Remove " + type, MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    TreeViewItem newSelection = FindMoveItem(item, -1);
                    if (newSelection == null)
                    {
                        newSelection = FindMoveItem(item, 1);
                    }
                    parent.Items.Remove(item);
                    UpdateButtons();

                    if (newSelection != null)
                    {
                        newSelection.IsSelected = true;
                        newSelection.Focus();
                    }
                    Modified = true;
                }
            }
        }