public Add(DictionaryEditor father) { InitializeComponent(); initializeComponentContents(); this.father = father; this.Left = father.Left + father.Width / 2 - this.Width / 2; this.Top = father.Top + father.Height / 2 - this.Height / 2; LanguageChangedNotifier.getInstance().addListener(this); }
public Delete(DictionaryEditor father) { InitializeComponent(); initializeComponentContents(); this.father = father; this.Left = father.Left + father.Width / 2 - this.Width / 2; this.Top = father.Top + father.Height / 2 - this.Height / 2; LanguageChangedNotifier.getInstance().addListener(this); if (father.dataGrid.SelectedCells.Count != 0) { chInput.Text = ((TransDataModel)father.dataGrid.SelectedCells[0].Item).chinese; enInput.Text = ((TransDataModel)father.dataGrid.SelectedCells[0].Item).english; id = ((TransDataModel)father.dataGrid.SelectedCells[0].Item).id; } else { new Alert( translator.getComponentTranslation(new String[] { "Please", "Choose", "One", "Row" }) + "!", father).ShowDialog(); this.Close(); } }