/// <summary> /// 初始化数据泵。 /// </summary> /// <returns>成功返回true;否则返回false。</returns> protected override Boolean InitializeCore() { IFileSystemDevice device = CreateFileSystemDevice(); if (device == null) { return(false); } _fsd = device; return(FileService.GetFileSystem(device, null) != null); }
/// <summary> /// 获取文件系统 /// </summary> /// <param name="device"></param> /// <param name="iAsync"></param> /// <returns></returns> public FNodeX GetFileSystem(IFileSystemDevice device, SingleTaskReporterBase iAsync) { IAsync = iAsync; CreateFileServiceAbstractX(device, iAsync); if (fileServiceX == null) { return(null); } _systemTree = fileServiceX.GetFileSystem(); return(_systemTree); }
/// <summary> /// 初始化当前的执行流程。当执行该方法时,会获取镜像的文件系统信息。 /// </summary> /// <param name="context">执行上下文。</param> /// <returns>成功返回true;否则返回false。</returns> protected sealed override Boolean InitExecution(DataPumpControllableExecutionContext context) { IFileSystemDevice device = CreateFileSystemDevice(context); if (device == null) { return(false); } SetContextData(context, FileSystemDeviceKey, device); return(FileService.GetFileSystem(device, ((DataPumpControllableExecutionContext)context).Reporter) != null); }
/// <summary> /// 获取文件系统 /// </summary> /// <param name="device"></param> /// <param name="iAsync"></param> /// <returns></returns> public FNodeX GetFileSystem(IFileSystemDevice device, IAsyncProgress iAsync) { IAsync = iAsync; CreateFileServiceAbstractX(device, iAsync); if (fileServiceX == null) { return(null); } _systemTree = fileServiceX.GetFileSystem(); return(_systemTree); }
/// <summary> /// 构造函数 /// </summary> /// <param name="device">当前处理的设备</param> /// <param name="iAsyn">异步消息通知</param> protected FileServiceAbstractX(IFileSystemDevice device, IAsyncProgress iAsyn) { Asyn = iAsyn; Device = device; if (AllFileNodeX == null) { AllFileNodeX = new List <FNodeX>(); } if (GetUserPartitionFiles == null) { GetUserPartitionFiles = new NodeCollection(); } }
private void CreateFileServiceAbstractX(IFileSystemDevice device, SingleTaskReporterBase iAsync) { if (device is MirrorDevice) { fileServiceX = new MirrorDeviceService(device, iAsync); } else if (device is SDCardDevice) { fileServiceX = new SDCardDeviceService(device, iAsync); } else if (device is CellbriteDevice) { fileServiceX = new CellbriteDeviceService(device, iAsync); } else if (device is CottageDevice) { fileServiceX = new CottageMirrorDeviceService(device, iAsync); } }
private void CreateFileServiceAbstractX(IFileSystemDevice device, IAsyncProgress iAsync) { if (device is MirrorDevice) { fileServiceX = new MirrorDeviceService(device, iAsync); } else if (device is SDCardDevice) { fileServiceX = new SDCardDeviceService(device, iAsync); } else if (device is CellbriteDevice) { fileServiceX = new CellbriteDeviceService(device, iAsync); } else if (device is CottageDevice) { fileServiceX = new CottageMirrorDeviceService(device, iAsync); } }
private FNodeX ScanFileSystem(IFileSystemDevice device, FileSystemPartition partition) { ScanCallBack callBack = (ref ScanCallBackData pdi) => { }; LINK_DIR_FILE_NODE_INFO link = new LINK_DIR_FILE_NODE_INFO(); LIST_FILE_RAW_TYPE_INFO raw = CreatRawLink(); try { var result = FileServiceCoreDll.ScanFiles(partition.Mount, callBack, ref link, device.ScanModel, ref raw, 0); if (result != 0) { LoggerManagerSingle.Instance.Error(string.Format("获取文件系统(名称:{ 0},描述: { 1},大小: { 2})失败,错误码: { 3}", partition.Name, partition.Discription, partition.Size, result)); return(null); } partition.NodeLinkList = link; } catch (Exception ex) { LoggerManagerSingle.Instance.Error(string.Format("获取文件系统(名称:{0},描述:{1},大小:{2},Mount:{3})时底层dll出错", partition.Name, partition.Discription, partition.Size, partition.Mount), ex); return(null); } // 构建当前分区节点 var treeNode = new FNodeX { Source = link.NodeDataInfo, FileName = partition.VolName, IsRoot = true, IsPartition = true, Key = link.NodeDataInfo.FileId, ParentKey = link.NodeDataInfo.ParentFileId }; // 加载树结构; var source = BuildDataDictionary(link); BuildTree(treeNode, source); return(treeNode); }
/// <summary> /// 镜像文件设备服务 /// </summary> /// <param name="device"></param> /// <param name="iAsyn"></param> public MirrorDeviceService(IFileSystemDevice device, IAsyncProgress iAsyn) : base(device, iAsyn) { }
public SDCardDeviceService(IFileSystemDevice device, IAsyncProgress iAsyn) : base(device, iAsyn) { }
public CottageMirrorDeviceService(IFileSystemDevice device, IAsyncTaskProgress iAsyn) : base(device, iAsyn) { }
public CellbriteDeviceService(IFileSystemDevice device, IAsyncProgress iAsyn) : base(device, iAsyn) { }