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(); }
static bool LoadDepartments(osalot.AssemblyTracker tracker, Type[] assembly_types) { bool useful = false; foreach (Type t in assembly_types) { Type[] interfaces; interfaces = t.FindInterfaces(MyInterfaceFilter, "DepartmentInterface"); if (interfaces.Length > 0) { DepartmentInterface Department = Activator.CreateInstance(t) as DepartmentInterface; useful = true; Departments.Add(Department); } } return(useful); }
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); }
private void button1_Click(object sender, EventArgs e) { DepartmentInterface new_dept = listBox1.SelectedItem as DepartmentInterface; new_dept.Configure(); }
public DeptBL(DepartmentInterface department) { _department = department; }