コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
                }
            }));
        }
コード例 #3
0
 public ApplicationViewModel(ReportsController reportsController, IAppNavigationService navigationService)
 {
     _reportsController = reportsController;
     _navigationService = navigationService;
     Messenger.Register <MobfoxApplication>(this, (a) => CurrentApplication = a);
 }
コード例 #4
0
 public Task <MobfoxReport> GetDailyReport(DateTime date, MobfoxApplication app = null)
 {
     return(_mobfoxService.GetReportOfDate(date, app));
 }
コード例 #5
0
 public Task <MobfoxReport> GetYesterdayReport(MobfoxApplication app = null)
 {
     return(_mobfoxService.GetYesterdayReport(app));
 }
コード例 #6
0
 public Task <MobfoxReport> GetOverallReport(MobfoxApplication app = null)
 {
     return(_mobfoxService.GetReportAsync(app));
 }
コード例 #7
0
 public Task <MobfoxReport> GetLastMonthReport(MobfoxApplication app = null)
 {
     return(_mobfoxService.GetLastMonthReport(app));
 }
コード例 #8
0
 public Task <MobfoxReport> GetThisWeekReport(MobfoxApplication app = null)
 {
     return(_mobfoxService.GetThisWeekReport(app));
 }
コード例 #9
0
 public Task <MobfoxReport> GetReport(DateTime?startDate, DateTime?endDate, MobfoxApplication app = null)
 {
     return(_mobfoxService.GetReportAsync(app, startDate, endDate));
 }
コード例 #10
0
        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()));
        }
コード例 #11
0
 public static async Task <MobfoxReport> GetOverallReport(this IMobfoxService mobfox, MobfoxApplication app = null)
 {
     return(await mobfox.GetReportAsync(app));
 }
コード例 #12
0
        public static async Task <MobfoxReport> GetThisMonthReport(this IMobfoxService mobfox, MobfoxApplication app = null)
        {
            var currentTime = DateTime.Now;

            return(await mobfox.GetReportAsync(app, currentTime.FirstDayOfMonth(), currentTime));
        }
コード例 #13
0
        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()));
        }
コード例 #14
0
 public static async Task <MobfoxReport> GetYesterdayReport(this IMobfoxService mobfox, MobfoxApplication app = null)
 {
     return(await mobfox.GetReportOfDate(DateTime.Now.PreviousDay(), app));
 }
コード例 #15
0
 public static async Task <MobfoxReport> GetTodayReport(this IMobfoxService mobfox, MobfoxApplication app = null)
 {
     return(await mobfox.GetReportOfDate(DateTime.Now, app));
 }
コード例 #16
0
 public static async Task <MobfoxReport> GetReportOfDate(this IMobfoxService mobfox, DateTime date, MobfoxApplication app)
 {
     return(await mobfox.GetReportAsync(app, startDate : date, endDate : date));
 }