public void Send(ITargetProcessMessage message)
 {
     if (!_profile.Initialized)
     {
         _storage.Add(message);
     }
     else
     {
         _bus.SendLocalWithContext(_profile.Name, _accountName, message);
     }
 }
		public void Send(ITargetProcessMessage message)
		{
			if (!_profile.Initialized)
			{
				_storage.Add(message);
			}
			else
			{
				_bus.SendLocalWithContext(_profile.Name, _accountName, message);
			}
		}
Example #3
0
 private void MessageShouldBeSentToProfiles(ITargetProcessMessage message, IEnumerable <string> profileNames)
 {
     foreach (var profile in _profiles)
     {
         if (!profileNames.Contains(profile.Name.Value))
         {
             continue;
         }
         var gateway = ProfileGatewayFactory.Create(_account.Name, profile);
         gateway.AssertWasCalled(x => x.Send(message));
     }
 }
		private void CreateProfile(ITargetProcessMessage message)
		{
			if (IsMessageOfCrudType(message.GetType()) && _pluginContext.AccountName != AccountName.Empty)
			{
				var command = ObjectFactory.GetInstance<AddOrUpdateProfileCommand>();
				var result = command.Execute(new PluginProfileDto { Name = SearcherProfile.Name }.Serialize());
				if (result.PluginCommandStatus == PluginCommandStatus.Succeed)
				{
					_bus.SendLocalWithContext(new ProfileName(SearcherProfile.Name), _pluginContext.AccountName, new ExecutePluginCommandCommand
					{
						CommandName = SetEnableForTp2.CommandName,
						Arguments = bool.TrueString
					});
				}
			}
		}
 private void CreateProfile(ITargetProcessMessage message)
 {
     if (IsMessageOfCrudType(message.GetType()) && _pluginContext.AccountName != AccountName.Empty)
     {
         var command = ObjectFactory.GetInstance <AddOrUpdateProfileCommand>();
         var result  = command.Execute(new PluginProfileDto {
             Name = SearcherProfile.Name
         }.Serialize());
         if (result.PluginCommandStatus == PluginCommandStatus.Succeed)
         {
             _bus.SendLocalWithContext(new ProfileName(SearcherProfile.Name), _pluginContext.AccountName, new ExecutePluginCommandCommand
             {
                 CommandName = SetEnableForTp2.CommandName,
                 Arguments   = bool.TrueString
             });
         }
     }
 }
		protected void SendProfileChangedLocalMessage(ProfileName profileName, ITargetProcessMessage profileMessage)
		{
			_bus.SendLocalWithContext(profileName, PluginContext.AccountName, profileMessage);
		}
		public void Handle(ITargetProcessMessage message)
		{
			CreateProfile(message);
		}
 public void Handle(ITargetProcessMessage message)
 {
     CreateProfile(message);
 }
 private void MessageShouldBeSentToProfiles(ITargetProcessMessage message, IEnumerable<string> profileNames)
 {
     foreach (var profile in _profiles)
     {
         if (!profileNames.Contains(profile.Name.Value)) continue;
         var gateway = ProfileGatewayFactory.Create(_account.Name, profile);
         gateway.AssertWasCalled(x => x.Send(message));
     }
 }
            public void ReceivePluginSagaMessage(string profileName)
            {
                var sagaMessage = MockRepository.GenerateStub<ISagaMessage>();

                Bus.SetIn(_account.Name);
                Bus.SetIn((ProfileName) profileName);
                _profileSpecificPluginMessage = sagaMessage;
                Gateway.Handle(_profileSpecificPluginMessage);
            }
            public void ReceivePluginMessage()
            {
                _pluginMessage = MockRepository.GenerateStub<ITargetProcessMessage>();
                Bus.SetIn(_account.Name);

                Gateway.Handle(_pluginMessage);
            }
Example #12
0
 public void SendLocalUiWithContext(ProfileName profileName, AccountName accountName, ITargetProcessMessage message)
 {
 }
Example #13
0
 protected void SendProfileChangedLocalMessage(ProfileName profileName, ITargetProcessMessage profileMessage)
 {
     _bus.SendLocalWithContext(profileName, PluginContext.AccountName, profileMessage);
 }