public static int GetPlatformImageId(this MobfoxApplication element) { switch (element.Type) { case MobfoxApplication.WindowsPhoneApp: return(Resource.Drawable.ic_wp); case MobfoxApplication.Androidpp: return(Resource.Drawable.ic_android); default: return(Resource.Drawable.ic_ios); } }
public Task <MobfoxReport> GetReportAsync(MobfoxApplication application = null, DateTime?startDate = null, DateTime?endDate = null) { return(Task.Run(async() => { var @params = new List <KeyValuePair <string, string> >(); if (application != null) { @params.Add(new KeyValuePair <string, string>(AppIdParameter, application.Id)); } if (startDate != null) { @params.Add(new KeyValuePair <string, string>(StartDateParameter, startDate.Value.ToString(DateFormat))); } if (endDate != null) { @params.Add(new KeyValuePair <string, string>(EndDateParameter, endDate.Value.ToString(DateFormat))); } var uri = QueryStringHelpers.Build(@params, BuildAuthPathFor(PublisherReportMethod)); // Mobfox dont recognize parameters if they start with '?'... uri = uri.Replace('?', '&'); try { var report = (await GetMobfoxAsync <MobfoxReportResponse>(uri)).ReportInternal.Statistics; report.StartTime = startDate.HasValue ? startDate.Value.Date : startDate; report.EndTime = endDate.HasValue ? endDate.Value.Date : endDate; return report; } catch (FormatException e) { throw new MobfoxNoReportException(string.Empty, e); } })); }
public ApplicationViewModel(ReportsController reportsController, IAppNavigationService navigationService) { _reportsController = reportsController; _navigationService = navigationService; Messenger.Register <MobfoxApplication>(this, (a) => CurrentApplication = a); }
public Task <MobfoxReport> GetDailyReport(DateTime date, MobfoxApplication app = null) { return(_mobfoxService.GetReportOfDate(date, app)); }
public Task <MobfoxReport> GetYesterdayReport(MobfoxApplication app = null) { return(_mobfoxService.GetYesterdayReport(app)); }
public Task <MobfoxReport> GetOverallReport(MobfoxApplication app = null) { return(_mobfoxService.GetReportAsync(app)); }
public Task <MobfoxReport> GetLastMonthReport(MobfoxApplication app = null) { return(_mobfoxService.GetLastMonthReport(app)); }
public Task <MobfoxReport> GetThisWeekReport(MobfoxApplication app = null) { return(_mobfoxService.GetThisWeekReport(app)); }
public Task <MobfoxReport> GetReport(DateTime?startDate, DateTime?endDate, MobfoxApplication app = null) { return(_mobfoxService.GetReportAsync(app, startDate, endDate)); }
public static async Task <MobfoxReport> GetLastMonthReport(this IMobfoxService mobfox, MobfoxApplication app = null) { var currentTime = DateTime.Now; var previusMonth = currentTime.PreviousMonth(); return(await mobfox.GetReportAsync(app, previusMonth.FirstDayOfMonth(), previusMonth.LastDayOfMonth())); }
public static async Task <MobfoxReport> GetOverallReport(this IMobfoxService mobfox, MobfoxApplication app = null) { return(await mobfox.GetReportAsync(app)); }
public static async Task <MobfoxReport> GetThisMonthReport(this IMobfoxService mobfox, MobfoxApplication app = null) { var currentTime = DateTime.Now; return(await mobfox.GetReportAsync(app, currentTime.FirstDayOfMonth(), currentTime)); }
public static async Task <MobfoxReport> GetLastWeekReport(this IMobfoxService mobfox, MobfoxApplication app = null) { var currentTime = DateTime.Now; return(await mobfox.GetReportAsync(app, currentTime.FirstDayOfWeek().WeekEarlier(), currentTime.LastDayOfWeek().WeekEarlier())); }
public static async Task <MobfoxReport> GetYesterdayReport(this IMobfoxService mobfox, MobfoxApplication app = null) { return(await mobfox.GetReportOfDate(DateTime.Now.PreviousDay(), app)); }
public static async Task <MobfoxReport> GetTodayReport(this IMobfoxService mobfox, MobfoxApplication app = null) { return(await mobfox.GetReportOfDate(DateTime.Now, app)); }
public static async Task <MobfoxReport> GetReportOfDate(this IMobfoxService mobfox, DateTime date, MobfoxApplication app) { return(await mobfox.GetReportAsync(app, startDate : date, endDate : date)); }