Example #1
0
        /// <summary>
        /// Method to handle when a child has been selected from a node
        /// </summary>
        /// <param name="sender">Sender of this Event</param>
        /// <param name="e">Event Arguments</param>
        private void NodeButtonClicked(Object sender, EventArgs e)
        {
            ToolStripItem tsb = sender as ToolStripItem;

            if (tsb != null)
            {
                //check we have the right tag type
                if (tsb.Tag != null && tsb.Tag.GetType() == rootNode.GetType())
                {
                    //set the current node
                    currentNode = (IAddressNode)tsb.Tag;

                    //update the address bar
                    UpdateBar();

                    //if the selection changed event is handled
                    if (SelectionChange != null)
                    {
                        //throw the event
                        NodeChangedArgs nca = new NodeChangedArgs(currentNode.UniqueID);
                        SelectionChange(this, nca);
                    }
                }

                return;
            }
        }
Example #2
0
        /// <summary>
        /// Method to handle when a node is double clicked
        /// </summary>
        /// <param name="sender">Sender of this event</param>
        /// <param name="e">Event arguments</param>
        private void NodeDoubleClickHandler(Object sender, EventArgs e)
        {
            //check we are handlign the double click event
            if (NodeDoubleClick != null && sender.GetType() == typeof(ToolStripButton))
            {
                //get the node from the tag
                currentNode = (IAddressNode)((ToolStripButton)sender).Tag;

                //create the node changed event arguments
                NodeChangedArgs nca = new NodeChangedArgs(currentNode.UniqueID);

                //fire the event
                NodeDoubleClick(this, nca);
            }
        }