#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System;
using Volpe.Cafe.ModelSettings;

namespace Volpe.Cafe.Reporting
{
    /// <summary>
    /// Defines an empty reporter that suppresses all reporting capability.
    /// </summary>
    [Serializable]
    public class EmptyReporter : IReporter, IDisposable
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EmptyReporter"/> class.
        /// </summary>
        public EmptyReporter()
        {
            this.IsDisposed = false;
        }

        //----- events -----
        // empty reporter does not change state, so no events will be raised
        event EventHandler IReporter.RunningChanged { add { } remove { } }
        event EventHandler IReporter.StatusChanged { add { } remove { } }

        //----- properties -----
        public bool IsDisposed { get; private set; }

        object IReporter.SyncRoot { get; } = new object();

        ReportingLevel IReporter.ReportingLevel => ReportingLevel.Disabled;
        string IReporter.ReportPath => null;
        bool IReporter.IsRunning => false;
        string IReporter.Status => null;

        //----- methods -----
        public void Close()
        {
            this.Dispose();
        }
        public void Dispose()
        {
            this.IsDisposed = true;
        }

        void IReporter.GenerateReports(Scenario scen, ReportingData data, ModelingSettings settings)
        {
            this.ThrowIfDisposed();
        }
        void IReporter.SafeGenerateReports(Scenario scen, ReportingData data, ModelingSettings settings)
        {
            this.ThrowIfDisposed();
        }
        void IReporter.CancelReporting()
        {
            this.ThrowIfDisposed();
        }

    }
}
