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

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class Image
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<DataItem> diField;

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

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

	[XmlElement("DI", IsNullable = false)]
	public List<DataItem> DataItems
	{
		get
		{
			return diField;
		}
		set
		{
			diField = value;
		}
	}

	public string Filename
	{
		get
		{
			return filenameField;
		}
		set
		{
			filenameField = value;
		}
	}

	public string UNCFilename
	{
		get
		{
			return uncFilenameField;
		}
		set
		{
			uncFilenameField = value;
		}
	}

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

	public bool ShouldSerializeFilename()
	{
		return !string.IsNullOrEmpty(Filename);
	}

	public bool ShouldSerializeUNCFilename()
	{
		return !string.IsNullOrEmpty(UNCFilename);
	}

	public Image()
	{
		diField = new List<DataItem>();
		filenameField = string.Empty;
		uncFilenameField = string.Empty;
	}

	public Image(List<DataItem> di = null, string filename = null, string uncFilename = null)
	{
		if (di != null)
		{
			diField = di;
		}
		else
		{
			diField = new List<DataItem>();
		}
		if (!string.IsNullOrEmpty(filename))
		{
			filenameField = filename;
		}
		else
		{
			filenameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(uncFilename))
		{
			uncFilenameField = uncFilename;
		}
		else
		{
			uncFilenameField = string.Empty;
		}
	}
}
