/// <summary> /// Returns all properties from this log file. /// </summary> /// <returns></returns> public static IPropertiesBuffer GetAllProperties(this ILogSource that) { var destination = new PropertiesBufferList(); that.GetAllProperties(destination); return(destination); }
private void UpdateProperties() { if (_source != null) { _source.GetAllProperties(_sourceProperties); _properties.CopyFrom(_sourceProperties); } else { _properties.SetValue(Core.Properties.PercentageProcessed, Percentage.HundredPercent); } }
/// <inheritdoc /> public void GetAllProperties(IPropertiesBuffer destination) { try { _logSource.GetAllProperties(destination); } catch (Exception e) { BlameExceptionOnPlugin(e); throw; } }
private void UpdateProperties() { // First we want to retrieve all properties from the source _source.GetAllProperties(_propertiesBuffer); // Then we'll add / overwrite properties _propertiesBuffer.SetValue(Core.Properties.PercentageProcessed, ComputePercentageProcessed()); _propertiesBuffer.SetValue(Core.Properties.LogEntryCount, _indices.Count); // And last but not least we'll update our own properties to the new values // It's important we do this in one go so clients can retrieve all those properties // in a consistent state _properties.CopyFrom(_propertiesBuffer); }
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); }
public override void Update() { _logSource?.GetAllProperties(_propertyValues); foreach (var property in _propertyValues.Properties) { if (!_presentersByProperty.TryGetValue(property, out var presenter )) { presenter = TryCreateViewModel(property); _presentersByProperty.Add(property, presenter ); if (presenter != null) { _presenters.Add(presenter); } } // Some properties just don't have presenters and we want to avoid trying to create one over and over, // so we simply remember those that don't have one presenter?.Update(_propertyValues.GetValue(property)); } }
/// <inheritdoc /> public void GetAllProperties(IPropertiesBuffer destination) { _source?.GetAllProperties(destination); }