Esempio n. 1
0
 public DiscussionMainController(
     IMessGroupService _MessGroupService,
     IUserMessageService _UserMessageService)
 {
     this._MessGroupService   = _MessGroupService;
     this._UserMessageService = _UserMessageService;
 }
Esempio n. 2
0
        public MainViewModel(IUserService userService,
                             IUserMessageService userMessageService,
                             FriendsViewModel friendsViewModel)
        {
            Title = "Relay Commands Demo";

            userService.UserChanged += (s, e) =>
            {
                CurrentUser = e.NewUser;
            };

            friendsViewModel.Commands.Add(new FriendCommand
            {
                Header  = "Login with this user",
                Command = new RelayCommand <UserData>(user =>
                {
                    userService.SetUser(user);
                })
            });

            GCCommand = new RelayCommand(() =>
            {
                GC.Collect();
                userMessageService.DisplayMessage("Operation Complete", "Ran GC successfully");
            });
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProvidedExtensionPointsPropertyDescriptor"/> class.
 /// </summary>
 /// <param name="patternSchema">The pattern.</param>
 /// <param name="allResolvedExtensionPoints">The extension points.</param>
 /// <param name="messageService">The message service.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="attributes">The attributes.</param>
 public ProvidedExtensionPointsPropertyDescriptor(PatternSchema patternSchema, IEnumerable<IExtensionPointSchema> allResolvedExtensionPoints, IUserMessageService messageService, string propertyName, object value, params Attribute[] attributes)
     : base(propertyName, value, attributes)
 {
     this.patternSchema = patternSchema;
     this.extensionPoints = allResolvedExtensionPoints;
     this.messageService = messageService;
 }
Esempio n. 4
0
        public PatternManager(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolution solution,
            IShellEvents shellEvents,
            ISolutionEvents solutionEvents,
            IItemEvents itemEvents,
            IEnumerable <IInstalledToolkitInfo> installedToolkits,
            IUserMessageService messageService)
        {
            Guard.NotNull(() => serviceProvider, serviceProvider);
            Guard.NotNull(() => solution, solution);
            Guard.NotNull(() => shellEvents, shellEvents);
            Guard.NotNull(() => solutionEvents, solutionEvents);
            Guard.NotNull(() => itemEvents, itemEvents);
            Guard.NotNull(() => installedToolkits, installedToolkits);
            Guard.NotNull(() => messageService, messageService);

            this.serviceProvider   = serviceProvider;
            this.solution          = solution;
            this.solutionEvents    = solutionEvents;
            this.shellEvents       = shellEvents;
            this.itemEvents        = itemEvents;
            this.installedToolkits = installedToolkits.ToArray();
            this.messageService    = messageService;

            this.solutionEvents.SolutionOpened  += this.OnSolutionOpened;
            this.solutionEvents.SolutionClosing += this.OnSolutionClosing;
            this.itemEvents.ItemRemoved         += OnItemRemoved;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProvidedExtensionPointsPropertyDescriptor"/> class.
 /// </summary>
 /// <param name="patternSchema">The pattern.</param>
 /// <param name="allResolvedExtensionPoints">The extension points.</param>
 /// <param name="messageService">The message service.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="attributes">The attributes.</param>
 public ProvidedExtensionPointsPropertyDescriptor(PatternSchema patternSchema, IEnumerable <IExtensionPointSchema> allResolvedExtensionPoints, IUserMessageService messageService, string propertyName, object value, params Attribute[] attributes)
     : base(propertyName, value, attributes)
 {
     this.patternSchema   = patternSchema;
     this.extensionPoints = allResolvedExtensionPoints;
     this.messageService  = messageService;
 }
Esempio n. 6
0
 public MessageInfoController(IUserMessageService userMessageService, IUserService userService,
                              IMessageService messageService, ILogger <MessageInfoController> logger)
 {
     _userMessageService = userMessageService;
     _userService        = userService;
     _messageService     = messageService;
     _logger             = logger;
 }
 public PaymentService(IUserService userService, ICreditTransactionService creditTransactionService,
                       ICreditWalletService creditWalletService, IUserMessageService userMessageService, ISystemValueService systemValueService)
 {
     _userService = userService;
     _creditTransactionService = creditTransactionService;
     _creditWalletService      = creditWalletService;
     _userMessageService       = userMessageService;
     _systemValueService       = systemValueService;
 }
Esempio n. 8
0
 public MainHub(IReadOnlyRepository <AppUser, Guid> AppUserRepository,
                IMessGroupService _MessGroupService,
                IUserMessageService _UserMessageService,
                IHubContext <NotificationHub> _NotificationHub)
 {
     this.AppUserRepository   = AppUserRepository;
     this._MessGroupService   = _MessGroupService;
     this._UserMessageService = _UserMessageService;
     this._NotificationHub    = _NotificationHub;
 }
 public MessagesViewModelService(
     IUserMessageService userMessageService,
     IMessageService messageService,
     IMessageFavouriteService messageFavouriteService,
     IFileService fileService)
 {
     _userMessageService      = userMessageService;
     _messageService          = messageService;
     _messageFavouriteService = messageFavouriteService;
     _fileService             = fileService;
 }
        public override void SetUp()
        {
            base.SetUp();

            _userMessageService    = ServiceLocator.Current.GetInstance <IUserMessageService>();
            _userMessageRepository = ServiceLocator.Current.GetInstance <IUserMessageRepository>();
            _messageRepository     = ServiceLocator.Current.GetInstance <IMessageRepository>();
            _messageService        = ServiceLocator.Current.GetInstance <IMessageService>();
            _unitOfWork            = ServiceLocator.Current.GetInstance <IUnitOfWork>();

            CreateUserMessagesLists();
        }
Esempio n. 11
0
        public LoginViewModel(IUserService userService,
                              IUserDataService userDataService,
                              IUserMessageService userMessageService)
        {
            _userService        = userService;
            _userDataService    = userDataService;
            _userMessageService = userMessageService;

            LogoutCommand = new RelayCommand(() =>
            {
                userService.SetUser(null);
            });
        }
Esempio n. 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddNewProductViewModel"/> class.
        /// </summary>
        /// <param name="patternManager">The pattern manager.</param>
        /// <param name="userMessageService">The user message service.</param>
        public AddNewProductViewModel(IPatternManager patternManager, IUserMessageService userMessageService)
        {
            Guard.NotNull(() => patternManager, patternManager);
            Guard.NotNull(() => userMessageService, userMessageService);

            this.allToolkits        = new ObservableCollection <InstalledToolkitInfo>(patternManager.InstalledToolkits.Select(it => new InstalledToolkitInfo(it)));
            this.toolkitsView       = new ListCollectionView(this.allToolkits);
            this.patternManager     = patternManager;
            this.userMessageService = userMessageService;
            this.CurrentToolkit     = this.allToolkits.FirstOrDefault();
            this.SortingItems       = GetSortingItems();
            this.SortingItem        = this.SortingItems.FirstOrDefault();
            this.InitializeCommands();
            this.ArrangeToolkits();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AddNewProductViewModel"/> class.
        /// </summary>
        /// <param name="patternManager">The pattern manager.</param>
        /// <param name="userMessageService">The user message service.</param>
        public AddNewProductViewModel(IPatternManager patternManager, IUserMessageService userMessageService)
        {
            Guard.NotNull(() => patternManager, patternManager);
            Guard.NotNull(() => userMessageService, userMessageService);

            this.allToolkits = new ObservableCollection<InstalledToolkitInfo>(patternManager.InstalledToolkits.Select(it => new InstalledToolkitInfo(it)));
            this.toolkitsView = new ListCollectionView(this.allToolkits);
            this.patternManager = patternManager;
            this.userMessageService = userMessageService;
            this.CurrentToolkit = this.allToolkits.FirstOrDefault();
            this.SortingItems = GetSortingItems();
            this.SortingItem = this.SortingItems.FirstOrDefault();
            this.InitializeCommands();
            this.ArrangeToolkits();
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddNewNodeViewModel"/> class.
        /// </summary>
        /// <param name="siblings">The sibilings.</param>
        /// <param name="info">The info.</param>
        /// <param name="userMessageService">The user message service.</param>
        public AddNewNodeViewModel(
            IEnumerable <IProductElement> siblings,
            IPatternElementInfo info,
            IUserMessageService userMessageService)
        {
            Guard.NotNull(() => siblings, siblings);
            Guard.NotNull(() => info, info);
            Guard.NotNull(() => userMessageService, userMessageService);

            this.info               = info;
            this.sibilings          = siblings;
            this.instanceName       = siblings.GetNewUniqueName(info.DisplayName);
            this.userMessageService = userMessageService;
            this.InitializeCommands();
        }
Esempio n. 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddNewNodeViewModel"/> class.
        /// </summary>
        /// <param name="siblings">The sibilings.</param>
        /// <param name="info">The info.</param>
        /// <param name="userMessageService">The user message service.</param>
        public AddNewNodeViewModel(
            IEnumerable<IProductElement> siblings,
            IPatternElementInfo info,
            IUserMessageService userMessageService)
        {
            Guard.NotNull(() => siblings, siblings);
            Guard.NotNull(() => info, info);
            Guard.NotNull(() => userMessageService, userMessageService);

            this.info = info;
            this.sibilings = siblings;
            this.instanceName = siblings.GetNewUniqueName(info.DisplayName);
            this.userMessageService = userMessageService;
            this.InitializeCommands();
        }
Esempio n. 16
0
 public MessagesController(
     IMessagesViewModelService messagesViewModelService,
     IUserService userService,
     IUnitOfWork unitOfWork,
     IUserMessageService userMessageService,
     IMessageService messageService,
     IMessageFavouriteService messageFavouriteService,
     IFileService fileService)
 {
     _messagesViewModelService = messagesViewModelService;
     _userService             = userService;
     _unitOfWork              = unitOfWork;
     _userMessageService      = userMessageService;
     _messageService          = messageService;
     _messageFavouriteService = messageFavouriteService;
     _fileService             = fileService;
 }
Esempio n. 17
0
        public void Initialize()
        {
            var authentication = MockRepository.GenerateMock<IAuthenticationService>();

            authentication.Stub(x => x.Identity).Return(new FakeUserIdentity());

            var user = MockRepository.GenerateMock<IUserService>();

            user.Stub(x => x.GetById(1)).Return(new User());

            this.UserMessageService = new UserMessageService(
                authentication,
                MockRepository.GenerateMock<ITextFormattingService>(),
                user,
                new FakeUserMessageRepository(),
                new FakeUserMessageFolderRepository()
            );
        }
Esempio n. 18
0
        public void ShouldCopyDataToClipboard()
        {
            //Given
            DictionaryBase doc1 = new Document()
            {
                { "first_name", "Bill" }, { "middle_initial", "Q" }, { "last_name", "Jackson" }, { "address", "744 Nottingham St." }
            };
            DictionaryBase doc3 = new Document()
            {
                { "first_name", "Ronald" }, { "middle_initial", "Q" }, { "last_name", "Weasly" }, { "city", "Santa Rosa" }
            };
            IList <DictionaryBase> documents = new List <DictionaryBase>()
            {
                doc1, doc3
            };
            IMongoQuery query = MockRepository.GenerateStub <IMongoQuery>();

            query.Stub(q => q.RunQuery("localhost", "test", "27017", "folks:this.middle_initial == 'Q'")).Return(documents);
            IMongoQueryFactory queryFactory = MockRepository.GenerateStub <IMongoQueryFactory>();

            queryFactory.Stub(factory => factory.BuildQuery()).Return(query);
            IClipboardService   clipboardService = MockRepository.GenerateMock <IClipboardService>();
            IUserMessageService messageService   = MockRepository.GenerateMock <IUserMessageService>();

            MainViewModel viewModel = new MainViewModel()
            {
                Server             = "localhost",
                Database           = "test",
                Port               = "27017",
                Query              = "folks:this.middle_initial == 'Q'",
                MongoQueryFactory  = queryFactory,
                ClipboardService   = clipboardService,
                UserMessageService = messageService
            };

            //When
            viewModel.RunQueryCommand.Execute(null);
            viewModel.CopyToClipboardCommand.Execute(null);

            //Then
            clipboardService.AssertWasCalled(clipboard => clipboard.SetText(
                                                 "last_name\tfirst_name\tmiddle_initial\taddress\tcity\t\r\nJackson\tBill\tQ\t744 Nottingham St.\t\t\r\nWeasly\tRonald\tQ\t\tSanta Rosa\t\r\n"));
            messageService.AssertWasCalled(service => service.ShowMessage("Results copied to clipboard"));
        }
Esempio n. 19
0
        public AccountViewModel(IAccountIdentService accountIdentService, IUserMessageService userMessageService, ICardReader cardReader)
        {
            _accountIdentService = accountIdentService;
            _userMessageService  = userMessageService;

            if (cardReader != null)
            {
                this.cardReader = cardReader;
                this.cardReader.CardInserted += CardReaderCardInserted;
                this.cardReader.CardRemoved  += CardReaderCardRemoved;
            }

            BusyScope           = BusyScope.Default;
            DocumentTypes       = new ObservableCollection <PersonalDocumentDescription>();
            CancelCommand       = new DelegateCommand(Cancel, () => Account != null).ObservesProperty(() => Account);
            RegistrationCommand = new DelegateCommand(Registration);
            FindCommand         = new DelegateCommand(TryFindByDocument);

            LoadData();
        }
Esempio n. 20
0
        public BetEditorViewModel(IDataService dataService, IAccountIdentService accountIdentService, IBetReceiptProvider receiptService, IProcessingService processingService, IUserMessageService userMessageService)
        {
            DataService         = dataService;
            AccountIdentService = accountIdentService;
            ReceiptService      = receiptService;
            ProcessingService   = processingService;
            UserMessageService  = userMessageService;

            Items    = new ObservableCollection <object>();
            Events   = new EventsViewModel(dataService, SelectedEventAction);
            Draws    = new SuperexpressDrawsViewModel(dataService, SelectedDrawAction);
            MadeBets = new MadeBetsViewModel(DataService, SelectedMadeBet);

            RemoveBetCommand             = new DelegateCommand <object>(RemoveBet);
            SwitchToExpressCommand       = new DelegateCommand <BaseBetViewModel>(SwitchToExpress);
            SwitchToSystemCommand        = new DelegateCommand <BaseBetViewModel>(SwitchToSystem, x => false);
            CreateExpressBetCommand      = new DelegateCommand(CreateNewExpressBet);
            CreateSuperexpressBetCommand = new DelegateCommand(CreateNewSuperexpressBet);

            this.OfInpc(x => x.PropertyChanged += SelfPropertyChanged);
        }
Esempio n. 21
0
        public void ShouldShowErrorWhenShowingCollectionsWithNoDatabaseSpecified()
        {
            //Given
            IMongoQueryFactory  queryFactory   = MockRepository.GenerateStub <IMongoQueryFactory>();
            IUserMessageService messageService = MockRepository.GenerateMock <IUserMessageService>();

            MainViewModel viewModel = new MainViewModel()
            {
                Server             = "localhost",
                Database           = "",
                Port               = "27017",
                Query              = "folks:this.middle_initial == 'Q'",
                MongoQueryFactory  = queryFactory,
                UserMessageService = messageService
            };

            //When
            viewModel.ShowCollectionsCommand.Execute(null);

            //Then
            messageService.AssertWasCalled(service => service.ShowMessage("You must specify a non-empty database name"));
        }
 public HostedExtensionPointPropertyDescriptor(PropertyDescriptor descriptor, ExtensionPointSchema extensionPoint, IUserMessageService messageService, params Attribute[] attributes)
     : base(descriptor, attributes)
 {
     this.extensionPoint = extensionPoint;
     this.messageService = messageService;
 }
Esempio n. 23
0
        public BetViewModel(IDataService dataService, IAccountIdentService accountIdentService, IProcessingService betProcessingService, IUserMessageService userMessageService)
            : base(accountIdentService, betProcessingService, userMessageService)
        {
            DataService   = dataService;
            Subscriptions = new Dictionary <int, IDisposable>();

            SetBet(new ExpressBetModel());
            Bet.SetValidator(new ExpressBetValidator());
            RemoveEventCommand = new DelegateCommand <BetEventModel>(RemoveEvent);
        }
Esempio n. 24
0
 public UserMessageController(IUserMessageService userMessageService)
 {
     _userMessageService = userMessageService;
 }
Esempio n. 25
0
 public UserMessagesController(IUserMessageService service)
 {
     this.service = service;
 }
 public void Init(IValidationProvider validationProvider, IUserMessageService message)
 {
     _validationProvider = validationProvider;
     _message            = message;
 }
Esempio n. 27
0
 public TestPatternManager(IServiceProvider serviceProvider, ISolution solution, IShellEvents shellEvents, ISolutionEvents solutionEvents, IItemEvents itemEvents, IEnumerable <IInstalledToolkitInfo> installedFactories, IUserMessageService messageService)
     : base(serviceProvider, solution, shellEvents, solutionEvents, itemEvents, installedFactories, messageService)
 {
 }
 public TestPatternManager(IServiceProvider serviceProvider, ISolution solution, IShellEvents shellEvents, ISolutionEvents solutionEvents, IItemEvents itemEvents, IEnumerable<IInstalledToolkitInfo> installedFactories, IUserMessageService messageService)
     : base(serviceProvider, solution, shellEvents, solutionEvents, itemEvents, installedFactories, messageService)
 {
 }
        public SuperexpressBetViewModel(IDataService dataService, IAccountIdentService accountIdentService, IProcessingService betProcessingService, IUserMessageService userMessageService)
            : base(accountIdentService, betProcessingService, userMessageService)
        {
            _dataService = dataService;

            Headers = new ObservableCollection <string>();
            Events  = new ObservableCollection <EventViewModel>();

            RandomGameCommand    = new DelegateCommand(RandomGame);
            SelectOutcomeCommand = new DelegateCommand <CoefficientViewModel>(SelectOutcome);
        }
Esempio n. 30
0
 public HostedExtensionPointPropertyDescriptor(PropertyDescriptor descriptor, ExtensionPointSchema extensionPoint, IUserMessageService messageService, params Attribute[] attributes)
     : base(descriptor, attributes)
 {
     this.extensionPoint = extensionPoint;
     this.messageService = messageService;
 }
Esempio n. 31
0
 public MessageRoutingService(IUserMessageService messageService, IAdminMessageService adminMessageService)
 {
     _userMessageService  = messageService ?? throw new ArgumentNullException(nameof(messageService));
     _adminMessageService = adminMessageService ?? throw new ArgumentNullException(nameof(adminMessageService));
 }