using QC.QsprShared.Trace;

namespace QC.QsprShared.GlobalData;

public class TreeRegistrationStatus
{
	public delegate void OnRegistrationChanged();

	private bool treeConfigChanged;

	private bool treeChanged;

	private bool parameterAttributeChanged;

	private bool registryChanged;

	private bool synchronized;

	private bool treeSelectionChanged;

	private bool treeNodeDeleted;

	private bool pluginDataChanged;

	private bool linkedTreeChanged;

	public bool loopSelectionChanged;

	public bool loopRowDeleted;

	public bool loopValueChanged;

	public bool loopChanged;

	public OnRegistrationChanged RegistrationChanged;

	public bool TreeConfigChanged
	{
		get
		{
			return treeConfigChanged;
		}
		set
		{
			treeConfigChanged = value;
			FireChangedEvent();
		}
	}

	public bool TreeChanged
	{
		get
		{
			return treeChanged;
		}
		set
		{
			treeChanged = value;
			FireChangedEvent();
		}
	}

	public bool ParameterAttributeChanged
	{
		get
		{
			return parameterAttributeChanged;
		}
		set
		{
			parameterAttributeChanged = value;
			FireChangedEvent();
		}
	}

	public bool RegistryChanged
	{
		get
		{
			return registryChanged;
		}
		set
		{
			registryChanged = value;
			FireChangedEvent();
		}
	}

	public bool Synchronized
	{
		get
		{
			return synchronized;
		}
		set
		{
			synchronized = value;
			FireChangedEvent();
		}
	}

	public bool TreeSelectionChanged
	{
		get
		{
			return treeSelectionChanged;
		}
		set
		{
			treeSelectionChanged = value;
			FireChangedEvent();
		}
	}

	public bool TreeNodeDeleted
	{
		get
		{
			return treeNodeDeleted;
		}
		set
		{
			treeNodeDeleted = value;
			FireChangedEvent();
		}
	}

	public bool PluginDataChanged
	{
		get
		{
			return pluginDataChanged;
		}
		set
		{
			pluginDataChanged = value;
			FireChangedEvent();
		}
	}

	public bool LinkedTreeChanged
	{
		get
		{
			return linkedTreeChanged;
		}
		set
		{
			linkedTreeChanged = value;
			FireChangedEvent();
		}
	}

	public bool LoopSelectionChanged
	{
		get
		{
			return loopSelectionChanged;
		}
		set
		{
			loopSelectionChanged = value;
			FireChangedEvent();
		}
	}

	public bool LoopRowDeleted
	{
		get
		{
			return loopRowDeleted;
		}
		set
		{
			loopRowDeleted = value;
			FireChangedEvent();
		}
	}

	public bool LoopValueChanged
	{
		get
		{
			return loopValueChanged;
		}
		set
		{
			loopValueChanged = value;
			FireChangedEvent();
		}
	}

	public bool LoopChanged
	{
		get
		{
			return loopChanged;
		}
		set
		{
			loopChanged = value;
			FireChangedEvent();
		}
	}

	private void FireChangedEvent()
	{
		if (RegistrationChanged != null)
		{
			RegistrationChanged();
		}
	}

	public void Reset()
	{
		TraceMessage.Write(ToString(), "Reset()", TraceMessageType.Trace);
		TreeConfigChanged = false;
		TreeChanged = false;
		ParameterAttributeChanged = false;
		RegistryChanged = false;
		Synchronized = false;
		TreeSelectionChanged = false;
		TreeNodeDeleted = false;
		PluginDataChanged = false;
		LinkedTreeChanged = false;
		LoopSelectionChanged = false;
		LoopChanged = false;
		LoopRowDeleted = false;
		LoopValueChanged = false;
	}
}
