A handle to an action - a unique and serializable way to identify actions.
Пример #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;
        }
Пример #2
0
        /// <exclude />
        public bool Equals(ActionHandle actionHandle)
        {
            if (actionHandle == null)
            {
                return(false);
            }

            return(this.SerializedActionToken == actionHandle.SerializedActionToken);
        }
Пример #3
0
        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);
            }
        }
Пример #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);
            }
        }
Пример #5
0
        /// <exclude />
        public bool Equals(ActionHandle actionHandle)
        {
            if (actionHandle == null) return false;

            return this.SerializedActionToken == actionHandle.SerializedActionToken;
        }
Пример #6
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="actionHandle"></param>
        public ElementAction(ActionHandle actionHandle)
        {
            Verify.ArgumentNotNull(actionHandle, nameof(actionHandle));

            ActionHandle = actionHandle;
        }
Пример #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;            
        }