コード例 #1
0
ファイル: FileLogSource.cs プロジェクト: tank0226/Tailviewer
        private void UpdateProperties()
        {
            if (_finalLogSource != null)
            {
                _finalLogSource.GetAllProperties(_propertiesBuffer.Except(TextProperties.AutoDetectedEncoding, Core.Properties.Format));                 //< We don't want the log source to overwrite the encoding we just found out...
                _propertiesBuffer.SetValue(TextProperties.MaxCharactersInLine, _maxCharactersInLine);
            }
            else
            {
                _propertiesBuffer.SetValue(Core.Properties.PercentageProcessed, Percentage.HundredPercent);
            }

            _properties.CopyFrom(_propertiesBuffer);
        }
コード例 #2
0
        private void SynchronizeProperties()
        {
            _source.GetAllProperties(_propertiesBuffer.Except(_adornedProperties));

            var sourceProcessed = _propertiesBuffer.GetValue(Core.Properties.PercentageProcessed);
            var sourceCount     = _propertiesBuffer.GetValue(Core.Properties.LogEntryCount);
            var ownProgress     = sourceCount > 0
                                ? Percentage.Of(_count, sourceCount).Clamped()
                                : Percentage.HundredPercent;
            var totalProgress = (sourceProcessed * ownProgress).Clamped();

            _propertiesBuffer.SetValue(Core.Properties.PercentageProcessed, totalProgress);
            _propertiesBuffer.SetValue(Core.Properties.LogEntryCount, _count);
            _properties.CopyFrom(_propertiesBuffer);
        }