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 MainForm : Form
	{
		/// of LanguageWord
		
		private void button__Word_LanguageWord__of__LanguageWord__Focus__Click(object sender, EventArgs e)
		{
			if (this.Current__Word_LanguageWord__of__LanguageWord == null)
			{
				return;
			}

			this.Current__Word_Language				= this.Current__Word_LanguageWord__of__LanguageWord.Word_LanguageRowParent;
			this.Current__Word						= this.Current__Word_Language.WordRowParent;
			this.Current__WordOrPattern__of__Word	= this.Current__Word.WordOrPatternRowParent;

			this.populate__Word();
		}

		private void filter__Word_LanguageWord__of__LanguageWord()
		{
			if(this.Current__Language != null)
			{
				if (this.Current__LanguageWord != null)
				{
					this.bindingSource__Word_LanguageWord__of__LanguageWord
						.Filter
						= "LanguageCode = '" 
						+ this.Current__Language.Code 
						+ "' AND LanguageWordString = '"
						+ this.Current__LanguageWord.String.Replace("'", "''")
						+ "'";
				}
				else
				{
					this.bindingSource__Word_LanguageWord__of__LanguageWord.Filter = "FALSE";
				}
			}
		}

		private void bindingSource__Word_LanguageWord__of__LanguageWord_CurrentChanged(object sender, EventArgs e)
		{
			if (this.DoNotTriggerCurrentChangedEvent)
			{
				return;
			}

			if (this.bindingSource__Word_LanguageWord__of__LanguageWord.Current != null)
			{
				this.Current__Word_LanguageWord__of__LanguageWord
					= (BabebiDataSet.Word_LanguageWordRow)(((DataRowView)(this.bindingSource__Word_LanguageWord__of__LanguageWord.Current)).Row);
			}
		}
	}
}