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); }
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); }