using System.Windows;
using System.Windows.Markup;

namespace QFDT;

public partial class Clone : Window, IComponentConnector
{
	public enum ExitState
	{
		OK,
		Cancel
	}

	private ExitState exitState = ExitState.Cancel;

	public Clone()
	{
		InitializeComponent();
	}

	public void SetName(string originalName)
	{
		OriginalName.Text = originalName;
		NewName.Text = originalName + "_copy";
	}

	public string GetNewName()
	{
		return NewName.Text;
	}

	public ExitState GetExitState()
	{
		return exitState;
	}

	private void bnOK_Click(object sender, RoutedEventArgs e)
	{
		exitState = ExitState.OK;
		Close();
	}

	private void bnCancel_Click(object sender, RoutedEventArgs e)
	{
		exitState = ExitState.Cancel;
		Close();
	}
}
