using System;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class TimeInfo
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string startTimeField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string stopTimeField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string durationField;

	[XmlAttribute]
	public string StartTime
	{
		get
		{
			return startTimeField;
		}
		set
		{
			startTimeField = value;
		}
	}

	[XmlAttribute]
	public string StopTime
	{
		get
		{
			return stopTimeField;
		}
		set
		{
			stopTimeField = value;
		}
	}

	[XmlAttribute]
	public string Duration
	{
		get
		{
			return durationField;
		}
		set
		{
			durationField = value;
		}
	}

	public bool ShouldSerializeStartTime()
	{
		return !string.IsNullOrEmpty(StartTime);
	}

	public bool ShouldSerializeStopTime()
	{
		return !string.IsNullOrEmpty(StopTime);
	}

	public bool ShouldSerializeDuration()
	{
		return !string.IsNullOrEmpty(Duration);
	}

	public TimeInfo()
	{
		startTimeField = string.Empty;
		stopTimeField = string.Empty;
		durationField = string.Empty;
	}

	public TimeInfo(string startTime = null, string stopTime = null, string duration = null)
	{
		if (!string.IsNullOrEmpty(startTime))
		{
			startTimeField = startTime;
		}
		else
		{
			startTimeField = string.Empty;
		}
		if (!string.IsNullOrEmpty(stopTime))
		{
			stopTimeField = stopTime;
		}
		else
		{
			stopTimeField = string.Empty;
		}
		if (!string.IsNullOrEmpty(duration))
		{
			durationField = duration;
		}
		else
		{
			durationField = string.Empty;
		}
	}
}
