public void Dispose() { var commands = _commands.Get(this); if (commands.Any()) { throw new InvalidOperationException( "Deferred references were applied to this reader to track, but they were not applied and executed as expected. This is considered an unexpected, invalid, and corrupt state."); } _reader.Dispose(); }
public void Execute(IInnerContent parameter) { var commands = _commands.Get(parameter.Get()); foreach (var command in commands.ToArray()) { var current = command.Get(); if (current != null) { command.Execute(current); commands.Remove(command); } } }
protected override IReferenceMap Create(IFormatReader parameter) => new DeferredReferenceMap(_commands.Get(parameter), _contexts.Get(parameter), _maps.Get(parameter));