public DirectorySynchronizeOperation(DirectorySynchronizeResult syncRes, IDirectoryViewItem[] items, FileSystemBase leftSystem, FileSystemBase rightSystem) : base(items, leftSystem) { SyncResult = syncRes; LeftSystem = leftSystem; RightSystem = rightSystem; OperationName = "Synchronizacja katalogów"; }
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 ChangeFileSystem(FileSystemBase fileSystem) { DisableSearch(); FileSystem.Dispose(); FileSystem = fileSystem; LoadDirectory(FileSystem.CurrentPlace.FullName); }
public MoveOperation(IDirectoryViewItem[] items, string destPath, FileSystemBase sourceFileSystem, FileSystemBase destFileSystem) : base(items, sourceFileSystem) { DestinationPath = destPath; DestFileSystem = destFileSystem; ProcessedItems = new List <IDirectoryViewItem>(items.Length); SizeInBytes = ItemsSize.ToBytes(); }
public StoreBase( FileSystemBase fileSystem, Type entityType) { _entityType = entityType; _asyncFileSystem = fileSystem as IAsyncFileSystem; _fileSystem = fileSystem as IFileSystem; }
public int ExceptionHandler(Exception ex) { var HResult = ex.HResult; if (0x80070000 == (HResult & 0xFFFF0000)) { return(FileSystemBase.NtStatusFromWin32((uint)HResult & 0xFFFF)); } return(FileSystemBase.STATUS_SUCCESS); }
public BsonStore( FileSystemBase fileSystem, Type entityType) : base(fileSystem, entityType) { _lock = new ReaderWriterLockSlim(); _serializer = JsonSerializer.CreateDefault(); _path = FileSystemPath.Root.AppendDirectory(EntityType.ToFriendlyName()); }
public RenameOperation(IDirectoryViewItem objectToRename, string newName, FileSystemBase fileSystem) : base(fileSystem) { ObjectToRename = objectToRename; OldName = ObjectToRename.Name; OldPath = ObjectToRename.FullName; NewName = newName; NewPath = PathExt.Combine(PathExt.GetDirectoryName(ObjectToRename.FullName, ObjectToRename.IsWindowsFile), NewName, ObjectToRename.IsWindowsFile); OperationName = "Zmiana nazwy z " + OldName + " na " + NewName; }
/// <summary> /// Ctor /// </summary> /// <param name="items">Items to work on</param> public MultiFileOperation(IDirectoryViewItem[] items, FileSystemBase fileSystem) : base(fileSystem) { //TODO: Files in folders should be diffirent objects ItemsSize = FileSize.Empty; System.Diagnostics.Debug.Assert(items.Length > 0, "Empty operation!"); Items = items; //CurrentItem = items[0]; CountSize(); }
void DisplayPartitionStatus(FileSystemBase partition) { var bs = partition.BootSector; var fsstr = string.Format("File System: {0} | {1}", (FsTypesMbr)bs.MbrPartitionTable.First().FileSystemMbr, bs.FsType); var psize = string.Format("Partition Size: {0}", bs.PartitionSizeString); Invoke(new MethodInvoker(() => { toolStripStatusFSType.Text = fsstr; toolStripStatusSize.Text = psize; })); }
public ThreeColumnView() { InitializeComponent(); fileSystem1 = new WindowsFileSystem(); fileSystem2 = new WindowsFileSystem(); fileSystem3 = new WindowsFileSystem(); history = new History <IDirectoryViewItem>(); Binding bind2 = new Binding("Items");//bind to second(middle) ListBox bind2.Source = FileSystem; lbContent2.SetBinding(ListBox.ItemsSourceProperty, bind2); lbContent2.ItemContainerGenerator.StatusChanged += new EventHandler(ItemContainerGenerator_StatusChanged); }
// <Key, Tuple<Entity, Metadata>> public JsonStore( FileSystemBase fileSystem, Type entityType ) : base(fileSystem, entityType) { _entities = new Dictionary <object, Tuple <object, MetadataEntity> >(); _listSerializer = new SimpleListSerializer(); _serializer = JsonSerializer.CreateDefault(); _lock = new ReaderWriterLockSlim(); _initialized = false; _path = FileSystemPath.Root.AppendFile( String.Format(FileFormatString, EntityType.ToFriendlyName())); }
public void ApplyLoadedData() { SerializationData data = SerializationHelper.GetData(SerializationKey); Dictionary <string, object> dict = data.Data; int count = (int)dict["Count"]; for (int i = 0; i < count; i++) { Type viewType = (Type)dict[i + "Type"]; IDirectoryView view = (IDirectoryView)Activator.CreateInstance(viewType); FileSystemBase fileSystem = (FileSystemBase)dict[i + "FileSystem"]; //AddNewTab(view, fileSystem); } tcViews.SelectedIndex = (int)dict["ActiveView"]; }
private void ToolStripButtonDiskList_Click(object sender, EventArgs e) { try { var disklist = GetPhysicalDiskList(); var drivelist = DriveInfo.GetDrives(); var tableview = new TableViwForm(); tableview.Tittle = "Physical Disk and Drive List"; tableview.ColumnHeaders.Add(new ColumnHeader("Name", 150)); tableview.ColumnHeaders.Add(new ColumnHeader("Capacity", 100)); tableview.ColumnHeaders.Add(new ColumnHeader("Description", 200)); tableview.ColumnHeaders.Add(new ColumnHeader("Model", 300)); foreach (var item in disklist) { var sizestr = FileSystemBase.GetFormatedSizeString(long.Parse(item.TotalSize)); var descstr = string.Format("{0}, {1}, {2}", item.InterfaceType, item.Description, item.MediaType); var modelstr = string.Format("{0}, {1}", item.Model, item.SerialNumber); tableview.DataRows.Add(new[] { item.FileName, sizestr, descstr, modelstr }); } foreach (var item in drivelist) { if (!item.IsReady) { continue; } var namestr = @"\\.\" + item.Name.Substring(0, 2); var sizestr = FileSystemBase.GetFormatedSizeString(item.TotalSize); var descstr = string.Format("{0}, {1}, {2}", item.VolumeLabel, item.DriveFormat, item.DriveType); tableview.DataRows.Add(new[] { namestr, sizestr, descstr }); } tableview.ShowDialog(); var idx = tableview.SelectedIndex; if (idx >= 0) { ReloadDiskNames(); comboBoxStorageName.SelectedIndex = idx; } } catch (Exception ex) { PopupException(ex.Message); } }
private void CommenceCopy(string destPath, FileSystemBase sourceFS, FileSystemBase destFS) { if (IsWindowsCopy()) { ((WindowsFile)CurrentItem).SimpleCopyTo(destPath); } else if (sourceFS.IsWindowsFileSystem && !destFS.IsWindowsFileSystem) { ((FTPFileSystem)destFS).Upload((WindowsFile)CurrentItem); } else if (!sourceFS.IsWindowsFileSystem && destFS.IsWindowsFileSystem) { ((FTPFileSystem)sourceFS).Download((FTPFile)CurrentItem, destPath); } else { System.Diagnostics.Debug.Assert(true, "Not supported copy"); } }
private void AddNewTab(IDirectoryView view, FileSystemBase fileSystem) { //create new TabItem & apply style TabItem ti = new TabItem(); ti.Style = (Style)Resources["CloseableTabItem"]; UserControl viewCtrl = (UserControl)view; viewCtrl.Height = double.NaN;//same as Auto in XAML viewCtrl.VerticalAlignment = VerticalAlignment.Stretch; viewCtrl.Width = double.NaN; viewCtrl.HorizontalAlignment = HorizontalAlignment.Stretch; //events view.ItemExecuted += ActiveView_ItemExecuted; //set file system if (fileSystem != null) { view.ChangeFileSystem(fileSystem); } //set content listview as content of tabitem ti.Content = view; //add tabitem to tabcontrol tcViews.Items.Insert(tcViews.Items.Count - 1, ti); tcViews.SelectedIndex = tcViews.Items.Count - 2;//QSTN: Why new tab must be selected, to gain header? //bind header Binding bind = new Binding("FileSystem.DirectoryName"); bind.Source = view; ti.SetBinding(TabItem.HeaderProperty, bind); }
public VolumeManager(FileSystemBase pFileSystem, string pSource) { Host = new FileSystemHostWrapper(new FileSystemHost(pFileSystem)); Source = pSource; }
public NewFolderOperation(string folderPath, FileSystemBase fileSystem) : base(fileSystem) { FolderPath = folderPath; OperationName = "Tworzenie folderu " + Path.GetFileName(FolderPath); }
//OPT: Make this ctor in more elegant way public MultiRenameOperation(IEnumerable <MultiRenameItem> mrItems, IDirectoryViewItem[] dvItems, FileSystemBase fileSystem) : base(dvItems, fileSystem) { MRItems = mrItems; OperationName = string.Format("Zmiana nazwy {0} obiektów", mrItems.Count()); }
public static void ThrowIoExceptionWithNtStatus(Int32 Status) { ThrowIoExceptionWithWin32((Int32)FileSystemBase.Win32FromNtStatus(Status)); }
public DeleteOperation(FileSystemBase fileSystem, IDirectoryViewItem[] items) : base(items, fileSystem) { }
public void ChangeFileSystem(FileSystemBase fileSystem) { DisableSimpleSearch(); ActiveView.ChangeFileSystem(fileSystem); }
/// <summary> /// Ctor /// </summary> public OperationBase(FileSystemBase fileSystem) { IsCanceled = false; IsFinished = false; FileSystem = fileSystem; }
public static IOException GetIOException(INTException ex) { return(GetIOExceptionWithWin32((int)FileSystemBase.Win32FromNtStatus(ex.GetCode()))); }