Beispiel #1
0
        public void SaveCurrentContent(bool?isDirect)
        {
            if (isDirect == null)
            {
                isDirect = directSave.IsChecked.GetValueOrDefault();
            }

            var ui = new SaveUI()
            {
                Owner = Application.Current.MainWindow, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            if ((bool)isDirect)
            {
                if (ui.SaveDirect())
                {
                    return;
                }
            }
            ui.ShowDialog();
        }
Beispiel #2
0
        private void Dirtree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            if (dirtree.SelectedItem == null)
            {
                filelst.ItemsSource = null;
                return;
            }

            var dm = (DirModel)dirtree.SelectedItem;

            filelst.ItemsSource = System.IO.Directory.EnumerateFiles(dm.Path, "*.htm?").Select(f =>
            {
                var fm = new FileModel()
                {
                    FILE = System.IO.Path.GetFileName(f),
                    PATH = f
                };
                fm.NAME = SaveUI.DecodeFileName(System.IO.Path.GetFileNameWithoutExtension(f), out fm.ORDER);
                return(fm);
            }).OrderBy(f => f.ORDER).ToList();
        }