/// <summary> /// Sets the <see cref="Output"/>. /// </summary> /// <param name="output">Can not be null.</param> protected void SetOutput(ActivityMonitorOutput output) { if (output == null) { throw new ArgumentNullException("output"); } _output = output; }
void Build(ActivityMonitorOutput output, CKTrait tags, bool applyAutoConfigurations) { Debug.Assert(Tags.Context.Separator == '|', "Separator must be the |."); _output = output; _groups = new Group[8]; for (int i = 0; i < _groups.Length; ++i) { _groups[i] = new Group(this, i); } _currentTag = tags ?? Tags.Empty; _uniqueId = Guid.NewGuid(); _topic = String.Empty; _lastLogTime = DateTimeStamp.MinValue; if (applyAutoConfigurations) { var autoConf = AutoConfiguration; if (autoConf != null) { autoConf(this); } } }
/// <summary> /// Initializes a new <see cref="ActivityMonitor"/> with a specific <see cref="Output"/> or null /// to postpone the setting of Output by using <see cref="SetOutput"/>. /// </summary> /// <param name="output">The output to use. Can be null.</param> /// <param name="tags">Initial tags.</param> /// <param name="applyAutoConfigurations">Whether <see cref="AutoConfiguration"/> should be applied.</param> protected ActivityMonitor(ActivityMonitorOutput output, CKTrait tags = null, bool applyAutoConfigurations = true) { Build(output, tags, applyAutoConfigurations); }