Beispiel #1
0
        protected void OnSelectedInstancesRequired(SelectedInstancesRequiredEventArgs eventArgs)
        {
            EventHandler <SelectedInstancesRequiredEventArgs> handler = SelectedInstancesRequired;

            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);
            }
        }
 /// <summary>
 /// Process the action related to Actions and Navigations of selected instances.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionNavigationSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     if (Tree != null)
     {
         e.SelectedInstances = Tree.Values;
     }
 }
 /// <summary>
 /// Executes actions related to Actions and Navigations of selected instances.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionNavigationSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     ProcessActionNavigationSelectedInstancesRequired(sender, e);
 }
        protected void OnSelectedInstancesRequired(SelectedInstancesRequiredEventArgs eventArgs)
        {
            EventHandler<SelectedInstancesRequiredEventArgs> handler = SelectedInstancesRequired;

            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 HandleNavigationItemSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     // Propagate the Event
     OnSelectedInstancesRequired(e);
 }
 /// <summary>
 /// Process the action related to Actions and Navigations of selected instances.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ProcessActionNavigationSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     if (Tree != null)
     {
         e.SelectedInstances = Tree.Values;
     }
 }
 /// <summary>
 /// Executes actions related to Actions and Navigations of selected instances.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionNavigationSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     ProcessActionNavigationSelectedInstancesRequired(sender, 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);
            }
        }
Beispiel #12
0
 private void HandleActionItemSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     // Propagate the Event
     OnSelectedInstancesRequired(e);
 }
 /// <summary>
 /// Process the Selected instances event from action or navigation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void ProcessActionNavigationSelectedInstancesRequired(object sender, SelectedInstancesRequiredEventArgs e)
 {
     e.SelectedInstances = DisplaySet.Values;
 }