A handle to an action - a unique and serializable way to identify actions.
Esempio n. 1
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="actionHandle"></param>
        public ElementAction(ActionHandle actionHandle)
        {
            if (actionHandle == null)
            {
                throw new ArgumentNullException("actionHandle");
            }

            _actionHandle = actionHandle;
        }
        /// <exclude />
        public bool Equals(ActionHandle actionHandle)
        {
            if (actionHandle == null)
            {
                return(false);
            }

            return(this.SerializedActionToken == actionHandle.SerializedActionToken);
        }
        public static void ExecuteElementAction(ElementHandle elementHandle, ActionHandle actionHandle, string consoleId)
        {
            FlowControllerServicesContainer flowServicesContainer = new FlowControllerServicesContainer();
            flowServicesContainer.AddService(new ManagementConsoleMessageService(consoleId));
            flowServicesContainer.AddService(new ElementDataExchangeService(elementHandle.ProviderName));
            flowServicesContainer.AddService(new ActionExecutionService(elementHandle.ProviderName, consoleId));
            flowServicesContainer.AddService(new ElementInformationService(elementHandle));

            FlowToken flowToken = ActionExecutorFacade.Execute(elementHandle.EntityToken, actionHandle.ActionToken, flowServicesContainer);

            IFlowUiDefinition uiDefinition = FlowControllerFacade.GetCurrentUiDefinition(flowToken, flowServicesContainer);

            if (typeof(FlowUiDefinitionBase).IsAssignableFrom(uiDefinition.GetType()))
            {
                string serializedEntityToken = EntityTokenSerializer.Serialize(elementHandle.EntityToken, true);
                ViewTransitionHelper.HandleNew(consoleId, elementHandle.ProviderName, serializedEntityToken, flowToken, (FlowUiDefinitionBase)uiDefinition);
            }
        }
Esempio n. 4
0
        /// <exclude />
        public static void ExecuteElementAction(string providerName, string serializedEntityToken, string piggybag, string serializedActionToken, string consoleId)
        {
            using (DebugLoggingScope.MethodInfoScope)
            {
                EntityToken entityToken = EntityTokenSerializer.Deserialize(serializedEntityToken);
                if (!entityToken.IsValid())
                {
                    ShowInvalidEntityMessage(consoleId);
                    return;
                }

                var elementHandle = new ElementHandle(providerName, entityToken, piggybag);

                ActionToken actionToken = ActionTokenSerializer.Deserialize(serializedActionToken, true);
                ActionHandle actionHandle = new ActionHandle(actionToken);

                ActionExecutionMediator.ExecuteElementAction(elementHandle, actionHandle, consoleId);
            }
        }
Esempio n. 5
0
        /// <exclude />
        public bool Equals(ActionHandle actionHandle)
        {
            if (actionHandle == null) return false;

            return this.SerializedActionToken == actionHandle.SerializedActionToken;
        }
Esempio n. 6
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="actionHandle"></param>
        public ElementAction(ActionHandle actionHandle)
        {
            Verify.ArgumentNotNull(actionHandle, nameof(actionHandle));

            ActionHandle = actionHandle;
        }
Esempio n. 7
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="actionHandle"></param>
        public ElementAction(ActionHandle actionHandle)
        {
            if (actionHandle == null) throw new ArgumentNullException("actionHandle");

            _actionHandle = actionHandle;            
        }