예제 #1
0
        private void EditDirectory()
        {
            var input = new GoToUserInput(Parent.Header, Parent.DirectoryPath);

            if ((bool)input.ShowDialog())
            {
                Parent.Header        = input.Name;
                Parent.DirectoryPath = input.Directory;
                Properties.Settings.Default.CustomGoTos = JsonConvert.SerializeObject(MenuItems.customGoTos.Skip(2), Formatting.None);
                Properties.Settings.Default.Save();
            }
        }
예제 #2
0
        public static void AddCustomGoTo(string name, string dir)
        {
            var input = new GoToUserInput(name, dir);

            if ((bool)input.ShowDialog())
            {
                var newDir = new GotoMenuItemViewModel
                {
                    Header        = input.Name,
                    DirectoryPath = input.Directory
                };
                newDir.Childrens = new ObservableCollection <GotoMenuItemViewModel>
                {
                    new GotoMenuItemViewModel
                    {
                        Header = Properties.Resources.GoTo,
                        Icon   = new Image {
                            Source = new BitmapImage(new Uri("/FModel;component/Resources/share.png", UriKind.Relative))
                        },
                        Parent = newDir
                    },
                    new GotoMenuItemViewModel
                    {
                        Header = Properties.Resources.EditDirectory,
                        Icon   = new Image {
                            Source = new BitmapImage(new Uri("/FModel;component/Resources/pencil.png", UriKind.Relative))
                        },
                        Parent = newDir
                    },
                    new GotoMenuItemViewModel
                    {
                        Header = Properties.Resources.RemoveDirectory,
                        Icon   = new Image {
                            Source = new BitmapImage(new Uri("/FModel;component/Resources/delete-forever.png", UriKind.Relative))
                        },
                        StaysOpenOnClick = true,
                        Parent           = newDir
                    }
                };

                customGoTos.Add(newDir);
                Properties.Settings.Default.CustomGoTos = JsonConvert.SerializeObject(customGoTos.Skip(2), Formatting.None);
                Properties.Settings.Default.Save();
            }
        }