コード例 #1
0
 public void DirectoryChanged(DirectoryViewModel parameter)
 {
     if (parameter.IsSelected)
     {
         SelectedDirectory = parameter;
     }
 }
コード例 #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();
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #5
0
ファイル: MainViewModel.cs プロジェクト: isti37/gta-toolkit
        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();
            }
        }
コード例 #6
0
ファイル: MainViewModel.cs プロジェクト: isti37/gta-toolkit
 public void DirectoryChanged(DirectoryViewModel parameter)
 {
     if (parameter.IsSelected)
     {
         SelectedDirectory = parameter;
     }
 }