public override bool TryGetPlaceholderInfo(string relativePath, TriggeringProcessContext triggeringProcess, out PlaceholderInfo placeholderInfo) { Console.WriteLine($"Get Placeholder for: '{relativePath}' (from {triggeringProcess.Process.ProcessName}:{triggeringProcess.ProcessId})"); switch (relativePath) { case "a": placeholderInfo = new PlaceholderInfo(FileBasicInfo.File(_FileContent.Length, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now)); return(true); case "b": placeholderInfo = new PlaceholderInfo(FileBasicInfo.File(_FileContent.Length, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now)); return(true); case "c": placeholderInfo = new PlaceholderInfo(FileBasicInfo.Directory(DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now)); return(true); default: placeholderInfo = null; return(false); } }
public abstract bool TryGetFileData(string relativePath, long offset, int length, TriggeringProcessContext triggeringProcess, out ReadOnlySpan <byte> data);
public abstract bool TryGetPlaceholderInfo(string relativePath, TriggeringProcessContext triggeringProcess, out PlaceholderInfo placeholderInfo);
public override bool TryGetFileData(string relativePath, long offset, int length, TriggeringProcessContext triggeringProcess, out ReadOnlySpan <byte> data) { Console.WriteLine($"TryGetFileData: {relativePath} ({offset}, {length})"); if (offset >= 0 && (offset + length) <= _FileContent.Length) { data = _FileContent.AsSpan((int)offset, length); return(true); } data = ReadOnlySpan <byte> .Empty; return(false); }