예제 #1
0
        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
            {
            }
        }
예제 #2
0
 public ConfigureItemButton(POS_ItemButton real_button, DepartmentInterface dept, POSButtonInterface button)
 {
     this.dept        = dept;
     this.button      = button;
     this.real_button = real_button;
     InitializeComponent();
 }
예제 #3
0
            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);
            }
예제 #4
0
        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);
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            DepartmentInterface new_dept = listBox1.SelectedItem as DepartmentInterface;

            new_dept.Configure();
        }
예제 #6
0
 public DeptBL(DepartmentInterface department)
 {
     _department = department;
 }