예제 #1
0
 public RmqProfileHandler(Messenger messenger, IDispatcherHelper dispatcher, IErrorService errorService, IClipboardService clipboardService)
 {
     _messenger        = messenger;
     _dispatcher       = dispatcher;
     _errorService     = errorService;
     _clipboardService = clipboardService;
 }
예제 #2
0
        public MainViewModel(ICategoryService categoryService, IDialogService dialogService,
                             ILocalizedStringProvider localizedStringProvider, ILoggingService loggingService,
                             IAuthenticationService authService, INavigationService navigationService, ICourseService courseService,
                             IDispatcherHelper dispatcher)
            : base(dialogService, localizedStringProvider, loggingService, authService, dispatcher, navigationService)
        {
            _categoryService = categoryService;
            _courseService   = courseService;
            _dispatcher      = dispatcher;

            Categories   = new ObservableCollection <Category>();
            _lockObject  = new object();
            FoundCourses = new ObservableCollection <Course>();

            Messenger.Default.Register <PropertyChangedMessage <string> >(this,
                                                                          message =>
            {
                if (message.PropertyName == nameof(SearchValue))
                {
                    UpdateSearchResultsAsync(message.NewValue);
                }
            });
            Messenger.Default.Register <AuthenticationChangedMessage>(this,
                                                                      m => _dispatcher.ExecuteOnUiThread(() => Identity = m.NewIdentity));

            if (IsInDesignModeStatic)
            {
                var identity = new Identity();
                identity.AddClaims(new Claim(Claim.FamilyNameName, Claim.FamilyNameName),
                                   new Claim(Claim.EmailName, Claim.EmailName), new Claim(Claim.GivenNameName, Claim.GivenNameName));
                Identity = identity;
            }
        }
예제 #3
0
        public DeviceListViewModel(IDispatcherHelper dispatcherHelper, 
            INavigationService navigationService,
            IAdapter adapter,
            Func<IDevice, DeviceViewModel> deviceViewModelFactory)
        {
            _dispatcherHelper = dispatcherHelper;
            _navigationService = navigationService;
            _adapter = adapter;
            _deviceViewModelFactory = deviceViewModelFactory;

            _adapter.ScanTimeoutElapsed += (s, e) =>
            {
                StopScan();
            };
            _adapter.DeviceDiscovered += (s, e) =>
            {
                if (_devices.All(d => d.ID != e.Device.ID))
                {
                    _dispatcherHelper.RunOnUIThread(() =>
                        {
                            _devices.Add(e.Device);
                        });
                }
            };
        }
예제 #4
0
 public CollectionService(
     ISqlService sqlService,
     ISqlService bgSqlService,
     IAppSettingsHelper appSettingsHelper,
     IDispatcherHelper dispatcher,
     IBitmapFactory bitmapFactory,
     IBitmapImage missingArtwork,
     string localFilePrefix,
     string artworkFilePath,
     string artistArtworkFilePath)
 {
     _bgSqlService          = bgSqlService;
     _sqlService            = sqlService;
     _dispatcher            = dispatcher;
     _appSettingsHelper     = appSettingsHelper;
     _bitmapFactory         = bitmapFactory;
     _missingArtwork        = missingArtwork;
     _localFilePrefix       = localFilePrefix;
     _artworkFilePath       = artworkFilePath;
     _artistArtworkFilePath = artistArtworkFilePath;
     Songs                = new OptimizedObservableCollection <Song>();
     Artists              = new OptimizedObservableCollection <Artist>();
     Albums               = new OptimizedObservableCollection <Album>();
     Playlists            = new OptimizedObservableCollection <Playlist>();
     PlaybackQueue        = new OptimizedObservableCollection <QueueSong>();
     ShufflePlaybackQueue = new OptimizedObservableCollection <QueueSong>();
 }
예제 #5
0
 public CollectionService(
     ISqlService sqlService,
     ISqlService bgSqlService,
     IAppSettingsHelper appSettingsHelper,
     IDispatcherHelper dispatcher,
     IBitmapFactory bitmapFactory,
     IBitmapImage missingArtwork,
     string localFilePrefix,
     string artworkFilePath,
     string artistArtworkFilePath)
 {
     _bgSqlService = bgSqlService;
     _sqlService = sqlService;
     _dispatcher = dispatcher;
     _appSettingsHelper = appSettingsHelper;
     _bitmapFactory = bitmapFactory;
     _missingArtwork = missingArtwork;
     _localFilePrefix = localFilePrefix;
     _artworkFilePath = artworkFilePath;
     _artistArtworkFilePath = artistArtworkFilePath;
     Songs = new OptimizedObservableCollection<Song>();
     Artists = new OptimizedObservableCollection<Artist>();
     Albums = new OptimizedObservableCollection<Album>();
     Playlists = new OptimizedObservableCollection<Playlist>();
     PlaybackQueue = new OptimizedObservableCollection<QueueSong>();
     ShufflePlaybackQueue = new OptimizedObservableCollection<QueueSong>();
 }
예제 #6
0
        public AudioticaService(
            ICredentialHelper credentialHelper,
            IAppSettingsHelper appSettingsHelper,
            IDispatcherHelper dispatcherHelper,
            INotificationManager notificationManager)
        {
            _credentialHelper    = credentialHelper;
            _appSettingsHelper   = appSettingsHelper;
            _dispatcherHelper    = dispatcherHelper;
            _notificationManager = notificationManager;

            var cred = _credentialHelper.GetCredentials("AudioticaCloud");

            if (cred == null)
            {
                return;
            }

            AuthenticationToken = cred.GetPassword();

            CurrentUser = _appSettingsHelper.ReadJsonAs <AudioticaUser>("AudioticaCloudUser");

            var refreshCred = _credentialHelper.GetCredentials("AudioticaCloudRefreshToken");

            if (refreshCred == null)
            {
                return;
            }

            _refreshToken = refreshCred.GetPassword();
        }
        public SessionViewModel(IDialogService dialogService, ILocalizedStringProvider loc,
                                ILoggingService loggingService, IAuthenticationService authService, IContactService contactService,
                                IDispatcherHelper dispatcher, INavigationService navigationService)
            : base(dialogService, loc, loggingService, authService, dispatcher, navigationService)
        {
            _contactService  = contactService;
            _contactForm     = new ContactForm();
            _scoredFeedback  = new ScoredFeedback();
            _subscription    = new Subscription();
            ParticipantToAdd = new Participant();

            if (IsInDesignMode)
            {
                Session  = FakeCourseService.GenerateFakeSession(123);
                Identity = new Identity();
                Subscription.Participants.Add(new Participant
                {
                    FirstName = "First",
                    LastName  = "Last",
                    Email     = "*****@*****.**"
                });
            }

            Messenger.Default.Register <AuthenticationChangedMessage>(this,
                                                                      m => DispatcherHelper.ExecuteOnUiThread(() => Identity = m.NewIdentity));
        }
예제 #8
0
        // TODO: Swap TemplatingViewModel for a TemplatingViewModelFactory
        // TODO: Swap SettingsViewModel for a SettingsViewModelFactory
        public MainWindowViewModel(
            IDataController dataController,
            ITemplatingViewModel templatingViewModel,
            ISettingsViewModel settingsViewModel,
            ISettingsManager settingsManager,
            IWindowService windowService,
            IDispatcherHelper dispatcherHelper)
        {
            IntegrityCheck.IsNotNull(dataController);
            IntegrityCheck.IsNotNull(templatingViewModel);
            IntegrityCheck.IsNotNull(settingsViewModel);
            IntegrityCheck.IsNotNull(settingsManager);
            IntegrityCheck.IsNotNull(windowService);
            IntegrityCheck.IsNotNull(dispatcherHelper);

            // Save arguments
            m_DataController      = dataController;
            m_TemplatingViewModel = templatingViewModel;
            m_SettingsViewModel   = settingsViewModel;
            m_SettingsManager     = settingsManager;
            m_WindowService       = windowService;
            m_DispatcherHelper    = dispatcherHelper;

            // Initialise the state machine
            m_StateLock = new object();
            m_StateMgr  = new StateManager <MainWindowState>(this, typeof(Uninitialised));

            // Configure commands/event handlers
            InitialiseCommands();
            m_DataController.InitialisationComplete  += DataController_InitialisationComplete;
            m_DataController.GetCaptureComplete      += DataController_GetCaptureComplete;
            m_DataController.SaveTemplateComplete    += DataController_SaveTemplateComplete;
            m_TemplatingViewModel.UserActionRequired += TemplatingViewModel_UserActionRequired;
        }
예제 #9
0
 public InAppNotificationViewModel(INotificationManager notificationManager,
                                   IDispatcherHelper dispatcherHelper)
 {
     _dispatcherHelper    = dispatcherHelper;
     _NotificationManager = notificationManager;
     // _NotificationManager.RegisterNotificationClient(this);
     ID = Guid.NewGuid().ToString();
 }
예제 #10
0
 public Mp3MatchEngine(IAppSettingsHelper settingsHelper, IAudioticaService audioticaService,
     INotificationManager notificationManager, IDispatcherHelper dispatcherHelper)
 {
     _audioticaService = audioticaService;
     _notificationManager = notificationManager;
     _dispatcherHelper = dispatcherHelper;
     _service = new Mp3SearchService(settingsHelper);
 }
예제 #11
0
 public Mp3MatchEngine(IAppSettingsHelper settingsHelper, IAudioticaService audioticaService,
                       INotificationManager notificationManager, IDispatcherHelper dispatcherHelper)
 {
     _audioticaService    = audioticaService;
     _notificationManager = notificationManager;
     _dispatcherHelper    = dispatcherHelper;
     _service             = new Mp3SearchService(settingsHelper);
 }
 public WebCourseService(IUserInitiatedClient userInitiated, ISpeculativeClient speculative,
                         ILocalizedStringProvider loc, IDispatcherHelper dispatcherHelper)
     : base(loc)
 {
     _dispatcherHelper = dispatcherHelper;
     _speculative      = speculative.Client;
     _userInitiated    = userInitiated.Client;
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GuildsService"/> class.
 /// </summary>
 /// <param name="analyticsService">The app's analytics service.</param>
 /// <param name="cacheService">The app's cache service.</param>
 /// <param name="channelsService">The app's channel service.</param>
 /// <param name="presenceService">The app's presence service.</param>
 /// <param name="dispatcherHelper">The app's dispatcher helper.</param>
 public GuildsService(
     IChannelsService channelsService,
     IDispatcherHelper dispatcherHelper,
     IPresenceService presenceService)
 {
     _channelsService  = channelsService;
     _dispatcherHelper = dispatcherHelper;
     _presenceService  = presenceService;
 }
예제 #14
0
        public void Setup()
        {
            m_DispatcherHelper = A.Fake <IDispatcherHelper>();

            m_ViewModel  = new TemplatingViewModel(m_DispatcherHelper);
            m_IViewModel = (ITemplatingViewModel)m_ViewModel;
            m_Monitor    = new EventMonitor();
            m_Monitor.AddMonitoredObject(m_ViewModel);
        }
예제 #15
0
 public DatabaseHelper(
     IDispatcherHelper dispatcher,
     IAppSettingsHelper appSettingsHelper,
     IBitmapFactory bitmapFactory)
 {
     _dispatcher        = dispatcher;
     _appSettingsHelper = appSettingsHelper;
     _bitmapFactory     = bitmapFactory;
     folderPath         = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
 }
예제 #16
0
 public WebContactService(IUserInitiatedClient apiService, ILoggingService loggingService,
                          IDialogService dialogService, ILocalizedStringProvider loc, IDispatcherHelper dispatcherHelper, IAuthenticationService authenticationService)
 {
     _loggingService        = loggingService;
     _dialogService         = dialogService;
     _loc                   = loc;
     _dispatcherHelper      = dispatcherHelper;
     _authenticationService = authenticationService;
     _apiService            = apiService.Client;
 }
        public TemplatingViewModel(IDispatcherHelper dispatcherHelper)
        {
            IntegrityCheck.IsNotNull(dispatcherHelper);

            m_DispatcherHelper = dispatcherHelper;

            m_StateLock = new object();
            Minutae     = new TrulyObservableCollection <MinutiaRecord>();
            m_StateMgr  = new StateManager <TemplatingState>(this, typeof(Uninitialised));
        }
예제 #18
0
        public NotificationListViewModel(INotificationManager notificationManager, IDispatcherHelper dispatcherHelper)
        {
            _NotificationManager = notificationManager;
            _DispatcherHelper    = dispatcherHelper;

            ClosingCommand = new RelayCommand <string>((str) => ClosingCommandExecute(str), (str) => !string.IsNullOrEmpty(str));
            ClosedCommand  = new RelayCommand <string>((str) => ClosedCommandExecute(str), (str) => !string.IsNullOrEmpty(str));

            //registering this notification client to receive future notifications from the notification manager
            _NotificationManager.RegisterNotificationClient(this);
        }
예제 #19
0
 protected ViewModelBase(IDialogService dialogService, ILocalizedStringProvider loc,
                         ILoggingService loggingService, IAuthenticationService authService, IDispatcherHelper dispatcherHelper,
                         INavigationService navigationService)
 {
     DialogService     = dialogService;
     Loc               = loc;
     LoggingService    = loggingService;
     AuthService       = authService;
     DispatcherHelper  = dispatcherHelper;
     NavigationService = navigationService;
 }
예제 #20
0
 public FindSymbolViewModel(
     IDispatcherHelper dispatcherHelper,
     IQueueProcessor queueProcessor,
     IFindSymbolService findSymbolService,
     OrdersListViewModel ordersListViewModel)
     : base(dispatcherHelper, queueProcessor)
 {
     _findSymbolService      = findSymbolService;
     OrdersListViewModel     = ordersListViewModel;
     Symbol.PropertyChanged += OnSymbolPropertyChanged;
 }
예제 #21
0
 public AsyncCommand(
     IDispatcherHelper dispatcherHelper,
     Func <Task> execute,
     Func <bool> canExecute     = null,
     IErrorHandler errorHandler = null)
 {
     _dispatcherHelper = dispatcherHelper;
     _execute          = execute;
     _canExecute       = canExecute;
     _errorHandler     = errorHandler;
 }
예제 #22
0
 public CloudSyncService(
     MobileServiceClient mobileServiceClient,
     ICollectionService collectionService,
     IAppSettingsHelper appSettingsHelper,
     ISqlService sqlService,
     IDispatcherHelper dispatcherHelper)
 {
     _mobileServiceClient = mobileServiceClient;
     _collectionService   = collectionService;
     _appSettingsHelper   = appSettingsHelper;
     _sqlService          = sqlService;
     _dispatcherHelper    = dispatcherHelper;
 }
예제 #23
0
 public NewOrderViewModelFactory(
     IDispatcherHelper dispatcherHelper,
     IQueueProcessor queueProcessor,
     IFindSymbolService findSymbolService,
     IOrderCalculationService orderCalculationService,
     IOrderManager orderManager)
 {
     _dispatcherHelper        = dispatcherHelper;
     _queueProcessor          = queueProcessor;
     _findSymbolService       = findSymbolService;
     _orderCalculationService = orderCalculationService;
     _orderManager            = orderManager;
 }
예제 #24
0
 public NewOrderViewModel(
     IDispatcherHelper dispatcherHelper,
     IQueueProcessor queueProcessor,
     IFindSymbolService findSymbolService,
     IOrderCalculationService orderCalculationService,
     IOrderManager orderManager)
     : base(dispatcherHelper, queueProcessor)
 {
     Symbol.PropertyChanged  += OnSymbolPropertyChanged;
     _findSymbolService       = findSymbolService;
     _orderCalculationService = orderCalculationService;
     _orderManager            = orderManager;
     Messenger.Default.Register <AccountSummary>(this, msg => _accountId = msg.AccountId);
     Messenger.Default.Register <OrderStatusChangedMessage>(this, OrderStatusChangedMessage.Tokens.Orders, OnOrderStatusChangedMessage);
 }
예제 #25
0
        public UserService(
            IUserStore dataStore,
            IMessenger messenger,
            IDispatcherHelper dispatcher,
            ISubscriber subscriber)
        {
            _store      = dataStore;
            _messenger  = messenger;
            _dispatcher = dispatcher;
            _subscriber = subscriber;

            subscriber.Register <UserCreated>(Handle);
            subscriber.Register <UserUpdated>(Handle);
            subscriber.Register <UserDeleted>(Handle);
        }
예제 #26
0
        public AudioticaFactory(
            IDispatcherHelper dispatcher,
            IAppSettingsHelper appSettingsHelper,
            IBitmapFactory bitmapFactory)
        {
            this.dispatcher        = dispatcher;
            this.appSettingsHelper = appSettingsHelper;
            this.bitmapFactory     = bitmapFactory;

#if __ANDROID__
            folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
#elif WINRT
            this.folderPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
#endif
        }
예제 #27
0
        public AudioticaFactory(
            IDispatcherHelper dispatcher, 
            IAppSettingsHelper appSettingsHelper, 
            IBitmapFactory bitmapFactory)
        {
            this.dispatcher = dispatcher;
            this.appSettingsHelper = appSettingsHelper;
            this.bitmapFactory = bitmapFactory;

#if __ANDROID__
            folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
#elif WINRT
            this.folderPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
#endif
        }
예제 #28
0
        public MainPageViewModel()
        {
            //this should be initiaized within IoC
            _notificationManager = new NotificationManager();
            _dispatcherHelper    = new DispatcherHelper();

            NotificationListViewModel = new NotificationListViewModel(_notificationManager, _dispatcherHelper);

            DisplayNotificationCommand                      = new Relay_Command(DisplayNotificationCommandExecute);
            DisplayDataTemplateNotificationCommand          = new Relay_Command(DisplayDataTemplateNotificationCommandExecute);
            DisplayDataTemplateNotificationNoDismissCommand = new Relay_Command(DisplayDataTemplateNotificationNoDismissCommandExecute);
            DisplayErrorTypeNotificationCommand             = new Relay_Command(DisplayErrorTypeNotificationCommandExecute);
            DisplayInfoTypeNotificationCommand              = new Relay_Command(DisplayInfoTypeNotificationCommandExecute);
            DissmissAllNotificationsCommand                 = new Relay_Command(DissmissAllNotificationsCommandExecute);
        }
예제 #29
0
        public DispatcherManager()
        {
            int type = 1;//get from config

            switch (type)
            {
            case 1:
                IDH = new Helper.DispatcherHelper();
                break;

            default:
                IDH = new Helper.DispatcherHelper();
                break;
            }
        }
예제 #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CurrentUsersService"/> class.
        /// </summary>
        /// <param name="cacheService">The app's cache service.</param>
        /// <param name="guildsService">The app's guild service.</param>
        /// <param name="presenceService">The app's presence service.</param>
        /// <param name="dispatcherHelper">The app's dispatcher helper.</param>
        public CurrentUsersService(ICacheService cacheService, IGuildsService guildsService, IPresenceService presenceService, IDispatcherHelper dispatcherHelper)
        {
            _cacheService     = cacheService;
            _guildsService    = guildsService;
            _presenceService  = presenceService;
            _dispatcherHelper = dispatcherHelper;

            Messenger.Default.Register <GatewayReadyMessage>(this, m =>
            {
                _dispatcherHelper.CheckBeginInvokeOnUi(() =>
                {
                    CurrentUser.Model    = m.EventData.User;
                    CurrentUser.Presence = new DiscordAPI.Models.Presence()
                    {
                        User    = null,
                        Game    = null,
                        GuildId = null,
                        Roles   = null,
                        Status  = m.EventData.Settings.Status,
                    };

                    CurrentUserSettings = m.EventData.Settings;
                    _presenceService.UpdateUserPrecense(CurrentUser.Model.Id, CurrentUser.Presence);
                });
            });
            Messenger.Default.Register <GatewayUserSettingsUpdatedMessage>(this, m =>
            {
                _dispatcherHelper.CheckBeginInvokeOnUi(() =>
                {
                    CurrentUserSettings = m.Settings;

                    if (!string.IsNullOrEmpty(m.Settings.Status))
                    {
                        var newPresence = new DiscordAPI.Models.Presence()
                        {
                            User    = CurrentUser.Presence.User,
                            Game    = CurrentUser.Presence.Game,
                            GuildId = CurrentUser.Presence.GuildId,
                            Roles   = CurrentUser.Presence.Roles,
                            Status  = m.Settings.Status,
                        };
                        CurrentUser.Presence = newPresence;
                        _presenceService.UpdateUserPrecense(CurrentUser.Model.Id, CurrentUser.Presence);
                    }
                });
            });
        }
 public OrdersListViewModel(
     IDispatcherHelper dispatcherHelper,
     IQueueProcessor queueProcessor,
     INewOrderViewModelFactory newOrderViewModelFactory,
     ITradeRepository tradeRepository,
     IMarketDataManager marketDataManager)
     : base(dispatcherHelper, queueProcessor)
 {
     _newOrderViewModelFactory = newOrderViewModelFactory;
     _tradeRepository          = tradeRepository;
     _marketDataManager        = marketDataManager;
     PopulateDirectionList();
     Messenger.Default.Register <OrderStatusChangedMessage>(this, OrderStatusChangedMessage.Tokens.Orders, OnOrderStatusChangedMessage);
     Messenger.Default.Register <BarPriceMessage>(this, HandleBarPriceMessage);
     Orders = new ObservableCollectionNoReset <NewOrderViewModel>(dispatcherHelper: DispatcherHelper);
     Orders.CollectionChanged += OnOrdersCollectionChanged;
 }
예제 #32
0
        public MainViewModel(
            IDispatcherHelper dispatcherHelper,
            ISystemDialogService dialogService,
            string productVersion)
        {
            ProductVersion = productVersion;

            _dispatcherHelper = dispatcherHelper;

            _dialogService = dialogService;

            _propertiesService = new CachedPropertiesService(
                "ConfidantWpf.props");
            _dataFileLocation = _propertiesService
                                .Get(nameof(DataFileLocation))?.ToString();
            if (string.IsNullOrEmpty(_dataFileLocation))
            {
                _dataFileLocation =
                    Path.GetFullPath(
                        Environment.GetFolderPath(
                            Environment.SpecialFolder.MyDocuments) +
                        $"/confidant.dat");
            }
            Index = new ObservableCollection <string>();

            GeneratePasswordCmd = new RelayCommand(
                OnGeneratePassword, () => CanGeneratePassword);
            FileCmd          = new RelayCommand(OnFile, () => CanFile);
            SearchCmd        = new RelayCommand(OnSearch, () => CanSearch);
            DeleteCmd        = new RelayCommand(OnDelete, () => CanDelete);
            SaveCmd          = new RelayCommand(OnSave, () => CanSave);
            ResetPasswordCmd = new RelayCommand(
                OnResetPassword, () => CanResetPassword);
            NewCmd       = new RelayCommand(OnNew, () => CanAddNew);
            ClearFormCmd = new RelayCommand(
                OnClearForm, () => CanClearForm);

            _timer = new Timer(120000)
            {
                AutoReset = true
            };
            _timer.Elapsed += OnTimerIntervalElapsed;

            PropertyChanged += OnPropertyChanged;
        }
        public void TestSetup()
        {
            m_DataController      = A.Fake <IDataController>();
            m_TemplatingViewModel = A.Fake <ITemplatingViewModel>();
            m_SettingsViewModel   = A.Fake <ISettingsViewModel>();
            m_SettingsManager     = A.Fake <ISettingsManager>();
            m_WindowService       = A.Fake <IWindowService>();
            m_DispatcherHelper    = A.Fake <IDispatcherHelper>();

            m_ViewModel = new MainWindowViewModel(
                m_DataController,
                m_TemplatingViewModel,
                m_SettingsViewModel,
                m_SettingsManager,
                m_WindowService,
                m_DispatcherHelper);
            m_IViewModel = (IMainWindowViewModel)m_ViewModel;
        }
예제 #34
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        /// <param name="bot">The bot.</param>
        /// <param name="settings">Bot settings.</param>        
        /// <param name="dialogs">Dialog service.</param>
        /// <param name="messageBox">MessageBox service.</param>
        /// <param name="chatrooms">The chatroom container.</param>
        /// <param name="chatRoomViewModels">Chatroom view models.</param>
        /// <param name="dispatcher">The dispatcher.</param>
        public MainWindowViewModel(Bot bot, IBotSettings settings, IModalDialogService dialogs,
            IMessageBoxService messageBox, IChatRoomContainer chatrooms, 
            IChatViewModelFactory chatRoomViewModels, IDispatcherHelper dispatcher)
        {
            this.bot = bot;
            this.settings = settings;
            this.dialogs = dialogs;
            this.messageBox = messageBox;
            this.chatRoomViewModels = chatRoomViewModels;
            this.dispatcher = dispatcher;

            // set up commands
            LoadedCommand = new RelayCommand(() => OnLoaded());

            // subscribe to events
            MessengerInstance.Register<LoginSettingsRequested>(this, OnSettingsRequested);
            chatrooms.CollectionChanged += OnChatRoomsChanged;
        }
예제 #35
0
        public SnippetService(
            IDataStore <SnippetModel> dataStore,
            Messenger messenger,
            CsScriptRunService csScriptRunService,
            IDispatcherHelper dispatcher,
            ISubscriber subscriber,
            string myName)
        {
            _store              = dataStore;
            _messenger          = messenger;
            _csScriptRunService = csScriptRunService;
            _dispatcher         = dispatcher;
            _subscriber         = subscriber;
            _myName             = myName;

            subscriber.Register <SnippetCreated>(Handle);
            subscriber.Register <SnippetUpdated>(Handle);
            subscriber.Register <SnippetDeleted>(Handle);
        }
예제 #36
0
        public DeviceViewModel(IDispatcherHelper dispatcherHelper, 
                               INavigationService navigationService, 
                               IDevice device, 
                               Func<IDevice, IMoCoBusCommService> moCoBusCommServiceFactory, 
                               Func<IMoCoBusCommService, byte, IMoCoBusProtocolService> moCoBusProtocolServiceFactory)
        {
            _dispatcherHelper = dispatcherHelper;
            _navigationService = navigationService;

            _commService = moCoBusCommServiceFactory(device);
            _commService.ConnectionChanged += CommServiceOnConnectionChanged;

            _protocolService = moCoBusProtocolServiceFactory(_commService, 3);

            ModeAstroViewModel = new ModeAstroViewModel(_dispatcherHelper, this, _protocolService);
            ModePanoViewModel = new ModePanoViewModel(_dispatcherHelper, this, _protocolService);
            ModeSmsViewModel = new ModeSmsViewModel(_dispatcherHelper, this, _protocolService);

            JoystickViewModel = new JoystickViewModel(this, _protocolService);
        }
예제 #37
0
 public ManualMatchViewModel(IAppSettingsHelper appSettingsHelper, IDispatcherHelper dispatcherHelper)
 {
     this.dispatcherHelper = dispatcherHelper;
     searchService = new Mp3SearchService(appSettingsHelper);
     MessengerInstance.Register<Song>(this, "manual-match", ReceiveSong);
 }
예제 #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsoleViewModel"/> class.
 /// </summary>
 public ConsoleViewModel(IDispatcherHelper dispatcher)
 {
     this.dispatcher = dispatcher;
     SetupColors();
 }
예제 #39
0
 public ModeAstroViewModel(IDispatcherHelper dispatcherHelper, DeviceViewModel deviceViewModel, IMoCoBusProtocolService protocolService)
 {
     _dispatcherHelper = dispatcherHelper;
     _deviceViewModel = deviceViewModel;
     _protocolService = protocolService;
 }