Example #1
0
        /// <summary>
        /// Adds an Action item to the Action controller.
        /// </summary>
        /// <param name="number">Number of the Action item.</param>
        /// <param name="alias">Alias of the Action item.</param>
        /// <param name="idXML">IdXML of the Action item.</param>
        /// <param name="agents">List of agents that can access to the Action item.</param>
        /// <param name="className">Class name of the Action item.</param>
        /// <param name="iuName">Interaction unit name of the Action item.</param>
        /// <param name="navigationalFilteringIdentity">Navigational filtering identifier.</param>
        /// <param name="actionItemType">Type of the actiom item.</param>
        /// <param name="objectActionEnabled">If the Object-Action feature is enabled or not.</param>
        /// <param name="multiSelectionSupported">If multiselection is supported or not.</param>
        /// <param name="attributesListForFormulas">List of attributes needed for evaluating the enabling/disabling formulas.</param>
        /// <returns>ActionItemController.</returns>
        /// <returns></returns>
        public ActionItemController Add(
            int number,
            string alias,
            string idXML,
            string[] agents,
            string classIUName,
            string iuName,
            string navigationalFilteringIdentity,
            ActionItemType actionItemType,
            bool objectActionEnabled,
            bool multiSelectionSupported,
            List <KeyValuePair <string, string[]> > attributesListForFormulas)
        {
            // Check the attributes for enabled formulas depending on the connected agent.
            List <string> lAttributesForFormulas = new List <string>();

            if (attributesListForFormulas != null && Logic.Agent.IsActiveFacet(agents))
            {
                foreach (KeyValuePair <string, string[]> lKeyPair in attributesListForFormulas)
                {
                    // Check the connected agent visibility.
                    if (Logic.Agent.IsActiveFacet(lKeyPair.Key))
                    {
                        foreach (string lAttribute in lKeyPair.Value)
                        {
                            // Avoid adding repeated elements.
                            if (!lAttributesForFormulas.Contains(lAttribute))
                            {
                                lAttributesForFormulas.Add(lAttribute);
                            }
                        }
                    }
                }
            }

            // Set the 'AnyActionItemEnabledByCondition' flag to true.
            if ((lAttributesForFormulas != null) && (lAttributesForFormulas.Count > 0))
            {
                AnyActionItemEnabledByCondition = true;
            }

            List <string>        lAgents     = new List <string>(agents);
            ActionItemController lActionItem = new ActionItemController(number, alias, idXML, lAgents, classIUName, iuName, navigationalFilteringIdentity, actionItemType, objectActionEnabled, multiSelectionSupported, lAttributesForFormulas, this);

            mActionItems.Add(number, lActionItem);

            lActionItem.RefreshRequired            += new EventHandler <RefreshRequiredEventArgs>(HandleActionItemRefreshRequired);
            lActionItem.SelectNextPreviousInstance += new EventHandler <SelectNextPreviousInstanceEventArgs>(HandleActionItemSelectNextPreviousInstance);
            lActionItem.BeforeExecute             += new EventHandler <CheckForPendingChangesEventArgs>(HandleActionItemBeforeActionItemExecution);
            lActionItem.SelectedInstancesRequired += new EventHandler <SelectedInstancesRequiredEventArgs>(HandleActionItemSelectedInstancesRequired);
            lActionItem.ContextRequired           += new EventHandler <ContextRequiredEventArgs>(HandleActionItemContextRequired);
            lActionItem.LaunchingScenario         += new EventHandler <LaunchingScenarioEventArgs>(HandleActionItemLaunchingScenario);

            return(lActionItem);
        }
        /// <summary>
        /// Adds an Action item to the Action controller.
        /// </summary>
        /// <param name="number">Number of the Action item.</param>
        /// <param name="alias">Alias of the Action item.</param>
        /// <param name="idXML">IdXML of the Action item.</param>
        /// <param name="agents">List of agents that can access to the Action item.</param>
        /// <param name="className">Class name of the Action item.</param>
        /// <param name="iuName">Interaction unit name of the Action item.</param>
        /// <param name="navigationalFilteringIdentity">Navigational filtering identifier.</param>
        /// <param name="actionItemType">Type of the actiom item.</param>
        /// <param name="objectActionEnabled">If the Object-Action feature is enabled or not.</param>
        /// <param name="multiSelectionSupported">If multiselection is supported or not.</param>
        /// <param name="attributesListForFormulas">List of attributes needed for evaluating the enabling/disabling formulas.</param>
        /// <returns>ActionItemController.</returns>
        /// <returns></returns>
        public ActionItemController Add(
			int number,
			string alias,
			string idXML,
			string[] agents,
			string classIUName,
			string iuName,
			string navigationalFilteringIdentity,
			ActionItemType actionItemType,
			bool objectActionEnabled,
			bool multiSelectionSupported,
			List<KeyValuePair<string, string[]>> attributesListForFormulas)
        {
            // Check the attributes for enabled formulas depending on the connected agent.
            List<string> lAttributesForFormulas = new List<string>();
            if (attributesListForFormulas != null && Logic.Agent.IsActiveFacet(agents))
            {
                foreach (KeyValuePair<string, string[]> lKeyPair in attributesListForFormulas)
                {
                    // Check the connected agent visibility.
                    if (Logic.Agent.IsActiveFacet(lKeyPair.Key))
                    {
                        foreach (string lAttribute in lKeyPair.Value)
                        {
                            // Avoid adding repeated elements.
                            if (!lAttributesForFormulas.Contains(lAttribute))
                            {
                                lAttributesForFormulas.Add(lAttribute);
                            }
                        }
                    }
                }
            }

            // Set the 'AnyActionItemEnabledByCondition' flag to true.
            if ((lAttributesForFormulas != null) && (lAttributesForFormulas.Count > 0))
            {
                AnyActionItemEnabledByCondition = true;
            }

            List<string> lAgents = new List<string>(agents);
            ActionItemController lActionItem = new ActionItemController(number, alias, idXML, lAgents, classIUName, iuName, navigationalFilteringIdentity, actionItemType, objectActionEnabled, multiSelectionSupported, lAttributesForFormulas, this);
            mActionItems.Add(number, lActionItem);

            lActionItem.RefreshRequired += new EventHandler<RefreshRequiredEventArgs>(HandleActionItemRefreshRequired);
            lActionItem.SelectNextPreviousInstance += new EventHandler<SelectNextPreviousInstanceEventArgs>(HandleActionItemSelectNextPreviousInstance);
            lActionItem.BeforeExecute += new EventHandler<CheckForPendingChangesEventArgs>(HandleActionItemBeforeActionItemExecution);
            lActionItem.SelectedInstancesRequired += new EventHandler<SelectedInstancesRequiredEventArgs>(HandleActionItemSelectedInstancesRequired);
            lActionItem.ContextRequired += new EventHandler<ContextRequiredEventArgs>(HandleActionItemContextRequired);
            lActionItem.LaunchingScenario += new EventHandler<LaunchingScenarioEventArgs>(HandleActionItemLaunchingScenario);

            return lActionItem;
        }