Exemplo n.º 1
0
        protected void OnLaunchingScenario(LaunchingScenarioEventArgs eventArgs)
        {
            EventHandler <LaunchingScenarioEventArgs> handler = LaunchingScenario;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Process the action related to scenario launching.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ProcessActionLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
        {
            // If no Tree then return
            if (Tree == null)
            {
                return;
            }

            //Gets selected node info
            List <KeyValuePair <string, Oid> > lCompleteOidPath = Tree.GetCompleteSelectedOidPath();

            lCompleteOidPath.Reverse();

            // Add the selected node info path to the custom data
            e.ExchangeInformation.CustomData.Add("_NODEPATH", lCompleteOidPath);
        }
        /// <summary>
        /// Executes the Action Item.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">TriggerEventArgs</param>
        public void Execute(object sender, TriggerEventArgs e)
        {
            try
            {
                // Validate if there are pending changes in the interaction unit
                // which contains the action item.
                CheckForPendingChangesEventArgs eventArg = new CheckForPendingChangesEventArgs();
                OnBeforeExecute(eventArg);
                if (eventArg.Cancel)
                {
                    return;
                }

                ContextRequiredEventArgs contextEventArgs = new ContextRequiredEventArgs();
                OnContextRequired(contextEventArgs);

                SelectedInstancesRequiredEventArgs lSelectedInstancesEventArgs = new SelectedInstancesRequiredEventArgs();
                OnSelectedInstancesRequired(lSelectedInstancesEventArgs);
                ExchangeInfoAction lExchangeInfoAction = null;
                if (this.IsNavigationalFilter)
                {
                    lExchangeInfoAction = new ExchangeInfoAction(ClassIUName, IUName, NavigationalFilteringIdentity, lSelectedInstancesEventArgs.SelectedInstances, contextEventArgs.Context);
                }
                else
                {
                    lExchangeInfoAction = new ExchangeInfoAction(ClassIUName, IUName, lSelectedInstancesEventArgs.SelectedInstances, contextEventArgs.Context);
                }

                // Set default order criteria
                lExchangeInfoAction.DefaultOrderCriteria = DefaultOrderCriteria;

                // Raise the event Launching Scenario.
                LaunchingScenarioEventArgs lLaunchScenarioArgs = new LaunchingScenarioEventArgs(lExchangeInfoAction);
                OnLaunchingScenario(lLaunchScenarioArgs);

                // Launch scenario.
                ScenarioManager.LaunchActionScenario(lExchangeInfoAction, this);
            }
            catch (Exception err)
            {
                ScenarioManager.LaunchErrorScenario(err);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Executes actions when scenario is launched.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
 {
     ProcessActionLaunchingScenario(sender, e);
 }
        protected void OnLaunchingScenario(LaunchingScenarioEventArgs eventArgs)
        {
            EventHandler<LaunchingScenarioEventArgs> handler = LaunchingScenario;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Executes the Action Item.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">TriggerEventArgs</param>
        public void Execute(object sender, TriggerEventArgs e)
        {
            try
            {
                // Validate if there are pending changes in the interaction unit
                // which contains the action item.
                CheckForPendingChangesEventArgs eventArg = new CheckForPendingChangesEventArgs();
                OnBeforeExecute(eventArg);
                if (eventArg.Cancel)
                {
                    return;
                }

                ContextRequiredEventArgs contextEventArgs = new ContextRequiredEventArgs();
                OnContextRequired(contextEventArgs);

                SelectedInstancesRequiredEventArgs lSelectedInstancesEventArgs = new SelectedInstancesRequiredEventArgs();
                OnSelectedInstancesRequired(lSelectedInstancesEventArgs);
                ExchangeInfoAction lExchangeInfoAction = null;
                if (this.IsNavigationalFilter)
                {
                    lExchangeInfoAction = new ExchangeInfoAction(ClassIUName, IUName, NavigationalFilteringIdentity, lSelectedInstancesEventArgs.SelectedInstances, contextEventArgs.Context);
                }
                else
                {
                    lExchangeInfoAction = new ExchangeInfoAction(ClassIUName, IUName, lSelectedInstancesEventArgs.SelectedInstances, contextEventArgs.Context);
                }

                // Set default order criteria
                lExchangeInfoAction.DefaultOrderCriteria = DefaultOrderCriteria;

                // Raise the event Launching Scenario.
                LaunchingScenarioEventArgs lLaunchScenarioArgs = new LaunchingScenarioEventArgs(lExchangeInfoAction);
                OnLaunchingScenario(lLaunchScenarioArgs);

                // Launch scenario.
                ScenarioManager.LaunchActionScenario(lExchangeInfoAction, this);
            }
            catch (Exception err)
            {
                ScenarioManager.LaunchErrorScenario(err);
            }
        }
 private void HandleNavigationItemLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
 {
     // Propagate the Event
     OnLaunchingScenario(e);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Executes actions when scenario is launched.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
 {
     ProcessActionLaunchingScenario(sender, e);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Process the action related to scenario launching.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ProcessActionLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
        {
            // If no Tree then return
            if (Tree == null)
            {
                return;
            }

            //Gets selected node info
            List<KeyValuePair<string, Oid>> lCompleteOidPath = Tree.GetCompleteSelectedOidPath();
            lCompleteOidPath.Reverse();

            // Add the selected node info path to the custom data
            e.ExchangeInformation.CustomData.Add("_NODEPATH", lCompleteOidPath);
        }
Exemplo n.º 10
0
 private void HandleActionItemLaunchingScenario(object sender, LaunchingScenarioEventArgs e)
 {
     // Propagate the Event
     OnLaunchingScenario(e);
 }