public ExcelExportViewModel(IRepository <IEntry> repository, ISkyDriveService skyDrive, ILoggingService log, IIAPService iap) { if (repository == null) { throw new ArgumentNullException("repository"); } _repository = repository; if (skyDrive == null) { throw new ArgumentNullException("skyDrive"); } _skyDriveService = skyDrive; if (log == null) { throw new ArgumentNullException("log"); } _log = log; if (iap == null) { throw new ArgumentNullException("iap"); } _iapService = iap; ExportCommand = new RelayCommand(CsvExport); }
public void Configure(NetworkServicesConfig config) { if (clubPenguinClient != null) { clubPenguinClient.Destroy(); } clubPenguinClient = new ClubPenguinClient(monoBehaviour, config.CPAPIServicehost, config.CPAPIClientToken, config.ClientApiVersion, config.CPGameServerZone, !offlineMode && config.CPGameServerEncrypted, config.CPGameServerDebug, config.CPLagMonitoring, config.CPGameServerLatencyWindowSize, config.CPWebServiceLatencyWindowSize, config.CPMonitoringServicehost, config.CPWebsiteAPIServicehost, offlineMode); currentConfig = config; worldService = new WorldService(); worldService.Initialize(clubPenguinClient); playerStateService = new PlayerStateService(); playerStateService.Initialize(clubPenguinClient); chatService = new ChatService(); chatService.Initialize(clubPenguinClient); playerActionService = new PlayerActionService(); playerActionService.Initialize(clubPenguinClient); iglooService = new IglooService(); iglooService.Initialize(clubPenguinClient); inventoryService = new InventoryService(); inventoryService.Initialize(clubPenguinClient); breadcrumbService = new BreadcrumbService(); breadcrumbService.Initialize(clubPenguinClient); savedOutfitService = new SavedOutfitService(); savedOutfitService.Initialize(clubPenguinClient); prototypeService = new PrototypeService(); prototypeService.Initialize(clubPenguinClient); questService = new QuestService(); questService.Initialize(clubPenguinClient); consumableService = new ConsumableService(); consumableService.Initialize(clubPenguinClient); friendsService = new FriendsService(); friendsService.Initialize(clubPenguinClient); rewardService = new RewardService(); rewardService.Initialize(clubPenguinClient); taskService = new TaskNetworkService(); taskService.Initialize(clubPenguinClient); minigameService = new MinigameService(); minigameService.Initialize(clubPenguinClient); iapService = new IAPService(); iapService.Initialize(clubPenguinClient); tutorialService = new TutorialService(); tutorialService.Initialize(clubPenguinClient); moderationService = new ModerationService(); moderationService.Initialize(clubPenguinClient); disneyStoreService = new DisneyStoreService(); disneyStoreService.Initialize(clubPenguinClient); newsfeedService = new NewsfeedService(); newsfeedService.Initialize(clubPenguinClient); catalogService = new CatalogService(); catalogService.Initialize(clubPenguinClient); partyGameService = new PartyGameService(); partyGameService.Initialize(clubPenguinClient); scheduledEventService = new ScheduledEventService(); scheduledEventService.Initialize(clubPenguinClient); diagnosticsService = new DiagnosticsService(); diagnosticsService.Initialize(clubPenguinClient); captchaService = new CaptchaService(); captchaService.Initialize(clubPenguinClient); }
public DateEditViewModel(IRepository <IEntry> repository, IIAPService iapService) { if (repository == null) { throw new ArgumentNullException("repository"); } _repository = repository; if (iapService == null) { throw new ArgumentNullException("iapService"); } _iapService = iapService; _entries = new ObservableCollection <EntryViewModel>(); _entries.CollectionChanged += _entries_CollectionChanged; _addEntryCommand = new RelayCommand(AddEntry); }
public MainViewModel(IRepository <IEntry> repository, ISettingsService settings, SyncService sync, ILoggingService log, IIAPService iapService) { if (repository == null) { throw new ArgumentNullException("repository"); } _repository = repository; if (settings == null) { throw new ArgumentNullException("settings"); } _settings = settings; if (sync == null) { throw new ArgumentNullException("sync"); } _syncService = sync; if (log == null) { throw new ArgumentNullException("log"); } _log = log; if (iapService == null) { throw new ArgumentNullException("iapService"); } _iapService = iapService; _dateEntries = new ObservableCollection <CalendarItemViewModel>(); _dateEntries.CollectionChanged += _dateEntries_CollectionChanged; _summaryEntries = new ObservableCollection <CalendarItemViewModel>(); _summaryEntries.CollectionChanged += _summaryEntries_CollectionChanged; _summaryGroups = new ObservableCollection <DateTime>(); _summaryGroups.CollectionChanged += _summaryGroups_CollectionChanged; #pragma warning disable 1998 SyncCommand = new AsyncRelayCommand(async(o) => { SyncRunning = true; await _syncService.Sync(); }, null, async() => { SyncRunning = false; }, (ex) => { //TODO: Handle Error SyncRunning = false; throw ex; }); RemoveAdsCommand = new AsyncRelayCommand(async(o) => { var productIds = await _iapService.GetProductIds(); await _iapService.PurchaseProduct(productIds[0]); }, null, async() => { RaisePropertyChanged(() => AreAdsVisible); }, (ex) => { }); }
public SettingsViewModel(ISettingsService settings, SyncService sync, IIAPService iapService) { if (settings == null) { throw new ArgumentNullException("settings"); } _settings = settings; if (sync == null) { throw new ArgumentNullException("sync"); } _syncService = sync; if (iapService == null) { throw new ArgumentNullException("iapService"); } _iapService = iapService; #pragma warning disable 1998 ConnectCommand = new AsyncRelayCommand(async(o) => { if (!_syncService.IsConnected) { await _syncService.Authenticate(); } else { _syncService.Disconnect(); } }, null, async() => { if (SyncEnabled && _syncService.IsConnected) { SyncCommand.Execute(null); } RaisePropertyChanged(() => SyncEnabled); RaisePropertyChanged(() => IsConnected); RaisePropertyChanged(() => ConnectLabel); RaisePropertyChanged(() => OnOffText); }, (ex) => { //TODO: Handle Error }); SyncCommand = new AsyncRelayCommand(async(o) => { SyncRunning = true; await _syncService.Sync(); }, null, async() => { SyncRunning = false; }, (ex) => { //TODO: Handle Error SyncRunning = false; throw ex; }); #pragma warning restore 1998 }