using System;
using System.Xml.Serialization;

namespace QC.QMine.QMineInterface;

[Serializable]
[XmlInclude(typeof(FileItem))]
[XmlInclude(typeof(FolderItem))]
public class FileSystemItem : BindableObject
{
	private string fullPath;

	private bool isSelected;

	public virtual string ItemName => string.Empty;

	public string FullPath
	{
		get
		{
			return fullPath;
		}
		set
		{
			if (!(fullPath == value))
			{
				fullPath = value;
				OnPropertyChanged("FullPath");
			}
		}
	}

	public bool IsSelected
	{
		get
		{
			return isSelected;
		}
		set
		{
			if (isSelected != value)
			{
				isSelected = value;
				OnPropertyChanged("IsSelected");
			}
		}
	}

	public override string ToString()
	{
		return FullPath;
	}

	public override void Changed(string changedFieldName)
	{
		if (changedFieldName != "IsSelected")
		{
			base.Changed(changedFieldName);
		}
	}
}
