Пример #1
0
        /// <summary>
        /// Raises the RefreshNodeRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnRefreshRequired(RefreshNodeRequiredEventArgs eventArgs)
        {
            EventHandler <RefreshNodeRequiredEventArgs> handler = RefreshRequired;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Пример #2
0
 /// <summary>
 /// Executes actions related to node refreshment.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleSubNodeRefreshRequired(object sender, RefreshNodeRequiredEventArgs e)
 {
     // Propagate the event
     OnRefreshRequired(e);
 }
Пример #3
0
 /// <summary>
 /// Raises the RefreshNodeRequired event
 /// </summary>
 /// <param name="eventArgs"></param>
 protected void OnRefreshRequired(RefreshNodeRequiredEventArgs eventArgs)
 {
     EventHandler<RefreshNodeRequiredEventArgs> handler = RefreshRequired;
     if (handler != null)
     {
         handler(this, eventArgs);
     }
 }
Пример #4
0
 /// <summary>
 /// Executes actions related to node refreshment.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleSubNodeRefreshRequired(object sender, RefreshNodeRequiredEventArgs e)
 {
     // Propagate the event
     OnRefreshRequired(e);
 }
Пример #5
0
        /// <summary>
        /// Process the Refresh Required event from one root node. Based on the received information, refresh one instance or a complete tree branch
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void ProcessRootNodeRefreshRequired(object sender, RefreshNodeRequiredEventArgs e)
        {
            // Refresh instance
            if (e.RefreshType == RefreshRequiredType.RefreshInstances)
            {
                RefreshOidList(e.NodeId, ((RefreshRequiredInstancesEventArgs)e.RefreshRequiredArgs).Instances);
                return;
            }

            // It is not an instance refresh, it is a complete branch refresh
            if (e.ReceivedExchangeInfo == null)
            {
                return;
            }

            List<KeyValuePair<string, Oid>> lOidsPath = e.ReceivedExchangeInfo.CustomData["_NODEPATH"] as List<KeyValuePair<string, Oid>>;
            if (lOidsPath == null)
            {
                return;
            }

            TreeNodeController lNode = GetNodeById(e.NodeId);
            if (lNode == null)
            {
                return;
            }

            if (lOidsPath != null && lOidsPath.Count <= 1)
            {
                // If there are not Oids loaded, load the data by means of refreshing the Tree.
                if (this.InstanceMasterController != null)
                {
                    this.InstanceMasterController.Refresh();
                    return;
                }
                Refresh();
            }
            else
            {
                // If there are Oids loaded, update them.
                UpdateBranch(lOidsPath, lNode);
            }
        }
Пример #6
0
 /// <summary>
 /// Executes actions related to RefreshRequired event for root nodes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleRootNodeRefreshRequired(object sender, RefreshNodeRequiredEventArgs e)
 {
     ProcessRootNodeRefreshRequired(sender, e);
 }