using System;
using System.Collections;
using QC.QTMDotNetKernelInterface.Environment;

namespace QC.QTMDotNetKernel.Registry;

public class TestRegistry : MarshalByRefObject
{
	private Hashtable assemblies = new Hashtable();

	private QSPREnvironment environment;

	public QSPREnvironment Environment
	{
		get
		{
			return environment;
		}
		set
		{
			environment = value;
		}
	}

	public Hashtable Assemblies
	{
		get
		{
			return assemblies;
		}
		set
		{
			assemblies = value;
		}
	}

	public bool Add(TestAssembly testAssembly)
	{
		try
		{
			if (!assemblies.Contains(testAssembly.Name))
			{
				assemblies.Add(testAssembly.Name, testAssembly);
				testAssembly.Parent = this;
				return true;
			}
			return true;
		}
		catch
		{
		}
		return false;
	}

	public bool Remove(string assemblyName)
	{
		try
		{
			if (assemblies.Contains(assemblyName))
			{
				assemblies.Remove(assemblyName);
				return true;
			}
		}
		catch
		{
		}
		return false;
	}
}
