示例#1
0
        private void Quit_Click(object sender, RoutedEventArgs e)
        {
            var res = MessageBox.Show("Save edited or created snippets?", "Save before quiting?", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (res == MessageBoxResult.Yes)
            {
                ToggleWindow();
                SnippWriter.SaveAllSnippets(_windows.Select((x) => (x.DataContext as DraggableViewModel)).ToList());
            }
            foreach (var i in Enumerable.Range(0, _windows.Count))
            {
                var win = _windows[i];
                win.Close();
            }

            foreach (var i in Enumerable.Range(0, _searchResult.Count))
            {
                var win = _searchResult[i];
                win.Close();
            }

            this.Close();
        }
示例#2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     ToggleWindow();
     SnippWriter.SaveAllSnippets(_windows.Select((x) => (x.DataContext as DraggableViewModel)).ToList());
 }