Example #1
0
        public BandEventViewModel(BandCloudClient cloud, BandEventBase cloudEvent)
        {
            _cloud = cloud;

            Event = cloudEvent;

            if (Event is UserDailyActivity)
            {
                // this event type is considered "Loaded" already since we get all of the information
                // from the initial API call
                Loaded = true;
            }
        }
Example #2
0
        public async Task <List <BandEventBase> > GetEvents(int?topCount = null, DateTime?startDate = null, DateTime?endDate = null)
        {
            var url      = GET_EVENTS_URL + GenerateEventsQuery(topCount, startDate, endDate);
            var response = await AuthenticatedRequest(url);

            var rv = new List <BandEventBase>();

            dynamic json = JObject.Parse(response);

            foreach (var rawBandEvent in json.value)
            {
                var bandEvent = BandEventBase.FromDynamic(rawBandEvent);
                rv.Add(bandEvent);
            }

            return(rv);
        }