Пример #1
0
 protected AbstractMessage(string type, string name, IMessageManager messageManager = null)
 {
     _type = type;
     _name = name;
     _messageManager = messageManager;
     TimestampInMicros = MilliSecondTimer.CurrentTimeMicros;
 }
        public void Setup()
        {
            _commandBus = MockRepository.GenerateMock<ICommandBus>();
            _messageManager = MockRepository.GenerateMock<IMessageManager>();

            _commandExecutor = new CommandExecutor( _commandBus, _messageManager );
        }
Пример #3
0
 public DefaultTransaction(string type, string name, IMessageManager messageManager = null)
     : base(type, name, messageManager)
 {
     _messageManager = messageManager;
     _mDurationInMicro = -1;
     Standalone = true;
 }
 public void Setup()
 {
     _commandExecutor = MockRepository.GenerateMock<ICommandExecutor>();
     _messageManager = MockRepository.GenerateMock<IMessageManager>();
     _referrerProvider = MockRepository.GenerateMock<IReferrerProvider>();
     _controller = new DummyExecuteController( _commandExecutor, _messageManager, _referrerProvider );
 }
Пример #5
0
 public UsersService(
     IContentManager contentManager, 
     IOrchardServices orchardServices, 
     IRoleService roleService, 
     IMessageManager messageManager, 
     IScheduledTaskManager taskManager, 
     IRepository<EmailPartRecord> emailRepository, 
     ShellSettings shellSettings, 
     IRepository<UserRolesPartRecord> userRolesRepository, 
     ICacheManager cache, 
     IClock clock, 
     ISignals signals) 
 {
     _signals = signals;
     _clock = clock;
     _cache = cache;
     _emailRepository = emailRepository;
     _orchardServices = orchardServices;
     _contentManager = contentManager;
     _roleService = roleService;
     _messageManager = messageManager;
     _taskManager = taskManager;
     _shellSettings = shellSettings;
     _userRolesRepository = userRolesRepository;
     T = NullLocalizer.Instance;
     Logger = NullLogger.Instance;            
 }
Пример #6
0
        public IO(IFileManager filemanager, IMessageManager messagemanager, Lang language)
        {
            fileManager = filemanager;
            messageManager = messagemanager;
            ActiveLanguage = language;

            WorkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "TOWare");

            if (!Directory.Exists(WorkPath))
                Directory.CreateDirectory(WorkPath);
            if (!Directory.Exists(LanguagePath))
                Directory.CreateDirectory(LanguagePath);
            if (File.Exists(SettingsFile))
            {
                LoadSettings();
                if (File.Exists(Path.Combine(LanguagePath, ActiveSettings.ActiveLanguage + ".towlang")))
                    LoadLanguage();
                else
                    SaveLanguage();
            }
            else
            {
                ActiveSettings = new Settings();
                SaveSettings(ActiveSettings);
                SaveLanguage();
            }
        }
Пример #7
0
 public ContactController(IOrchardServices services, IContactService contactService, 
     IMessageManager messenger, INotifier notifier)
 {
     Services = services;
     _contactService = contactService;
     _messenger = messenger;
     _notifier = notifier;
 }
Пример #8
0
 public UserService(IContentManager contentManager, IMembershipService membershipService, IClock clock, IMessageManager messageManager, ShellSettings shellSettings, IEncryptionService encryptionService) {
     _contentManager = contentManager;
     _membershipService = membershipService;
     _clock = clock;
     _messageManager = messageManager;
     _encryptionService = encryptionService;
     Logger = NullLogger.Instance;
 }
 public MailActions(
     IMessageManager messageManager,
     IOrchardServices orchardServices,
     IMembershipService membershipService) {
     _messageManager = messageManager;
     _orchardServices = orchardServices;
     _membershipService = membershipService;
 }
 private void Arrange( IMessageManager messageManager = null )
 {
     ServiceLocator.SetLocatorProvider( () => _serviceLocator );
     if ( messageManager != null )
         _serviceLocator
             .Stub( x => x.GetInstance<IMessageManager>() )
             .Return( _messageManager );
 }
 public MembershipService(IOrchardServices orchardServices, IMessageManager messageManager, IEnumerable<IUserEventHandler> userEventHandlers, IClock clock, IEncryptionService encryptionService) {
     _orchardServices = orchardServices;
     _messageManager = messageManager;
     _userEventHandlers = userEventHandlers;
     _encryptionService = encryptionService;
     Logger = NullLogger.Instance;
     T = NullLocalizer.Instance;
 }
 public ClientController(ActionInvoker actionInvoker, DataContext dataContext,
     JsonMapperManager jsonMapperManager, DeviceHiveConfiguration deviceHiveConfiguration,
     MessageBus messageBus, IMessageManager messageManager) :
     base(actionInvoker, dataContext, jsonMapperManager, deviceHiveConfiguration)
 {
     _messageBus = messageBus;
     _messageManager = messageManager;
 }
 public DeviceController(ActionInvoker actionInvoker, DataContext dataContext,
     JsonMapperManager jsonMapperManager, DeviceHiveConfiguration deviceHiveConfiguration,
     IMessageManager messageManager, DeviceService deviceService) :
     base(actionInvoker, dataContext, jsonMapperManager, deviceHiveConfiguration)
 {
     _messageManager = messageManager;
     _deviceService = deviceService;
 }
Пример #14
0
        private long _mDurationInMicro; // must be less than 0

        public DefaultTransaction(String type, String name, IMessageManager manager /*Action<ITransaction> endCallBack*/)
            : base(type, name)
        {
            _mDurationInMicro = -1;
            //_endCallBack = endCallBack;
            _mManager = manager;
            Standalone = true;
        }
Пример #15
0
		public HomeController(IOrchardServices orchardServices, IContactUsService contactUsService, ICommentValidator commentValidator, IMessageManager messageManager, IMembershipService membershipService)
		{
			Services	 = orchardServices;
			_contactUsService = contactUsService;
			_commentValidator = commentValidator;
			_membershipService = membershipService;
			_messageManager = messageManager;
		}
Пример #16
0
 public MailActions(
     IMessageManager messageManager,
     IOrchardServices orchardServices,
     IMembershipService membershipService) {
     _messageManager = messageManager;
     _orchardServices = orchardServices;
     _membershipService = membershipService;
     T = NullLocalizer.Instance;
 }
Пример #17
0
        public MainView(IMessageManager manager)
        {
            InitializeComponent();

              if (!DesignMode)
              {
            _presenter = new MainViewPresenter(this, manager);
            _presenter.Setup();
              }
        }
Пример #18
0
        public void Init() {
            var builder = new ContainerBuilder();

            builder.RegisterInstance(new Mock<IMessageEventHandler>().Object);
            builder.RegisterType<DefaultMessageManager>().As<IMessageManager>();
            builder.RegisterInstance(_channel = new MessagingChannelStub()).As<IMessagingChannel>();

            var container = builder.Build();
            _messageManager = container.Resolve<IMessageManager>();
        }
Пример #19
0
        public ContactOwnersController(IOrchardServices orchardServices, IMessageManager messageManager, IPackageService packageService,
            IUserkeyPackageService userkeyPackageService, IParameterFormatValidator parameterFormatValidator, IPackageVisitTracker packageVisitTracker) {
            _orchardServices = orchardServices;
            _packageVisitTracker = packageVisitTracker;
            _messageManager = messageManager;
            _packageService = packageService;
            _userkeyPackageService = userkeyPackageService;
            _parameterFormatValidator = parameterFormatValidator;

            T = NullLocalizer.Instance;
        }
Пример #20
0
 public OFormService(IContentManager contentManager, IOrchardServices orchardServices,
                     IMessageManager messageManager, IRepository<OFormResultRecord> resultRepo,
                     IRepository<OFormFileRecord> fileRepo)
 {
     this._resultRepo = resultRepo;
     this._fileRepo = fileRepo;
     this._messageManager = messageManager;
     this._orchardServices = orchardServices;
     this._contentManager = contentManager;
     T = NullLocalizer.Instance;
 }
 public DelightService()
 {
     IoCBootstrapper.Boot();
     _accountManager = ObjectFactory.GetInstance<IAccountManager>();
     _categoryManager = ObjectFactory.GetInstance<ICategoryManager>();
     _productManager = ObjectFactory.GetInstance<IProductManager>();
     _userGroupManager = ObjectFactory.GetInstance<IUserGroupManager>();
     _voteManager = ObjectFactory.GetInstance<IVoteManager>();
     _userManager = ObjectFactory.GetInstance<IUserManager>();
     _sessionManager = ObjectFactory.GetInstance<ISessionManager>();
     _messageManager = ObjectFactory.GetInstance<IMessageManager>();
 }
Пример #22
0
 public DefaultTaggedTransaction(string type, string name, string tag, IMessageManager manager)
     : base(type, name, manager)
 {
     _mTag = tag;
     Standalone = false;
     IMessageTree tree = manager.ThreadLocalMessageTree;
     if (tree != null)
     {
         _mRootMessageId = tree.RootMessageId;
         _mParentMessageId = tree.MessageId;
     }
 }
        public CheckoutController(IOrchardServices services, IAuthenticationService authenticationService, ICustomerService customerService, IMembershipService membershipService,
            IShoppingCart shoppingCart, IWebshopSettingsService webshopSettings, IMessageManager messageManager)
        {
            _authenticationService = authenticationService;
            _services = services;
            _customerService = customerService;
            _membershipService = membershipService;
            _shoppingCart = shoppingCart;
            _webshopSettings = webshopSettings;
            _messageManager = messageManager;

            T = NullLocalizer.Instance;
        }
Пример #24
0
        public DefaultTaggedTransaction(string type, string name, string tag, IMessageManager messageManager)
           : base(type, name, messageManager)
        {
            _tag = tag;
            _mDurationInMicro = -1;
            Standalone = false;

            IMessageTree tree = messageManager.ThreadLocalMessageTree;
            if (tree != null)
            {
                _rootMessageId = tree.RootMessageId;
                _parentMessageId = tree.ParentMessageId;
            }
        }
Пример #25
0
 public OrderController(IShapeFactory shapeFactory, IOrderService orderService, IAuthenticationService authenticationService,
     IShoppingCart shoppingCart, ICustomerService customerService, IEnumerable<IPaymentServiceProvider> paymentServiceProviders,
     IMessageManager messageManager, IWebshopSettingsService webshopSettings)
 {
     _shapeFactory = shapeFactory;
     _orderService = orderService;
     _authenticationService = authenticationService;
     _shoppingCart = shoppingCart;
     _customerService = customerService;
     _t = NullLocalizer.Instance;
     _paymentServiceProviders = paymentServiceProviders;
     _messageManager = messageManager;
     _webshopSettings = webshopSettings;
 }
Пример #26
0
        public ReportAbuseController(IOrchardServices orchardServices, IMembershipService membershipService, IMessageManager messageManager,
            IPackageService packageService, IParameterFormatValidator parameterFormatValidator, IPackageVisitTracker packageVisitTracker) {
            _orchardServices = orchardServices;
            _packageVisitTracker = packageVisitTracker;
            _messageManager = messageManager;
            _packageService = packageService;
            _parameterFormatValidator = parameterFormatValidator;
            _membershipService = membershipService;

            _reportAbuseUserName =
                new Lazy<string>(() => _orchardServices.WorkContext.CurrentSite.As<GallerySettingsPart>().ReportAbuseUserName);

            T = NullLocalizer.Instance;
        }
Пример #27
0
        public DeviceController(ActionInvoker actionInvoker, WebSocketServerBase server,
            DataContext dataContext, JsonMapperManager jsonMapperManager,
            [Named("DeviceCommand")] DeviceSubscriptionManager subscriptionManager,
            MessageBus messageBus, IMessageManager messageManager,
            DeviceService deviceService) :
            base(actionInvoker, server, dataContext, jsonMapperManager)
        {
            _subscriptionManager = subscriptionManager;
            _messageBus = messageBus;
            _messageManager = messageManager;
            _deviceService = deviceService;

            _deviceMapper = jsonMapperManager.GetMapper<Device>();
        }
Пример #28
0
        public DefaultForkedTransaction(string type, string name, IMessageManager manager) : base(type, name, manager)
        {
            Standalone = false;
            
            IMessageTree tree = manager.ThreadLocalMessageTree;

            if (tree != null)
            {
                _mRootMessageId = tree.RootMessageId;
                _mParentMessageId = tree.MessageId;

                // Detach parent transaction and this forked transaction, by calling linkAsRunAway(), at this earliest moment,
                // so that thread synchronization is not needed at all between them in the future.
                _mForkedMessageId = Cat.CreateMessageId();
            }
        }
        public void Setup()
        {
            _mapper = MockRepository.GenerateMock<IViewModelToCommandMappingEngine>();
            _mockedServiceLocator = MockRepository.GenerateMock<IServiceLocator>();
            _mockedServiceLocator
                .Stub( x => x.GetInstance<IViewModelToCommandMappingEngine>() )
                .Return( _mapper );
            ServiceLocator.SetLocatorProvider( () => _mockedServiceLocator );

            _commandExecutor = MockRepository.GenerateMock<ICommandExecutor>();
            _messageManager = MockRepository.GenerateMock<IMessageManager>();
            _referrerProvider = MockRepository.GenerateMock<IReferrerProvider>();
            _controller = new DummyExecuteController( _commandExecutor, _messageManager, _referrerProvider );

            var routeData = new RouteData();
            routeData.Values.Add( "controller", "DummyDeleteFile" );
            _controller.ControllerContext = new ControllerContext { RouteData = routeData };
        }
Пример #30
0
        public MessagesViewModel(IDatabaseManager databaseManager, IMessageManager messageManager)
        {
            _messageManager = messageManager;

            Messages = databaseManager.GetMessages().CreateDerivedCollection(
                msg => new MessageItemViewModel(msg),
                x => true,
                (x, y) => x.Message.CompareTo(y.Message),
                _messagesRead
            );

            databaseManager.GetMessages().CountChanged
                .StartWith(0)
                .Select(_ => Messages.Count == 0)
                .ToProperty(this, x => x.IsEmpty, out _isEmpty);

            ClearAll.Subscribe(_ => {
                _messageManager.ClearAll();
            });
        }
Пример #31
0
        private void Information(long chatId, IChatStateHandlerContext context)
        {
            IMessageManager messageManager = ModulesManager.GetModulesManager().GetMessageManager();

            messageManager.SendTextMessage(chatId, TextResponse.Get(ResponseType.Information));
        }
Пример #32
0
 public EmailManagerController()
 {
     emailmanager = new EMailManager();
 }
 public CreateInvoiceHandler(IInvoiceRepository invoiceRepository, IMessageManager messageManager)
 {
     _invoiceRepository = invoiceRepository;
     _messageManager    = messageManager;
 }
Пример #34
0
 public FindPartnersViewModel(IChatManager chatManager, IApiManager apiManager, ICharacterManager characterManager, IMessageManager messageManager)
 {
     this.chatManager      = chatManager;
     this.apiManager       = apiManager;
     this.characterManager = characterManager;
     this.messageManager   = messageManager;
     if (!searchFieldsInitialized)
     {
         GetSearchFields();
     }
     SearchCommand = new MvxCommand(() => {
         Pending = true;
         chatManager.CommandReceived += OnCommandReceived;
         chatManager.Send(Helpers.CreateClientCommand(ClientCommandType.FKS, new {
             kinks        = SelectedKinks.Select(x => x.Id),
             genders      = SelectedGenders,
             orientations = SelectedOrientations,
             positions    = SelectedPositions,
             roles        = SelectedRoles,
             languages    = SelectedLanguages
         }));
     });
     ViewProfileCommand = new MvxCommand <CharacterViewModel>(c => Navigator.Navigate <CharacterViewModel, string>(c.Character.Name));
 }
Пример #35
0
        public void StartStateMessage(long chatId)
        {
            IMessageManager messageManager = ModulesManager.GetModulesManager().GetMessageManager();

            messageManager.SendTextMessage(chatId, TextResponse.Get(ResponseType.RegistrationWarning));
        }
Пример #36
0
 public EmailClientProvider(IMessageManager messageManager)
 {
     _messageManager = messageManager;
 }
 protected MessageEvaluator(string text, IMessageManager messages) : base(text)
 {
     Messages = messages;
 }
Пример #38
0
 public HomeController(ILogger <HomeController> logger, UserManager <IdentityUser> userManager, IMessageManager msgManager)
 {
     _logger      = logger;
     _userManager = userManager;
     _msgManager  = msgManager;
 }
Пример #39
0
 public EventManager(IChatManager chatManager, IMessageManager messageManager, ICharacterManager characterManager, IChannelManager channelManager) :
     base(chatManager, messageManager, characterManager, channelManager)
 {
 }
Пример #40
0
        public void StartStateMessage(long chatId)
        {
            IMessageManager messageManager = ModulesManager.GetMessageManager();

            messageManager.SendTextMessageAsync(chatId, TextResponse.Get(ResponseType.RegistrationReady), chatCommands.CreateReplyKeyboard());
        }
Пример #41
0
 public UserService(IContentManager contentManager, IMembershipService membershipService, IClock clock, IMessageManager messageManager, ShellSettings shellSettings, IEncryptionService encryptionService)
 {
     _contentManager    = contentManager;
     _membershipService = membershipService;
     _clock             = clock;
     _messageManager    = messageManager;
     _encryptionService = encryptionService;
     Logger             = NullLogger.Instance;
 }
Пример #42
0
        public void StartStateMessage(long chatId)
        {
            IMessageManager messageManager = ModulesManager.GetModulesManager().GetMessageManager();

            messageManager.SendTextMessage(chatId, TextResponse.Get(ResponseType.AuthorisationReady));
        }
Пример #43
0
 public RealTimeHub(IMessageManager messageManager, UserChatService userChatService)
 {
     _messageManager  = messageManager;
     _userChatService = userChatService;
 }
Пример #44
0
 public RequestProcessor(IMessageManager messageManager, IUserManager userManager)
 {
     _messageManager = messageManager;
     _userManager    = userManager;
 }
Пример #45
0
 public SMSManagerController()
 {
     smsmanager = new SMSManager();
 }
Пример #46
0
 public ClientController(ActionInvoker actionInvoker, DataContext dataContext,
                         JsonMapperManager jsonMapperManager, DeviceHiveConfiguration deviceHiveConfiguration, IMessageManager messageManager) :
     base(actionInvoker, dataContext, jsonMapperManager, deviceHiveConfiguration)
 {
     _messageManager = messageManager;
 }
Пример #47
0
 public StartResearchEvaluator(string text, IUIMap uiMap, IMessageManager messages)
     : base(text, uiMap)
 {
     Messages = messages;
 }
Пример #48
0
        private void BtnOpenClose_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TbComPort.Text) == true)
            {
                MessageBox.Show("Invalid port name.");
                return;
            }

            if (_currentParserType == ParserType.Unknown)
            {
                MessageBox.Show("Invalid parser type.");
                return;
            }

            MessageManagerSetting setting = new MessageManagerSetting()
            {
                ComSetting = new SerialPortSetting()
                {
                    PortName = TbComPort.Text,
                    BaudRate = 115200,
                    DataBits = 8,
                    Parity   = Parity.None,
                    StopBits = StopBits.One
                }
            };

            try
            {
                if (_msgManager == null)
                {
                    if (_currentParserType == ParserType.Binary)
                    {
                        _msgManager     = new BinMessageManager();
                        _sequenceNumber = FlConstant.FL_BIN_MSG_MIN_SEQUENCE;
                    }
                    else if (_currentParserType == ParserType.Text)
                    {
                        _msgManager = new TxtMessageManager();
                    }
                }

                if (_msgManager.StartStatus == StartStatus.Stopped)
                {
                    BtnOpenClose.Content   = AppConstant.STR_OPENING;
                    BtnOpenClose.IsEnabled = false;

                    _eventTimer.Start();
                    _msgManager.OnEventReceived = OnEventMessageReceived;
                    _msgManager.Start(setting);
                }
                else if (_msgManager.StartStatus == StartStatus.Started)
                {
                    BtnOpenClose.Content   = AppConstant.STR_CLOSING;
                    BtnOpenClose.IsEnabled = false;

                    _msgManager.Stop();
                    _eventTimer.Stop();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                if (_msgManager != null)
                {
                    if (_msgManager.StartStatus == StartStatus.Stopped)
                    {
                        BtnOpenClose.Content     = AppConstant.STR_OPEN;
                        BtnSendMessage.IsEnabled = false;
                        _msgManager = null;
                    }
                    else if (_msgManager.StartStatus == StartStatus.Started)
                    {
                        BtnOpenClose.Content     = AppConstant.STR_CLOSE;
                        BtnSendMessage.IsEnabled = true;
                    }
                    BtnOpenClose.IsEnabled = true;
                }
                else
                {
                    BtnOpenClose.Content     = AppConstant.STR_OPEN;
                    BtnSendMessage.IsEnabled = true;
                }
            }
        }
Пример #49
0
 public VpdbClient(ISettingsManager settingsManager, IVersionManager versionManager, IMessageManager messageManager,
                   IScreen screen, ILogger logger, CrashManager crashManager)
 {
     _settingsManager = settingsManager;
     _versionManager  = versionManager;
     _messageManager  = messageManager;
     _logger          = logger;
     _screen          = screen;
     _crashManager    = crashManager;
 }
Пример #50
0
 public ContentNotificationService(IOrchardServices services, IMembershipService membershipService, IMessageManager messageManager)
 {
     _services          = services;
     _messageManager    = messageManager;
     _membershipService = membershipService;
 }
Пример #51
0
 /// <summary>
 /// Class constructor from <paramref name="messageManager"/> parameter
 /// to output progress registration of tool windows.
 /// </summary>
 public ToolWindowRegistry(IMessageManager messageManager)
     : this()
 {
     this.Messaging = messageManager;
 }
 public MessageController(ISiteUserManager siteUserManager, IMessageManager messageManager, IApplicationManager applicationManager)
 {
     _siteUserManager    = siteUserManager;
     _messageManager     = messageManager;
     _applicationManager = applicationManager;
 }
Пример #53
0
 public MessageController(IMessageManager messageManager)
 {
     this.messageManager = messageManager;
 }
Пример #54
0
 public Script(IApiManager apiManager, IChatManager chatManager, IChannelManager channelManager, ICharacterManager characterManager, IEventManager eventManager, IMessageManager messageManager)
 {
     this.apiManager       = apiManager;
     this.chatManager      = chatManager;
     this.channelManager   = channelManager;
     this.characterManager = characterManager;
     this.eventManager     = eventManager;
     this.messageManager   = messageManager;
 }
Пример #55
0
 public ChatHub(IMessageManager messageManager, UserManager <ApplicationUser> userManager)
 {
     MessageManager = messageManager;
     _userManager   = userManager;
 }
 public MessageController(IMessageManager _messageManager, IUserManager _usermanager, UiLoader.UiLoader _loader)
 {
     messageManager = _messageManager;
     usermanager    = _usermanager;
     loader         = _loader;
 }
Пример #57
0
 public DeviceNotificationController(IMessageManager messageManager)
 {
     _messageManager = messageManager;
 }
Пример #58
0
 public DefaultMessageProducer(IMessageManager manager)
 {
     _mManager = manager;
 }
Пример #59
0
 public MessagesController(IMessageManager messageManager, IMapper mapper)
 {
     _messageManager = messageManager;
     _mapper         = mapper;
 }
Пример #60
0
 public RequestProcessor()
 {
     _messageManager = Bootstrapper.Resolve <IMessageManager>();
     _userManager    = Bootstrapper.Resolve <IUserManager>();
 }