protected Location(InfoGatherTask infoGatherTask, MediaFileState state) { MediaFileState = state; this.infoGatherTask = infoGatherTask; //state.NrImportedItemsChanged += new EventHandler<MediaStateChangedEventArgs>(importStateChanged); }
public DirectoryLocation(DirectoryInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState) { Name = info.Name; CreationDate = info.CreationTime; VolumeLabel = ""; //ImageUrl = "pack://application:,,,/Resources/Icons/mediafolder.ico"; NrImported = 0; LazyLoading = true; PropertyChanged += propertyChanged; }
public DirectoryPicker() { InitializeComponent(); cancelInfoGatherTaskTokenSource = new CancellationTokenSource(); infoGatherTask = new InfoGatherTask(cancelInfoGatherTaskTokenSource.Token); RootLocation root = new RootLocation(infoGatherTask, MediaFileWatcher.Instance.MediaFileState); treeView.Root = root; treeView.IsVisibleChanged += treeView_IsVisibleChanged; root.NodePropertyChanged += root_NodePropertyChanged; scrollToNodeOnTreeViewVisible = null; //SharpTreeView temp; }
public RootLocation(InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState) { LazyLoading = true; mediaFileState.NrImportedItemsChanged += mediaFileState_NrImportedItemsChanged; }
public DriveLocation(DriveInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState) { switch (info.DriveType) { case DriveType.CDRom: { ImageUrl = "pack://application:,,,/Resources/Icons/CD_Drive.ico"; VolumeLabel = "CD ROM"; break; } case DriveType.Fixed: { ImageUrl = "pack://application:,,,/Resources/Icons/Hard_Drive.ico"; try { VolumeLabel = !String.IsNullOrEmpty(info.VolumeLabel) ? info.VolumeLabel : "Local Disk"; } catch (Exception) { } break; } case DriveType.Network: { ImageUrl = "pack://application:,,,/Resources/Icons/Network_Drive.ico"; VolumeLabel = "Network Drive"; break; } case DriveType.NoRootDirectory: { break; } case DriveType.Ram: { ImageUrl = "pack://application:,,,/Resources/Icons/ram.ico"; VolumeLabel = "Ram Drive"; break; } case DriveType.Removable: { ImageUrl = "pack://application:,,,/Resources/Icons/Removable_Drive.ico"; VolumeLabel = "Removable Drive"; break; } case DriveType.Unknown: { ImageUrl = "pack://application:,,,/Resources/Icons/UnknownDrive.ico"; VolumeLabel = "Unknown Drive"; break; } } Name = info.Name.TrimEnd(new char[] { '\\' }); if (driveIdleMonitor.DrivesMonitored.Contains(Name)) { FreeSpaceBytes = info.TotalFreeSpace; driveIdleMonitor.DriveInUse += new EventHandler <string>(driveIdleMonitor_driveInUse); } else { FreeSpaceBytes = 0; } infoGatherTask.addLocation(this); LazyLoading = true; }
public DriveLocation(DriveInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState) { switch (info.DriveType) { case DriveType.CDRom: { ImageUrl = "pack://application:,,,/Resources/Icons/CD_Drive.ico"; VolumeLabel = "CD ROM"; break; } case DriveType.Fixed: { ImageUrl = "pack://application:,,,/Resources/Icons/Hard_Drive.ico"; try { VolumeLabel = !String.IsNullOrEmpty(info.VolumeLabel) ? info.VolumeLabel : "Local Disk"; } catch (Exception) { } break; } case DriveType.Network: { ImageUrl = "pack://application:,,,/Resources/Icons/Network_Drive.ico"; VolumeLabel = "Network Drive"; break; } case DriveType.NoRootDirectory: { break; } case DriveType.Ram: { ImageUrl = "pack://application:,,,/Resources/Icons/ram.ico"; VolumeLabel = "Ram Drive"; break; } case DriveType.Removable: { ImageUrl = "pack://application:,,,/Resources/Icons/Removable_Drive.ico"; VolumeLabel = "Removable Drive"; break; } case DriveType.Unknown: { ImageUrl = "pack://application:,,,/Resources/Icons/UnknownDrive.ico"; VolumeLabel = "Unknown Drive"; break; } } Name = info.Name.TrimEnd(new char[] { '\\' }); if (driveIdleMonitor.DrivesMonitored.Contains(Name)) { FreeSpaceBytes = info.TotalFreeSpace; driveIdleMonitor.DriveInUse += new EventHandler<string>(driveIdleMonitor_driveInUse); } else { FreeSpaceBytes = 0; } infoGatherTask.addLocation(this); LazyLoading = true; }