Exemplo n.º 1
0
        public static void Redo_Action(Visual_Flow_Form form)
        {
            Subchart current = form.selectedTabMaybeNull();

            if (num_redo > 0 && current != null)
            {
                Action this_action = ((Action)Redo_array[num_redo - 1]);
                Action undo_action;
                undo_action       = new Action();
                undo_action.kind  = this_action.kind;
                undo_action.chart = this_action.chart;
                switch (this_action.kind)
                {
                case Action_Kind.Rename_Tab:
                    undo_action.old_name = this_action.old_name;
                    undo_action.new_name = this_action.new_name;
                    Add_Undo_Action(undo_action, form);

                    this_action.chart.Text = this_action.new_name;
                    form.Rename_Tab(this_action.old_name, this_action.new_name);
                    form.carlisle.SelectedTab = this_action.chart;
                    break;

                case Action_Kind.Add_Tab:
                    Add_Undo_Action(undo_action, form);

                    form.carlisle.TabPages.Add(this_action.chart);
                    form.carlisle.SelectedTab = this_action.chart;
                    break;

                case Action_Kind.Delete_Tab:
                    Add_Undo_Action(undo_action, form);

                    form.carlisle.TabPages.Remove(this_action.chart);
                    break;

                case Action_Kind.Change_Tab:
                    undo_action.clone = this_action.chart.Start.Clone();
                    bool was_enabled = true;
                    if (!Component.BARTPE && !Component.VM && !Component.MONO)
                    {
                        was_enabled = this_action.chart.tab_overlay.Enabled;
                        this_action.chart.tab_overlay.Enabled = false;
                        undo_action.ink = this_action.chart.tab_overlay.Ink.Clone();
                    }
                    Add_Undo_Action(undo_action, form);

                    this_action.chart.Start = (Oval)this_action.clone.Clone();
                    if (!Component.BARTPE && !Component.VM && !Component.MONO)
                    {
                        this_action.chart.tab_overlay.Ink     = this_action.ink.Clone();
                        this_action.chart.tab_overlay.Enabled = was_enabled;
                    }
                    this_action.chart.Start.scale = form.scale;
                    this_action.chart.Start.Scale(form.scale);
                    form.my_layout();
                    form.Current_Selection = current.Start.select(-1000, -1000);
                    this_action.chart.flow_panel.Invalidate();
                    (this_action.chart.Parent as System.Windows.Forms.TabControl).SelectedTab = this_action.chart;
                    if (this_action.chart.Parent != form.carlisle)
                    {
                        form.carlisle.SelectedTab = this_action.chart.Parent.Parent as System.Windows.Forms.TabPage;
                    }
                    //form.carlisle.SelectedTab=this_action.chart;
                    break;
                }

                Decrement_Redoable(form);
            }
        }