Ejemplo n.º 1
0
        private void OnLayoutEditorEditWare(object sender, WareBase e)
        {
            if (e is Labware)
            {
                Labware labware = e as Labware;
                if (this.ActivateEditingTab(labware.TypeName))
                {
                    return;
                }

                LabwareEditor editor = new LabwareEditor(AddInfo, this);
                editor.DataContext = labware;
                this.AddTabItem(editor);
            }
            else if (e is Carrier)
            {
                Carrier carrier = e as Carrier;
                if (this.ActivateEditingTab(carrier.TypeName))
                {
                    return;
                }

                CarrierEditor editor = new CarrierEditor(AddInfo);
                editor.DataContext = carrier;
                this.AddTabItem(editor);
            }
            else
            {
                // Bad argument
            }
        }
Ejemplo n.º 2
0
        private void NewLabware_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Labware       labware = new Labware();
            LabwareEditor editor  = new LabwareEditor(AddInfo, this);

            editor.DataContext = labware;
            this.AddTabItem(editor);
        }
Ejemplo n.º 3
0
        private void DuplicateLabware_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Labware       labware = ((Labware)this.lb_labwares.SelectedItem).Clone() as Labware;
            LabwareEditor editor  = new LabwareEditor(AddInfo, this);

            editor.DataContext = labware;
            this.AddTabItem(editor);
        }
Ejemplo n.º 4
0
        private void EditLabware_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Labware selectedLabware = e.Parameter != null? (Labware)e.Parameter: (Labware)this.lb_labwares.SelectedItem;

            if (selectedLabware == null || this.ActivateEditingTab(selectedLabware.TypeName))
            {
                return;
            }

            LabwareEditor editor = new LabwareEditor(AddInfo, this);

            selectedLabware.CalculatePositionInLayout();
            editor.DataContext = selectedLabware;
            this.AddTabItem(editor);
        }