示例#1
0
 private void NodeEditor_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         this._ConnectionSeeker     = null;
         this._ConnectionInProgress = false;
         this.PaintTimer.Enabled    = false;
         this.Invalidate();
     }
 }
示例#2
0
 private void NodeOutputConnector_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         for (int i = 0; i < this._Outputs.Count; i++)
         {
             this._Outputs[i]._Input = null;
             this._Outputs[i].InvalidateConnectors();
         }
         this._Outputs.Clear();
         InvalidateConnectors();
         this._Holder.EditorHolder.Invalidate();
     }
 }
示例#3
0
        private void Connect_Output_Click(object sender, EventArgs e)
        {
            MouseEventArgs me = e as MouseEventArgs;

            if (me.Button == MouseButtons.Right)
            {
                this._ConnectionSeeker     = null;
                this._ConnectionInProgress = false;
                this.PaintTimer.Enabled    = false;
                return;
            }
            Control   SenderAsControl = sender as Control;
            NodeValue Output          = SenderAsControl.Tag as NodeValue;

            if (this._ConnectionInProgress && this._SeekType == 0)
            {
                if (Output.Holder == this._ConnectionSeeker.Holder)
                {
                    this._ConnectionSeeker     = null;
                    this._ConnectionInProgress = false;
                    this.PaintTimer.Enabled    = false;
                    return;
                }
                if (this._ConnectionSeeker.Input != null)
                {
                    this._ConnectionSeeker.Input.Outputs.Remove(this._ConnectionSeeker);
                    this._ConnectionSeeker.Input.Holder.Invalidate();
                }
                this._ConnectionSeeker.Input = Output;
                Output.Outputs.Add(this._ConnectionSeeker);
                this._ConnectionSeeker.InvalidateConnectors();
                this._ConnectionSeeker     = null;
                this._ConnectionInProgress = false;
                this.PaintTimer.Enabled    = false;
                SenderAsControl.Invalidate();
                this.Invalidate();
            }
            else if (!this._ConnectionInProgress)
            {
                this._ConnectionInProgress = true;
                this.PaintTimer.Enabled    = true;
                this._ConnectionSeeker     = Output;
                this._SeekType             = 1;
            }
            else
            {
            }
        }
示例#4
0
 public void AddNodeValue(NodeValue NewNodeValue)
 {
     NewNodeValue.Dock = DockStyle.Top;
     NewNodeValue.SetEvents(Node_MouseDown, Node_MouseUp, Node_MouseMove);
     if (NewNodeValue.HasInput)
     {
         this._Inputs.Add(NewNodeValue);
     }
     else if (NewNodeValue.HasOutput)
     {
         this._Outputs.Add(NewNodeValue);
     }
     NewNodeValue.NodeValueIndex = this._Values.Count;
     NewNodeValue.Holder         = this;
     this._Values.Add(NewNodeValue);
     this.Size = new Size(this.Width, this.Height + 20);
     this.Controls.Add(NewNodeValue);
     NewNodeValue.BringToFront();
 }
示例#5
0
 private void NodeInputConnector_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (this._Input == null)
         {
             return;
         }
         if (!this._Input.Outputs.Contains(this))
         {
             return;
         }
         this._Input._Outputs.Remove(this);
         this._Input.InvalidateConnectors();
         this._Input = null;
         InvalidateConnectors();
         this._Holder.EditorHolder.Invalidate();
     }
 }
示例#6
0
 public void OnUpdate(NodeValue sender)
 {
 }
示例#7
0
 public void OnChildrenUpdate(NodeValue Sender)
 {
     this.NodeUpdate.Invoke(Sender);
 }