/// <summary>
 /// Initializes a new instance of 'RefreshNodeRequiredEventArgs'.
 /// Used to request a refresh from one Tree node
 /// </summary>
 public RefreshNodeRequiredEventArgs(string nodeId, RefreshRequiredEventArgs refreshRequiredArgs)
     : base(refreshRequiredArgs.ReceivedExchangeInfo)
 {
     RefreshType          = refreshRequiredArgs.RefreshType;
     mNodeId              = nodeId;
     mRefreshRequiredArgs = refreshRequiredArgs;
 }
 /// <summary>
 /// Initializes a new instance of 'RefreshNodeRequiredEventArgs'.
 /// Used to request a refresh from one Tree node
 /// </summary>
 public RefreshNodeRequiredEventArgs(string nodeId, RefreshRequiredEventArgs refreshRequiredArgs)
     : base(refreshRequiredArgs.ReceivedExchangeInfo)
 {
     RefreshType = refreshRequiredArgs.RefreshType;
     mNodeId = nodeId;
     mRefreshRequiredArgs = refreshRequiredArgs;
 }
Example #3
0
        /// <summary>
        /// Raises the RefreshRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnRefreshRequired(RefreshRequiredEventArgs eventArgs)
        {
            EventHandler <RefreshRequiredEventArgs> handler = RefreshRequired;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
 /// <summary>
 /// Handles the Refesh instance event from a navigation scenario
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     if (RefreshInstanceFromNavigation)
     {
         //List<Oid> oidList = new List<Oid>();
         //oidList.Add(e.CurrentOid);
         OnRefreshRequired(e);
     }
 }
        /// <summary>
        /// This method refreshes the parent controller after the succesfull execution of a service.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">ServiceResultEventArgs</param>
        private void HandleServiceResponse(object sender, ServiceResultEventArgs e)
        {
            // If the service has been executed succesfully, refresh the Parent controller.
            if (e.Success)
            {
                // Refresh the Master.
                if (RefreshMaster)
                {
                    RefreshRequiredMasterEventArgs eventArgsRefreshMaster = new RefreshRequiredMasterEventArgs(e.ExchangeInfoReceived);
                    // Main scenario must be closed or not
                    eventArgsRefreshMaster.CloseScenario = CloseScenario;
                    OnRefreshRequired(eventArgsRefreshMaster);
                    // If Master has been refreshed, do nothing.
                    if (eventArgsRefreshMaster.RefreshDone)
                    {
                        return;
                    }
                }
                // Refresh mode. Depending on the local flag, the number of intances, the service type and its definition class:
                //  If the service type is not Creation and its definition class is the same as the selected instances class,
                //  then refresh only the selected instances. The number of selected instances has to be lesser or equals than 5.
                //  Other case, refresh complete population.
                RefreshRequiredEventArgs eventArgs = new RefreshRequiredEventArgs(e.ExchangeInfoReceived);

                if (RefreshByRow &&
                    e.ExchangeInfoReceived != null &&
                    ActionItemType != ActionItemType.Creation &&
                    e.ExchangeInfoReceived.SelectedOids != null &&
                    e.ExchangeInfoReceived.SelectedOids.Count > 0 &&
                    e.ExchangeInfoReceived.SelectedOids.Count < 5)
                {
                    string lInstancesClass = e.ExchangeInfoReceived.SelectedOids[0].ClassName;
                    if (lInstancesClass.Equals(this.ClassIUName, StringComparison.OrdinalIgnoreCase))
                    {
                        eventArgs = new RefreshRequiredInstancesEventArgs(e.ExchangeInfoReceived.SelectedOids, e.ExchangeInfoReceived);
                    }
                }

                // Main scenario must be closed or not
                eventArgs.CloseScenario = CloseScenario;

                // Raise the event.
                OnRefreshRequired(eventArgs);
            }
        }
 /// <summary>
 /// Executes actions related to refreshment of Actions execution.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     ProcessActionRefreshRequired(sender, e);
 }
        /// <summary>
        /// This method refreshes the parent controller after the succesfull execution of a service.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">ServiceResultEventArgs</param>
        private void HandleServiceResponse(object sender, ServiceResultEventArgs e)
        {
            // If the service has been executed succesfully, refresh the Parent controller.
            if (e.Success)
            {
                // Refresh the Master.
                if (RefreshMaster)
                {
                    RefreshRequiredMasterEventArgs eventArgsRefreshMaster = new RefreshRequiredMasterEventArgs(e.ExchangeInfoReceived);
                    // Main scenario must be closed or not
                    eventArgsRefreshMaster.CloseScenario = CloseScenario;
                    OnRefreshRequired(eventArgsRefreshMaster);
                    // If Master has been refreshed, do nothing.
                    if (eventArgsRefreshMaster.RefreshDone)
                    {
                        return;
                    }
                }
                // Refresh mode. Depending on the local flag, the number of intances, the service type and its definition class:
                //  If the service type is not Creation and its definition class is the same as the selected instances class,
                //  then refresh only the selected instances. The number of selected instances has to be lesser or equals than 5.
                //  Other case, refresh complete population.
                RefreshRequiredEventArgs eventArgs = new RefreshRequiredEventArgs(e.ExchangeInfoReceived);

                if (RefreshByRow &&
                    e.ExchangeInfoReceived != null &&
                    ActionItemType != ActionItemType.Creation &&
                    e.ExchangeInfoReceived.SelectedOids != null &&
                    e.ExchangeInfoReceived.SelectedOids.Count > 0 &&
                    e.ExchangeInfoReceived.SelectedOids.Count < 5)
                {
                    string lInstancesClass = e.ExchangeInfoReceived.SelectedOids[0].ClassName;
                    if (lInstancesClass.Equals(this.ClassIUName, StringComparison.OrdinalIgnoreCase))
                    {
                        eventArgs = new RefreshRequiredInstancesEventArgs(e.ExchangeInfoReceived.SelectedOids, e.ExchangeInfoReceived);
                    }
                }

                // Main scenario must be closed or not
                eventArgs.CloseScenario = CloseScenario;

                // Raise the event.
                OnRefreshRequired(eventArgs);
            }
        }
 /// <summary>
 /// Event raised when an instance has been refreshed.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">RefreshInstanceArgs arguments.</param>
 private void HandleRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     OnRefreshRequired(e);
 }
        /// <summary>
        /// Raises the RefreshRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnRefreshRequired(RefreshRequiredEventArgs eventArgs)
        {
            EventHandler<RefreshRequiredEventArgs> handler = RefreshRequired;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
 private void HandleNavigationItemRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     // Propagate the Event
     OnRefreshRequired(e);
 }
 /// <summary>
 /// Process the action related with the refreshment of Actions execution
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     // Propagate the event
     OnRefreshRequired(new RefreshNodeRequiredEventArgs(NodeId, e));
 }
        /// <summary>
        /// Process the refresh required from navigation
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void ProcessNavigationRefreshRequired(object sender, RefreshRequiredEventArgs e)
        {
            // Refresh Master
            RefreshRequiredMasterEventArgs lArgs = new RefreshRequiredMasterEventArgs(Context.ExchangeInformation);
            OnRefreshMasterRequired(lArgs);
            // If refresh has been done, do nothing
            if (lArgs.RefreshDone)
                return;

            // Default refresh
            ProcessActionRefreshRequired(sender, e);
        }
 /// <summary>
 /// Handles the Refesh instance event from a navigation scenario
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     if (RefreshInstanceFromNavigation)
     {
         //List<Oid> oidList = new List<Oid>();
         //oidList.Add(e.CurrentOid);
         OnRefreshRequired(e);
     }
 }
Example #14
0
 /// <summary>
 /// Handles the Action Item RefreshRequired Event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionItemRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     // Propagate the Event
     OnRefreshRequired(e);
 }
 /// <summary>
 /// Event raised when an instance has been refreshed.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">RefreshInstanceArgs arguments.</param>
 private void HandleRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     OnRefreshRequired(e);
 }
 /// <summary>
 /// Process the action related with the refreshment of Actions execution
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     // Propagate the event
     OnRefreshRequired(new RefreshNodeRequiredEventArgs(NodeId, e));
 }
 /// <summary>
 /// Executes actions related to refreshment of Actions execution.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionRefreshRequired(object sender, RefreshRequiredEventArgs e)
 {
     ProcessActionRefreshRequired(sender, e);
 }
        /// <summary>
        /// Refresh the corresponding instance, depends on the received parameter
        /// </summary>
        /// <param name="e"></param>
        protected virtual void ProcessActionRefreshRequired(object sender, RefreshRequiredEventArgs e)
        {
            if (e.RefreshType == RefreshRequiredType.RefreshMaster)
            {
                OnRefreshMasterRequired((RefreshRequiredMasterEventArgs)e);
            }
            else
            {
                if (this.Context.ContextType == ContextType.Population &&
                    e.RefreshType == RefreshRequiredType.RefreshInstances)
                {
                    if (((RefreshRequiredInstancesEventArgs)e).Instances.Count == 1)
                    {
                        RefreshThisOid(((RefreshRequiredInstancesEventArgs)e).Instances[0]);
                    }
                    else
                    {
                        RefreshOidList(((RefreshRequiredInstancesEventArgs)e).Instances);
                    }
                }
                else
                {
                    // Last case, refresh all the population
                    Refresh();
                }

                //  Refresh the navigation origin
                if (Context.RelatedOids != null &&
                    Context.RelatedOids.Count == 1)
                {
                    OnRefreshRequired(new RefreshRequiredInstancesEventArgs(Context.RelatedOids, null));
                }
            }

            // If Scenario must be closed ...
            if (e.CloseScenario)
            {
                if (Scenario != null)
                {
                    CloseScenario();
                }
                else
                {
                    OnCloseMainScenario(new EventArgs());
                }
            }
        }