Exemplo n.º 1
0
 public void DirectoryChanged(DirectoryViewModel parameter)
 {
     if (parameter.IsSelected)
     {
         SelectedDirectory = parameter;
     }
 }
Exemplo n.º 2
0
        public void Open_Clicked(object parameter)
        {
            var dlg = new OpenFileDialog();

            dlg.Title = "Select archive";
            if (dlg.ShowDialog() == true)
            {
                // open archive
                this.model.Load(dlg.FileName);

                var vm = new DirectoryViewModel(model.Archive.Root, null);

                directories_ = new List <IDirectoryViewModel>();
                directories_.Add(vm);

                NotifyPropertyChanged("Directories");

                var dirstack = new Stack <DirectoryViewModel>();
                dirstack.Push(vm);
                while (dirstack.Count > 0)
                {
                    var qq = dirstack.Pop();
                    qq.OnSelectionChanged = DirectoryChanged;

                    foreach (var xx in qq.Children)
                    {
                        dirstack.Push(xx);
                    }
                }

                vm.IsSelected = true;
                CommandManager.InvalidateRequerySuggested();
            }
        }
Exemplo n.º 3
0
        public DirectoryViewModel(IArchiveDirectory directory, DirectoryViewModel parent)
        {
            this.directory       = directory;
            this.parentDirectory = parent;

            childDirectories = new List <DirectoryViewModel>();
            foreach (var f in directory.GetDirectories())
            {
                var dd = new DirectoryViewModel(f, this);
                childDirectories.Add(dd);
            }
        }
Exemplo n.º 4
0
        public DirectoryViewModel(IArchiveDirectory directory, DirectoryViewModel parent)
        {
            this.directory = directory;
            this.parentDirectory = parent;

            childDirectories = new List<DirectoryViewModel>();
            foreach (var f in directory.GetDirectories())
            {
                var dd = new DirectoryViewModel(f, this);
                childDirectories.Add(dd);
            }
        }
Exemplo n.º 5
0
        public void Open_Clicked(object parameter)
        {
            var dlg = new OpenFileDialog();
            dlg.Title = "Select archive";
            if (dlg.ShowDialog() == true)
            {
                // open archive
                this.model.Load(dlg.FileName);

                var vm = new DirectoryViewModel(model.Archive.Root, null);

                directories_ = new List<IDirectoryViewModel>();
                directories_.Add(vm);

                NotifyPropertyChanged("Directories");

                var dirstack = new Stack<DirectoryViewModel>();
                dirstack.Push(vm);
                while (dirstack.Count > 0)
                {
                    var qq = dirstack.Pop();
                    qq.OnSelectionChanged = DirectoryChanged;

                    foreach (var xx in qq.Children)
                        dirstack.Push(xx);
                }

                vm.IsSelected = true;
                CommandManager.InvalidateRequerySuggested();
            }
        }
Exemplo n.º 6
0
 public void DirectoryChanged(DirectoryViewModel parameter)
 {
     if (parameter.IsSelected)
     {
         SelectedDirectory = parameter;
     }
 }