public ApiFactory(IApiChannels apiChannels, IApiMonths apiMonths, IApiDays apiDays,
                   IApiLogs apiLogs, IApiUserlogs apiUserlogs, IApiMentions apiMentions)
 {
     _apiChannels = apiChannels;
     _apiMonths   = apiMonths;
     _apiDays     = apiDays;
     _apiLogs     = apiLogs;
     _apiUserlogs = apiUserlogs;
     _apiMentions = apiMentions;
 }
示例#2
0
 public MonthsViewModel(IApiMonths apiMonths, Action <string, string> changeTitle, CurrentState currentState)
 {
     RefreshMonthCommand = new ActionCommand(async() => await GetMonths());
     SwitchToDaysCommand = new ActionCommand(m => _currentState.SwitchViewToDays((MonthModel)m));
     _apiMonths          = apiMonths;
     _currentState       = currentState;
     changeTitle(_currentState.Channel.Name, null);
     if (_currentState.Channel.Months != null)
     {
         MonthsList = _currentState.Channel.Months;
         return;
     }
     GetMonths().ConfigureAwait(false);
 }
示例#3
0
 public ApiLogs(IApiMonths apiMonths, Action <string> snackbarMessageQueue)
 {
     _apiMonths            = apiMonths;
     _snackbarMessageQueue = snackbarMessageQueue;
     if (_httpClient == null)
     {
         _httpClient = new HttpClient {
             Timeout = TimeSpan.FromMinutes(1),
             DefaultRequestHeaders =
             {
                 UserAgent = { ProductInfoHeaderValue.Parse("Overrustlelogs-Desktop") }
             }
         };
     }
 }