예제 #1
0
        /// <summary>
        /// Raises the ContextRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnContextRequired(ContextRequiredEventArgs eventArgs)
        {
            EventHandler <ContextRequiredEventArgs> handler = ContextRequired;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Executes a Navigation Item navigation trigger associated.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">TriggerEventArgs.</param>
        public void Execute(Object sender, TriggerEventArgs e)
        {
            try
            {
                // Update context.
                ContextRequiredEventArgs contextEventArgs = new ContextRequiredEventArgs();
                OnContextRequired(contextEventArgs);

                SelectedInstancesRequiredEventArgs lSelectedInstancesEventArgs = new SelectedInstancesRequiredEventArgs();
                OnSelectedInstancesRequired(lSelectedInstancesEventArgs);

                if ((lSelectedInstancesEventArgs.SelectedInstances != null) && (lSelectedInstancesEventArgs.SelectedInstances.Count > 0))
                {
                    // Launch scenario.
                    // Calculate the title text for the target scenario.
                    string text2Title = "";
                    if (lSelectedInstancesEventArgs.SelectedInstances.Count == 1)
                    {
                        Oid lAuxOid = lSelectedInstancesEventArgs.SelectedInstances[0];
                        if (AlternateKeyName != string.Empty)
                        {
                            lAuxOid = Logics.Logic.GetAlternateKeyFromOid(lAuxOid, AlternateKeyName);
                        }
                        text2Title = UtilFunctions.GetText2Title(TargetScenarioAlias,
                                                                 InstanceAlias,
                                                                 lAuxOid,
                                                                 DisplaySet2TargetScenario);
                    }
                    ScenarioManager.LaunchNavigationScenario(
                        new ExchangeInfoNavigation(
                            ClassIUName,
                            IUName,
                            RolePath,
                            NavigationalFilteringIdentity,
                            lSelectedInstancesEventArgs.SelectedInstances,
                            contextEventArgs.Context,
                            text2Title, DefaultOrderCriteria), this);
                }
                else
                {
                    string lMessage = CultureManager.TranslateString(LanguageConstantKeys.L_NO_SELECTION, LanguageConstantValues.L_NO_SELECTION);
                    ScenarioManager.LaunchErrorScenario(new Exception(lMessage));
                }
            }
            catch (Exception err)
            {
                ScenarioManager.LaunchErrorScenario(err);
            }
        }
        /// <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);
            }
        }
예제 #4
0
 /// <summary>
 /// Executes actions related to Actions and Navigations context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionNavigationContextRequired(object sender, ContextRequiredEventArgs e)
 {
     ProcessActionNavigationContextRequired(sender, e);
 }
예제 #5
0
 /// <summary>
 /// Executes actions related to context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleSubNodeContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the event
     OnContextRequired(e);
 }
        protected void OnContextRequired(ContextRequiredEventArgs eventArgs)
        {
            EventHandler<ContextRequiredEventArgs> handler = ContextRequired;

            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 HandleNavigationItemContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the Event
     OnContextRequired(e);
 }
예제 #9
0
 /// <summary>
 /// Executes actions related to Actions and Navigations context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionNavigationContextRequired(object sender, ContextRequiredEventArgs e)
 {
     ProcessActionNavigationContextRequired(sender, e);
 }
예제 #10
0
 /// <summary>
 /// Executes actions related to context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleSubNodeContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the event
     OnContextRequired(e);
 }
        /// <summary>
        /// Executes a Navigation Item navigation trigger associated.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">TriggerEventArgs.</param>
        public void Execute(Object sender, TriggerEventArgs e)
        {
            try
            {
                // Update context.
                ContextRequiredEventArgs contextEventArgs = new ContextRequiredEventArgs();
                OnContextRequired(contextEventArgs);

                SelectedInstancesRequiredEventArgs lSelectedInstancesEventArgs = new SelectedInstancesRequiredEventArgs();
                OnSelectedInstancesRequired(lSelectedInstancesEventArgs);

                if ((lSelectedInstancesEventArgs.SelectedInstances != null) && (lSelectedInstancesEventArgs.SelectedInstances.Count > 0))
                {
                    // Launch scenario.
                    // Calculate the title text for the target scenario.
                    string text2Title = "";
                    if (lSelectedInstancesEventArgs.SelectedInstances.Count == 1)
                    {
                        Oid lAuxOid = lSelectedInstancesEventArgs.SelectedInstances[0];
                        if (AlternateKeyName != string.Empty)
                        {
                            lAuxOid = Logics.Logic.GetAlternateKeyFromOid(lAuxOid, AlternateKeyName);
                        }
                        text2Title = UtilFunctions.GetText2Title(TargetScenarioAlias,
                                        InstanceAlias,
                                        lAuxOid,
                                        DisplaySet2TargetScenario);
                    }
                    ScenarioManager.LaunchNavigationScenario(
                        new ExchangeInfoNavigation(
                            ClassIUName,
                            IUName,
                            RolePath,
                            NavigationalFilteringIdentity,
                            lSelectedInstancesEventArgs.SelectedInstances,
                            contextEventArgs.Context,
                            text2Title, DefaultOrderCriteria), this);
                }
                else
                {
                    string lMessage = CultureManager.TranslateString(LanguageConstantKeys.L_NO_SELECTION, LanguageConstantValues.L_NO_SELECTION);
                    ScenarioManager.LaunchErrorScenario(new Exception(lMessage));
                }
            }
            catch (Exception err)
            {
                ScenarioManager.LaunchErrorScenario(err);
            }
        }
예제 #12
0
 private void HandleActionItemContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the Event
     OnContextRequired(e);
 }
예제 #13
0
        /// <summary>
        /// Process the ContextRequired event from one root node. Updates all the context tree and returns the last one
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void ProcessRootNodeContextRequired(object sender, ContextRequiredEventArgs e)
        {
            // Get the completa oid path list and update the all the context
            List<KeyValuePair<string, Oid>> lOidsPath = Tree.GetCompleteSelectedOidPath();
            lOidsPath.Reverse();
            // Return the last one
            e.Context = UpdateAllNodeContextInformation(lOidsPath);

            // If the context is null, assign the context of the first level root node.
            if (e.Context == null)
            {
                e.Context = RootNodes[0].QueryContext;
            }
        }
예제 #14
0
 /// <summary>
 /// Executes actions related to ContextRequired event for root nodes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleRootNodeContextRequired(object sender, ContextRequiredEventArgs e)
 {
     ProcessRootNodeContextRequired(sender, e);
 }
예제 #15
0
 /// <summary>
 /// Process the action related to Actions and Navigations context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionNavigationContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the event
     OnContextRequired(e);
 }
예제 #16
0
 /// <summary>
 /// Process the action related to Actions and Navigations context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionNavigationContextRequired(object sender, ContextRequiredEventArgs e)
 {
     // Propagate the event
     OnContextRequired(e);
 }
예제 #17
0
 private void HandleActionNavigationContextRequired(object sender, ContextRequiredEventArgs e)
 {
     UpdateContext();
     e.Context = Context;
 }