public void ChangeFileSystem(FileSystemBase fileSystem) { fileSystem1 = fileSystem.GetCopy(); fileSystem2 = fileSystem; fileSystem3 = fileSystem.GetCopy(); //set up binding for second column Binding bind2 = new Binding("Items");//bind to ListBox bind2.Source = FileSystem; lbContent2.SetBinding(ListBox.ItemsSourceProperty, bind2); //loading files into first column lbContent1.ItemsSource = null;//clear items if (!FileSystem.IsRootPath(FileSystem.CurrentPlace.FullName)) { fileSystem1.LoadDirectory(PathExt.GetDirectoryName(FileSystem.CurrentPlace.FullName, FileSystem.IsWindowsFileSystem)); lbContent1.ItemsSource = fileSystem1.Items; } //third column is loaded by selecting items in second //save in history HistoryGlobal.AddItem(FileSystem.CurrentPlace); history.AddItem(FileSystem.CurrentPlace, false); dirChanged = true; //SetFocusOnContent(); OnPropertyChanged("FileSystem"); }
public void LoadDir(string dir, bool saveInHistory) { FileSystem.LoadDirectory(dir); dirChanged = true; //save in history if (saveInHistory) { HistoryGlobal.AddItem(FileSystem.CurrentPlace); History.AddItem(FileSystem.CurrentPlace, false); } }
public void ChangeFileSystem(FileSystem.FileSystemBase fileSystem) { FileSystem = fileSystem; //set up binding Binding bind = new Binding("Items"); bind.Source = FileSystem; lbContent.SetBinding(ListBox.ItemsSourceProperty, bind); //save in history HistoryGlobal.AddItem(FileSystem.CurrentPlace); History.AddItem(FileSystem.CurrentPlace, false); dirChanged = true; SetFocusOnContent(); OnPropertyChanged("FileSystem"); }
public void LoadDir(string dir, bool saveInHistory) { //loading files into second column FileSystem.LoadDirectory(dir); dirChanged = true; //loading files into first column lbContent1.ItemsSource = null;//clear items if (!FileSystem.IsRootPath(FileSystem.CurrentPlace.FullName)) { fileSystem1.LoadDirectory(PathExt.GetDirectoryName(FileSystem.CurrentPlace.FullName, FileSystem.IsWindowsFileSystem)); lbContent1.ItemsSource = fileSystem1.Items; } //save in history if (saveInHistory) { HistoryGlobal.AddItem(FileSystem.CurrentPlace); history.AddItem(FileSystem.CurrentPlace, false); } }
public void LoadDirectory(string dir, bool moveUp = false, bool saveInHistory = true) { fileSystemWatcher.EnableRaisingEvents = false; var lastPlace = FileSystem.CurrentPlace; FileSystem.LoadDirectory(dir); Items = FileSystem.Items.OrderByDescending(x => x.IsMoveUp || x.IsDirectory).ToArray(); DirectoryName = FileSystem.DirectoryName; FullPath = FileSystem.FullPath; IsFavoritePath = PathsManager.Favorites.Contains(FileSystem.CurrentPlace); SelectedItem = moveUp ? Items.First(x => x.FullName == lastPlace.FullName) : GetItemToSelect(); if (FileSystem.IsWindowsFileSystem) { fileSystemWatcher.Path = dir; fileSystemWatcher.EnableRaisingEvents = true; } if (saveInHistory) { HistoryGlobal.AddItem(FileSystem.CurrentPlace); History.AddItem(FileSystem.CurrentPlace, false); } }