using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class SoftwareConfiguration
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<SoftwareConfigurationImage> imageField;

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

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

	[XmlElement("Image")]
	public List<SoftwareConfigurationImage> Image
	{
		get
		{
			return imageField;
		}
		set
		{
			imageField = value;
		}
	}

	[XmlAttribute("SWBuildID")]
	public string SoftwareBuildID
	{
		get
		{
			return swBuildIDField;
		}
		set
		{
			swBuildIDField = value;
		}
	}

	[XmlAttribute("V")]
	public string Version
	{
		get
		{
			return versionField;
		}
		set
		{
			versionField = value;
		}
	}

	public bool ShouldSerializeImage()
	{
		if (Image != null)
		{
			return Image.Count > 0;
		}
		return false;
	}

	public bool ShouldSerializeSoftwareBuildID()
	{
		return !string.IsNullOrEmpty(SoftwareBuildID);
	}

	public bool ShouldSerializeVersion()
	{
		return !string.IsNullOrEmpty(Version);
	}

	public SoftwareConfiguration()
	{
		imageField = new List<SoftwareConfigurationImage>();
		swBuildIDField = string.Empty;
	}

	public SoftwareConfiguration(List<SoftwareConfigurationImage> image = null, string swBuildID = null, string version = null)
	{
		if (image != null)
		{
			imageField = image;
		}
		else
		{
			imageField = new List<SoftwareConfigurationImage>();
		}
		if (!string.IsNullOrEmpty(swBuildID))
		{
			swBuildIDField = swBuildID;
		}
		else
		{
			swBuildIDField = string.Empty;
		}
		if (!string.IsNullOrEmpty(version))
		{
			versionField = version;
		}
		else
		{
			versionField = string.Empty;
		}
	}
}
