public ComponentStateHistoryTracker(IComponent component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } _component = component; _filename = StoragePath.WithFilename("Components", component.Id.Value, "History.csv"); StoragePath.EnsureDirectoryExists(_filename); component.StateChanged += CreateDataPointAsync; }