/// <summary> /// Tests if this modification represents a removed operation to the original log source. /// </summary> /// <param name="removedSection">The section of the log source which was removed.</param> /// <returns></returns> public bool IsRemoved(out LogSourceSection removedSection) { if (_modificationType == ModificationType.Removed) { removedSection = _section; return(true); } removedSection = default; return(false); }
/// <summary> /// Tests if this modification represents an append operation to the original log source. /// </summary> /// <param name="appendedSection">The section of the log source which was appended.</param> /// <returns></returns> public bool IsAppended(out LogSourceSection appendedSection) { if (_modificationType == ModificationType.Appended) { appendedSection = _section; return(true); } appendedSection = default; return(false); }
public static LogSourceModification Removed(LogSourceSection section) { return(new LogSourceModification(ModificationType.Removed, section)); }
private LogSourceModification(ModificationType modificationType, LogSourceSection section) { _modificationType = modificationType; _section = section; }
/// <summary> /// Creates a modification which signals to the listener that the given amount of <see cref="ILogEntry" />s were /// appended /// to the <see cref="ILogSource" />. /// </summary> /// <param name="section"></param> /// <returns></returns> public static LogSourceModification Appended(LogSourceSection section) { return(new LogSourceModification(ModificationType.Appended, section)); }