Exemple #1
0
        private void Layers_Changed(Object sender, XObjectChangeEventArgs cea)
        {
            if (layers.Nodes().Count() > 0)
            {
                toolStripButtonUndoLast.Enabled = true;
                toolStripButtonUndoAll.Enabled  = true;
            }
            else
            {
                toolStripButtonUndoLast.Enabled = false;
                toolStripButtonUndoAll.Enabled  = false;
            }

            toolStripButtonSave.Enabled = true;

            if (instance != null)
            {
                instance.Deactivate();
                //instances.Add(instance);
                instance = this.GetPlugin(currentPlugin);
                this.ActivateToolInstance();
            }

            //this.RedrawLayers();
            this.DrawLayers();
        }
Exemple #2
0
        void ToolStripButtonPointerClick(object sender, EventArgs e)
        {
            this.DeselectTools();

            if (instance != null)
            {
                instance.Deactivate();
                instance = null;
            }
        }
Exemple #3
0
        void ToolSelected(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            this.DeselectTools();

            item.Checked = true;

            if (instance != null)
            {
                instance.Deactivate();
            }

            currentPlugin = item.Text;
            instance      = this.GetPlugin(currentPlugin);
            this.ActivateToolInstance();
        }
Exemple #4
0
        //
        // Events
        //

        // Delete Layers

        void ToolStripButtonUndoLastClick(object sender, EventArgs e)
        {
            layers.Changed -= layersChanged;
            //layers.Elements("layer").Last().Remove();

            int  i   = (from c in layers.Elements("layer").Attributes("count") select(int) c).Max();
            Guid uid = (from c in layers.Elements("layer") where (int)c.Attribute("count") == i select(Guid) c.Attribute("uid")).First();

            (from c in layers.Elements("layer") where (int)c.Attribute("count") == i select c).Remove();

            layers.Changed += layersChanged;

            //instances.RemoveAt(layers.Nodes().Count());

            instances.Remove((from c in instances where c.UID == uid select c).First());
            panel.DisplayedUIDs.Remove(uid);

            if (instance != null)
            {
                instance.Deactivate();

                instance = this.GetPlugin(currentPlugin);
            }

            //this.RedrawLayers();
            this.DrawLayers();
            this.ActivateToolInstance();

            if (layers.Nodes().Count() == 0)
            {
                toolStripButtonUndoLast.Enabled = false;
                toolStripButtonUndoAll.Enabled  = false;
            }

            toolStripButtonSave.Enabled = true;
        }