protected virtual void OnNodeActionsCreated(NodeActionsEventArgs e)
 {
     if (NodeActionsCreated != null)
     {
         NodeActionsCreated(this, e);
     }
 }
 void BaseTree_NodeActionsCreated(object sender, NodeActionsEventArgs e)
 {
     if (sender is loadDictionary)
     {
         e.AllowedActions.Add(ContextMenuSeperator.Instance);
         e.AllowedActions.Add(DictionaryItemsExportAction.Instance);
         e.AllowedActions.Add(DictionaryItemsImportAction.Instance);
     }
 }
        /// <summary>
        /// This method creates the AllowedActions IAction list for the tree's nodes.
        /// Inheritors can override this method to create their own Context menu.
        /// </summary>
        /// <param name="actions"></param>
        protected virtual void CreateAllowedActions(ref List <IAction> actions)
        {
            actions.Add(ActionDelete.Instance);

            //raise the event, allow developers to modify the collection
            var e = new NodeActionsEventArgs(false, actions);

            OnNodeActionsCreated(e);
            actions = e.AllowedActions;
        }
        /// <summary>
        /// Initializes the class if it hasn't been done already
        /// </summary>
        protected void Initialize()
        {
            if (!m_isInitialized)
            {
                //VERY IMPORTANT! otherwise it will go infinite loop!
                m_isInitialized = true;

                CreateAllowedActions(); //first create the allowed actions

                //raise the event, allow developers to modify the collection
                var nodeActions = new NodeActionsEventArgs(false, m_allowedActions);
                OnNodeActionsCreated(nodeActions);
                m_allowedActions = nodeActions.AllowedActions;

                CreateRootNodeActions();//then create the root node actions

                var rootActions = new NodeActionsEventArgs(true, m_initActions);
                OnNodeActionsCreated(rootActions);
                m_initActions = rootActions.AllowedActions;

                CreateRootNode(); //finally, create the root node itself
            }
        }
Example #5
0
 protected virtual void OnNodeActionsCreated(NodeActionsEventArgs e)
 {
     if (NodeActionsCreated != null)
         NodeActionsCreated(this, e);
 }
Example #6
0
        /// <summary>
        /// This method creates the AllowedActions IAction list for the tree's nodes.
        /// Inheritors can override this method to create their own Context menu.
        /// </summary>
        /// <param name="actions"></param>
        protected virtual void CreateAllowedActions(ref List<IAction> actions)
        {
            actions.Add(ActionDelete.Instance);

            //raise the event, allow developers to modify the collection
            var e = new NodeActionsEventArgs(false, actions);
            OnNodeActionsCreated(e);
            actions = e.AllowedActions;

        }
Example #7
0
        /// <summary>
        /// Initializes the class if it hasn't been done already
        /// </summary>
        protected void Initialize()
        {
            if (!m_isInitialized)
            {
                //VERY IMPORTANT! otherwise it will go infinite loop!
                m_isInitialized = true;

                CreateAllowedActions(); //first create the allowed actions
                
                //raise the event, allow developers to modify the collection
                var nodeActions = new NodeActionsEventArgs(false, m_allowedActions);
                OnNodeActionsCreated(nodeActions);
                m_allowedActions = nodeActions.AllowedActions;

                CreateRootNodeActions();//then create the root node actions

                var rootActions = new NodeActionsEventArgs(true, m_initActions);
                OnNodeActionsCreated(rootActions);
                m_initActions = rootActions.AllowedActions;

                CreateRootNode(); //finally, create the root node itself
            }            
        }
Example #8
0
 protected override void OnNodeActionsCreated(NodeActionsEventArgs e)
 {
     base.OnNodeActionsCreated(e);
 }
Example #9
0
 protected override void OnNodeActionsCreated(NodeActionsEventArgs e)
 {
     //e.AllowedActions.Clear();
     base.OnNodeActionsCreated(e);
 }
Example #10
0
 protected override void OnNodeActionsCreated(NodeActionsEventArgs e)
 {
     if (e.IsRoot)
     {
         e.AllowedActions.Clear();
         e.AllowedActions.Add(ActionRefresh.Instance);
     }
     base.OnNodeActionsCreated(e);
 }