using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Babebi4
{
	public partial class Form__DerivatingWordType_DerivatedWordType__Update : Form
	{
		private MainForm mainForm;

		private BabebiDataSet.DerivatingWordType_DerivatedWordTypeDataTable	table__DerivatingWordType_DerivatedWordType;

		#region		ctors

		public Form__DerivatingWordType_DerivatedWordType__Update(MainForm mainForm) : this()
		{
			this.mainForm = mainForm;

			this.table__DerivatingWordType_DerivatedWordType = this.mainForm.DataSet.DerivatingWordType_DerivatedWordType;

			DerivatingWordTypeComboBoxItem focusedDerivatingWordTypeComboBoxItem;

			List<DerivatingWordTypeComboBoxItem> derivatingWordTypeComboBoxItems 
				=	DerivatingWordTypeComboBoxItem.BuildDerivatingWordTypeComboBoxItems
				(
					this.mainForm.Current__Language,
					this.mainForm.Current__DerivatingWordType_Language, 
				out focusedDerivatingWordTypeComboBoxItem
				);
			this.comboBox__DerivatingWordType_LanguageName.Items.AddRange(derivatingWordTypeComboBoxItems.ToArray());
			if (focusedDerivatingWordTypeComboBoxItem != null)
			{
				this.comboBox__DerivatingWordType_LanguageName.SelectedItem = focusedDerivatingWordTypeComboBoxItem;
			}

			List<DerivatedWordTypeComboBoxItem> derivatedWordTypeComboBoxItems = new List<DerivatedWordTypeComboBoxItem>();
			DerivatedWordTypeComboBoxItem focusedDerivatedWordTypeComboBoxItem = null;
			foreach 
			(
				BabebiDataSet.DerivatedWordType_LanguageRow derivatedWordType_language 
				in 
				this.mainForm.Current__Language.GetDerivatedWordType_LanguageRows()
			)
			{
				DerivatedWordTypeComboBoxItem derivatedWordTypeComboBoxItem = new DerivatedWordTypeComboBoxItem(derivatedWordType_language);
				derivatedWordTypeComboBoxItems.Add(derivatedWordTypeComboBoxItem);

				if (this.mainForm.Current__DerivatedWordType_Language != null && this.mainForm.Current__DerivatedWordType_Language == derivatedWordType_language)
				{
					focusedDerivatedWordTypeComboBoxItem = derivatedWordTypeComboBoxItem;
				}
			}
			this.comboBox__DerivatedWordType_LanguageName.Items.AddRange(derivatedWordTypeComboBoxItems.ToArray());
			if (focusedDerivatedWordTypeComboBoxItem != null)
			{
				this.comboBox__DerivatedWordType_LanguageName.SelectedItem = focusedDerivatedWordTypeComboBoxItem;
			}
		}

		public Form__DerivatingWordType_DerivatedWordType__Update()
		{
			InitializeComponent();
		}

		#endregion	ctors

		private void button__Update__Click(object sender, EventArgs e)
		{
		}
	}
}
