using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Markup;

namespace QFDT;

public partial class QFDT_Setting_Dialog : Window, IComponentConnector
{
	public delegate void SetLanguage(string culture);

	private SetLanguage SetLanguageCB;

	public QFDT_Setting_Dialog()
	{
		InitializeComponent();
	}

	public void SetupCB(SetLanguage cb)
	{
		SetLanguageCB = cb;
		option1.SetLanguageCB(UpdateLanguage);
	}

	public void SetupSaveConfigurationCB(Option.SaveConfiguration cb)
	{
		option1.SaveConfigurationCB = cb;
	}

	public void UpdateLanguage(string culture)
	{
		if (SetLanguageCB != null)
		{
			SetLanguageCB(culture);
		}
	}

	private void Window_Closing(object sender, CancelEventArgs e)
	{
		((MainWindow)base.Owner).LoadTestEquipment();
		((MainWindow)base.Owner).PassEquipment();
		if (((MainWindow)base.Owner).comboProducts.SelectedIndex != -1)
		{
			((MainWindow)base.Owner).ReloadSettings();
		}
	}

	[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
	[DebuggerNonUserCode]
	internal Delegate _CreateDelegate(Type delegateType, string handler)
	{
		return Delegate.CreateDelegate(delegateType, this, handler);
	}
}
