Esempio n. 1
0
        private void ManualScrollBar_OnScroll(object sender, ScrollEventArgs e)
        {
            if (e.ScrollEventType == ScrollEventType.EndScroll ||
                LogViewModel.IsReading)
            {
                e.Handled = true;
                return;
            }

            switch (e.ScrollEventType)
            {
            case ScrollEventType.SmallIncrement:
            {
                LogViewModel.ReadLinesStartingFromBytePosition(LogViewModel.FirstLineEndingByte, 1, true);
                break;
            }

            case ScrollEventType.SmallDecrement:
            {
                LogViewModel.BeginNewReadAtByteOccuranceNumberStartingFromSpecificByteReferemce(LogViewModel.FirstLineStartingByte
                                                                                                , FindByteLocationActorMessages.SearchDirection.Backward
                                                                                                , 2,
                                                                                                true);
                break;
            }

            default:
            {
                long startingByte = Math.Max(0, Math.Min(LogViewModel.TotalFileSizesInBytes, (long)(e.NewValue * 10)));
                LogViewModel.ReadLinesStartingFromBytePosition(startingByte, 1, false);
                break;
            }
            }
        }