コード例 #1
0
            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);
                }
            }
コード例 #2
0
 public abstract bool TryGetFileData(string relativePath, long offset, int length, TriggeringProcessContext triggeringProcess, out ReadOnlySpan <byte> data);
コード例 #3
0
 public abstract bool TryGetPlaceholderInfo(string relativePath, TriggeringProcessContext triggeringProcess, out PlaceholderInfo placeholderInfo);
コード例 #4
0
            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);
            }