void SetUnderlyingStreamCore(HexBufferStream newStream) { if (stream == newStream) return; UnregisterEvents(); stream?.Dispose(); stream = newStream; RegisterEvents(); InvalidateAll(); UnderlyingStreamChanged?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Creates a new <see cref="HexBuffer"/> /// </summary> /// <param name="stream">Stream to use</param> /// <param name="tags">Tags</param> /// <param name="disposeStream">true if the returned buffer owns <paramref name="stream"/> and /// disposes it when the buffer gets disposed</param> /// <returns></returns> public abstract HexBuffer Create(HexBufferStream stream, HexTags tags, bool disposeStream);
public void SetUnderlyingStream(HexBufferStream newStream) { CheckDisposed(); SetUnderlyingStreamCore(newStream); }