/// <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); } }
/// <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); }
/// <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); } }
/// <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); }
/// <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); } }
/// <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); }