Beispiel #1
0
        public async Task Persist(NagResponseInfo state, string nagId, StorageStrategies location)
        {
            if (state == null) throw new ArgumentNullException("state");
            if (string.IsNullOrEmpty(nagId)) throw new ArgumentException("nagId cannot be null or empty", "nagId");

            await _fileService.WriteFileAsync<NagResponseInfo>(GetFileName(nagId), state, location);
        }
Beispiel #2
0
        public async Task Persist(NagResponseInfo state, string nagId, StorageStrategies location)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state");
            }
            if (string.IsNullOrEmpty(nagId))
            {
                throw new ArgumentException("nagId cannot be null or empty", "nagId");
            }

            await _fileService.WriteFileAsync <NagResponseInfo>(state, GetFileName(nagId));
        }
Beispiel #3
0
        private async Task ProcessNag(Nag nag, NagResponseInfo responseInfo)
        {
            var response = await ShowNag(nag);

            if (response == NagResponse.Accept)
            {
                nag.NagAction();
            }
            else if (response == NagResponse.Defer)
            {
                responseInfo.LaunchCount           = 0;
                responseInfo.RegistrationTimeStamp = DateTimeOffset.UtcNow;
            }

            responseInfo.LastResponse = response;
            responseInfo.LastNag      = DateTimeOffset.UtcNow;

            await Persist(responseInfo, nag.Id, nag.Location.ToFileServiceStrategy());
        }
Beispiel #4
0
        private async Task ProcessNag(Nag nag, NagResponseInfo responseInfo)
        {
            var response = await ShowNag(nag);

            if (response == NagResponse.Accept)
            {
                nag.NagAction();
            }
            else if (response == NagResponse.Defer)
            {
                responseInfo.LaunchCount = 0;
                responseInfo.RegistrationTimeStamp = DateTimeOffset.UtcNow;
            }

            responseInfo.LastResponse = response;
            responseInfo.LastNag = DateTimeOffset.UtcNow;

            await Persist(responseInfo, nag.Id, nag.Location);
        }