public FlistService(IAccount model, IEventAggregator eventagg, IBrowseThings browser, IGetTickets ticketService, IFriendRequestService requestService) { this.browser = browser; this.ticketService = ticketService; this.requestService = requestService; try { this.model = model.ThrowIfNull("model"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent <LoginEvent>().Subscribe(GetTicket, ThreadOption.BackgroundThread); events.GetEvent <UserCommandEvent>().Subscribe(HandleCommand, ThreadOption.BackgroundThread); events.GetEvent <CharacterSelectedLoginEvent>().Subscribe(args => selectedCharacter = args); // fix problem with SSL not being trusted on some machines ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } catch (Exception ex) { Exceptions.HandleException(ex); } }
public SearchTabViewModel(IChatState chatState, IBrowseThings browser) : base(chatState) { this.browser = browser; Container.RegisterType <object, SearchTabView>(SearchTabView); chatSearchCooldownTimer.Elapsed += (sender, args) => { isInSearchCoolDown = false; OnPropertyChanged("CanStartSearch"); chatSearchCooldownTimer.Stop(); }; saveTerms = DeferredAction.Create( () => SettingsService.SaveSearchTerms(ChatModel.CurrentCharacter.Name, new SearchTermsModel { AvailableTerms = availableSearchTerms.ToList(), SelectedTerms = selectedSearchTerms.ToList() })); if (ChatModel.CurrentCharacter == null) { return; } GetSearchTerms(ChatModel.CurrentCharacter.Name); }
public FlistService(IAccount model, IEventAggregator eventagg, IBrowseThings browser, IGetTickets ticketService, IFriendRequestService requestService) { this.browser = browser; this.ticketService = ticketService; this.requestService = requestService; try { this.model = model.ThrowIfNull("model"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent<LoginEvent>().Subscribe(GetTicket, ThreadOption.BackgroundThread); events.GetEvent<UserCommandEvent>().Subscribe(HandleCommand, ThreadOption.BackgroundThread); events.GetEvent<CharacterSelectedLoginEvent>().Subscribe(args => selectedCharacter = args); // fix problem with SSL not being trusted on some machines ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } catch (Exception ex) { Exceptions.HandleException(ex); } }
public NoteService(IChatState chatstate, IBrowseThings browser) { this.browser = browser; characters = chatstate.CharacterManager; cm = chatstate.ChatModel; events = chatstate.EventAggregator; container = chatstate.Container; }
public HomeChannelViewModel(string name, IChatState chatState, IAutomateThings automation, IBrowseThings browser, HomeSettingsViewModel settingsVm, HomeHelpViewModel helpVm, IUpdateMyself updateService) : base(chatState) { try { Model = Container.Resolve<GeneralChannelModel>(name); ConnectTime = 0; flavorText = new StringBuilder("Connecting"); connectDotDot = new StringBuilder(); this.updateService = updateService; HelpVm = helpVm; Container.RegisterType<object, HomeChannelView>(Model.Id, new InjectionConstructor(this)); minuteOnlineCount = new CacheCount(OnlineCountPrime, 15, 1000*15); updateTimer.Enabled = true; updateTimer.Elapsed += (s, e) => { OnPropertyChanged("RoughServerUpTime"); OnPropertyChanged("RoughClientUpTime"); OnPropertyChanged("LastMessageReceived"); }; updateTimer.Elapsed += UpdateConnectText; SettingsVm = settingsVm; Events.GetEvent<NewUpdateEvent>().Subscribe(param => { var temp = param as CharacterUpdateModel; if (!(temp?.Arguments is LoginStateChangedEventArgs)) return; OnPropertyChanged("OnlineCount"); OnPropertyChanged("OnlineFriendsCount"); OnPropertyChanged("OnlineBookmarksCount"); OnPropertyChanged("OnlineCountChange"); }); Events.GetEvent<LoginAuthenticatedEvent>().Subscribe(LoggedInEvent); Events.GetEvent<LoginFailedEvent>().Subscribe(LoginFailedEvent); Events.GetEvent<ReconnectingEvent>().Subscribe(LoginReconnectingEvent); this.automation = automation; this.browser = browser; LoggingSection = "utility channel vm"; Themes = new ObservableCollection<ThemeModel>(); } catch (Exception ex) { ex.Source = "Utility Channel ViewModel, init"; Exceptions.HandleException(ex); } }
public ProfileService(IChatState chatState, IBrowseThings browser) { this.browser = browser; cm = chatState.ChatModel; state = chatState; chatState.EventAggregator.GetEvent<LoginAuthenticatedEvent>().Subscribe(GetProfileDataAsync); var worker = new BackgroundWorker(); worker.DoWork += GetKinkDataAsync; worker.RunWorkerAsync(); }
public ProfileService(IChatState chatState, IBrowseThings browser) { this.browser = browser; cm = chatState.ChatModel; state = chatState; chatState.EventAggregator.GetEvent <LoginAuthenticatedEvent>().Subscribe(GetProfileDataAsync); var worker = new BackgroundWorker(); worker.DoWork += GetKinkDataAsync; worker.RunWorkerAsync(); }
public FriendRequestService(IBrowseThings browser, IGetTickets ticketService, IAccount account, IEventAggregator events, ICharacterManager characterManager) { this.browser = browser; this.ticketService = ticketService; this.account = account; this.events = events; this.characterManager = characterManager; events.GetEvent<CharacterSelectedLoginEvent>().Subscribe(result => { selectedCharacter = result; UpdateOutgoingRequests(); UpdatePendingRequests(); }); }
public FriendRequestService(IBrowseThings browser, IGetTickets ticketService, IAccount account, IEventAggregator events, ICharacterManager characterManager) { this.browser = browser; this.ticketService = ticketService; this.account = account; this.events = events; this.characterManager = characterManager; events.GetEvent <CharacterSelectedLoginEvent>().Subscribe(result => { selectedCharacter = result; UpdateOutgoingRequests(); UpdatePendingRequests(); }); }
public SearchTabViewModel(IChatState chatState, IBrowseThings browser) : base(chatState) { this.browser = browser; Container.RegisterType<object, SearchTabView>(SearchTabView); chatSearchCooldownTimer.Elapsed += (sender, args) => { isInSearchCoolDown = false; OnPropertyChanged("CanStartSearch"); chatSearchCooldownTimer.Stop(); }; saveTerms = DeferredAction.Create( () => SettingsService.SaveSearchTerms(ChatModel.CurrentCharacter.Name, new SearchTermsModel { AvailableTerms = availableSearchTerms.ToList(), SelectedTerms = selectedSearchTerms.ToList() })); if (ChatModel.CurrentCharacter == null) return; GetSearchTerms(ChatModel.CurrentCharacter.Name); }
public HomeChannelViewModel(string name, IChatState chatState, IAutomateThings automation, IBrowseThings browser, HomeSettingsViewModel settingsVm, HomeHelpViewModel helpVm, IUpdateMyself updateService) : base(chatState) { try { Model = Container.Resolve <GeneralChannelModel>(name); ConnectTime = 0; flavorText = new StringBuilder("Connecting"); connectDotDot = new StringBuilder(); this.updateService = updateService; HelpVm = helpVm; Container.RegisterType <object, HomeChannelView>(Model.Id, new InjectionConstructor(this)); minuteOnlineCount = new CacheCount(OnlineCountPrime, 15, 1000 * 15); updateTimer.Enabled = true; updateTimer.Elapsed += (s, e) => { OnPropertyChanged("RoughServerUpTime"); OnPropertyChanged("RoughClientUpTime"); OnPropertyChanged("LastMessageReceived"); }; updateTimer.Elapsed += UpdateConnectText; SettingsVm = settingsVm; Events.GetEvent <NewUpdateEvent>().Subscribe(param => { var temp = param as CharacterUpdateModel; if (!(temp?.Arguments is LoginStateChangedEventArgs)) { return; } OnPropertyChanged("OnlineCount"); OnPropertyChanged("OnlineFriendsCount"); OnPropertyChanged("OnlineBookmarksCount"); OnPropertyChanged("OnlineCountChange"); }); Events.GetEvent <LoginAuthenticatedEvent>().Subscribe(LoggedInEvent); Events.GetEvent <LoginFailedEvent>().Subscribe(LoginFailedEvent); Events.GetEvent <ReconnectingEvent>().Subscribe(LoginReconnectingEvent); this.automation = automation; this.browser = browser; LoggingSection = "utility channel vm"; Themes = new ObservableCollection <ThemeModel>(); } catch (Exception ex) { ex.Source = "Utility Channel ViewModel, init"; Exceptions.HandleException(ex); } }
public TicketService(IBrowseThings browser) { this.browser = browser; }
public UpdateService(IBrowseThings browser) { this.browser = browser; }