Beispiel #1
0
        async Task <DateTime> IGenericStorage.LastModifiedAsync()
        {
            try
            {
                GenericStorageState state = await this.GetStateAsync <GenericStorageState>();

                return(state.Changed);
            }
            catch (Exception E)
            {
                this.Log(E);
                throw (E);
            }
        }
Beispiel #2
0
        async Task <string> IGenericStorage.GetDataAsync()
        {
            try
            {
                GenericStorageState state = await this.GetStateAsync <GenericStorageState>();

                return(state.Data);
            }
            catch (Exception E)
            {
                this.Log(E);
                throw (E);
            }
        }
Beispiel #3
0
        async Task <bool> IGenericStorage.ContainsDataAsync()
        {
            try
            {
                GenericStorageState state = await this.GetStateAsync <GenericStorageState>();

                return(state.ContainsData);
            }
            catch (Exception E)
            {
                this.Log(E);
                return(false);
            }
        }
Beispiel #4
0
        async Task <bool> IGenericStorage.DeleteDataAsync()
        {
            try
            {
                GenericStorageState state = await this.GetStateAsync <GenericStorageState>();

                state.Data         = string.Empty;
                state.ContainsData = false;
                state.Changed      = DateTime.UtcNow;
                await this.SetStateAsync(state);

                return(true);
            }
            catch (Exception E)
            {
                this.Log(E);
                return(false);
            }
        }