Пример #1
0
        public bool Execute(Person p)
        {
            if (_s1.Execute(p) && _s2.Execute(p))
            {
                Message = _s1.Message + " " + _s2.Message;
                return(true);
            }

            return(false);
        }
Пример #2
0
        public void ExecuteStrategy(IMessage message, IPaxosRoleState currentState)
        {
            IMessageStrategy messageStrategy = this.RetrieveMessageStrategy(message);

            if (messageStrategy == null)
            {
                return;
            }

            MessageStrategyExecuteArg <IMessage> arg = new MessageStrategyExecuteArg <IMessage>
            {
                RoleState = currentState,
                Message   = message
            };

            messageStrategy.Execute(arg);
        }