Пример #1
0
 public void SelectFileBlock(FileBlockInfo blockInfo)
 {
     if (!IsBlockSelected(blockInfo))
     {
         selectedFileBlocks.Add(blockInfo);
     }
 }
Пример #2
0
 public bool IsBlockSelected(FileBlockInfo blockInfo)
 {
     if (selectedFileBlocks.Contains(blockInfo))
     {
         return(true);
     }
     return(false);
 }
Пример #3
0
        private void FileSectorIndicator(FileStream fs)
        {
            long        num = 0L;
            long        foundTraceFileOffset = 0L;
            TraceRecord lastValidTrace       = GetLastValidTrace(fs, out foundTraceFileOffset);

            if (lastValidTrace == null)
            {
                return;
            }
            while (true)
            {
                if (num > foundTraceFileOffset)
                {
                    return;
                }
                TraceRecord traceRecord           = null;
                TraceRecord traceRecord2          = null;
                long        foundTraceFileOffset2 = 0L;
                long        foundTraceFileOffset3 = 0L;
                traceRecord = GetFirstValidTrace(fs, num, out foundTraceFileOffset2);
                if (traceRecord == null)
                {
                    return;
                }
                num = foundTraceFileOffset2 + 5000000;
                if (num >= foundTraceFileOffset)
                {
                    traceRecord2          = lastValidTrace;
                    foundTraceFileOffset3 = foundTraceFileOffset;
                }
                else
                {
                    traceRecord2 = GetFirstValidTrace(fs, num, out foundTraceFileOffset3);
                    if (traceRecord2 == null)
                    {
                        return;
                    }
                }
                if (traceRecord.Time > traceRecord2.Time)
                {
                    break;
                }
                FileBlockInfo fileBlockInfo = new FileBlockInfo();
                fileBlockInfo.StartDate       = traceRecord.Time;
                fileBlockInfo.StartFileOffset = foundTraceFileOffset2;
                fileBlockInfo.EndDate         = traceRecord2.Time;
                fileBlockInfo.EndFileOffset   = foundTraceFileOffset3;
                fileBlocks.Add(fileBlockInfo);
                num = foundTraceFileOffset3 + findingBytes.Length;
            }
            throw new LogFileException(SR.GetString("MsgTimeRangeError") + SR.GetString("MsgReturnBack") + fs.Name + SR.GetString("MsgReturnBack"), fs.Name, null);
        }