コード例 #1
0
 public InaraPlugin(IPlayerStateHistoryRecorder playerStateRecorder, ISettingsProvider settingsProvider, IRestClientFactory restClientFactory, IUserNotificationInterface notificationInterface)
     : base(settingsProvider)
 {
     RestClient = restClientFactory.CreateRestClient(InaraApiUrl);
     this.playerStateRecorder          = playerStateRecorder;
     this.notificationInterface        = notificationInterface;
     EventConverter                    = new InaraEventConverter(this.playerStateRecorder);
     settingsProvider.SettingsChanged += (o, e) => ReloadSettings();
     ReloadSettings();
 }
コード例 #2
0
        public EdsmPlugin(ISettingsProvider settingsProvider, IPlayerStateHistoryRecorder playerStateRecorder, IRestClientFactory restClientFactory, IUserNotificationInterface notificationInterface)
            : base(settingsProvider)
        {
            RestClient     = restClientFactory.CreateRestClient(EdsmApiUrl);
            EventConverter = new EdsmEventConverter(playerStateRecorder);
            ignoredEvents  =
                RestClient.GetAsync("discard")
                .ContinueWith((t) => t.IsFaulted ? new HashSet <string>() : new HashSet <string>(JArray.Parse(t.Result).ToObject <string[]>()));

            settingsProvider.SettingsChanged += (o, e) => ReloadSettings();
            ReloadSettings();
            this.notificationInterface = notificationInterface;
        }