Exemple #1
0
        public PluginCommandResponseMessage Execute(string args)
        {
            var profileDtos = _profileCollection.Select(x => x.ConvertToDto()).ToArray();

            return(new PluginCommandResponseMessage
            {
                ResponseData = profileDtos.Serialize(), PluginCommandStatus = PluginCommandStatus.Succeed
            });
        }
Exemple #2
0
        protected void ChangeProfiles(Action <IProfileCollection> changeProfilesAction)
        {
            changeProfilesAction(_profileCollection);

            var message = CreatePluginInfoChangedMessage(PluginContext.AccountName,
                                                         _profileCollection.Select(profile => profile.ConvertToPluginProfile()).
                                                         ToArray());

            _bus.Send(message);
        }
        private void DispatchToProfiles(ITargetProcessMessage message,
                                        Action <IProfileGateway, ITargetProcessMessage> sendAction)
        {
            _bus.DoNotContinueDispatchingCurrentMessageToHandlers();

            foreach (
                var gateway in _profileCollection.Select(profile => new ProfileGateway(profile, _pluginContext.AccountName, _bus)))
            {
                sendAction(gateway, message);
            }
        }
Exemple #4
0
        public PluginCommandResponseMessage Execute(string args)
        {
            var responseData =
                _profileCollection.Select(
                    x => new ProfileErrorCheckResult {
                ProfileName = x.Name.Value, ErrorsExist = x.Log.CheckForErrors()
            }).ToArray().
                Serialize();

            return(new PluginCommandResponseMessage
            {
                ResponseData = responseData, PluginCommandStatus = PluginCommandStatus.Succeed
            });
        }