private void Okay_Click(object sender, EventArgs e) { DepartmentInterface new_dept = listBox1.SelectedItem as DepartmentInterface; POSButtonInterface tmp_button = button; if (new_dept != dept) { tmp_button = new_dept.GetItemForButton(real_button); } if (tmp_button == null) { MessageBox.Show("Failed to get button from department"); } if (tmp_button.Configure()) { real_button.department = new_dept; real_button.button = tmp_button; this.DialogResult = DialogResult.OK; this.Close(); } else { } }
public ConfigureItemButton(POS_ItemButton real_button, DepartmentInterface dept, POSButtonInterface button) { this.dept = dept; this.button = button; this.real_button = real_button; InitializeComponent(); }
bool IReflectorPersistance.Load(System.Xml.XPath.XPathNavigator r) { if (r.Name == "Department") { foreach (DepartmentInterface dept in POS.Local.Departments) { if (dept.ToString() == r.Value) { department = dept; break; } } if (r.MoveToFirstChild()) { button = department.GetItemForButton(this); button.Load(r); r.MoveToParent(); } return(true); } return(false); }