Ejemplo n.º 1
0
 public void writeState(BuildContext context, object data, object identifier = null)
 {
     this._storage = this._storage ?? new Dictionary <object, object>();
     if (identifier != null)
     {
         this._storage[identifier] = data;
     }
     else
     {
         _StorageEntryIdentifier contextIdentifier = this._computeIdentifier(context);
         if (contextIdentifier.isNotEmpty)
         {
             this._storage[contextIdentifier] = data;
         }
     }
 }
Ejemplo n.º 2
0
        public object readState(BuildContext context, object identifier = null)
        {
            if (this._storage == null)
            {
                return(null);
            }

            if (identifier != null)
            {
                return(this._storage[identifier]);
            }

            _StorageEntryIdentifier contextIdentifier = this._computeIdentifier(context);

            return(contextIdentifier.isNotEmpty ? this._storage[contextIdentifier] : null);
        }
Ejemplo n.º 3
0
        public object readState(BuildContext context, object identifier = null)
        {
            if (_storage == null)
            {
                return(null);
            }

            if (identifier != null)
            {
                return(_storage.getOrDefault(identifier));
            }

            _StorageEntryIdentifier contextIdentifier = _computeIdentifier(context);

            return(contextIdentifier.isNotEmpty ? _storage.getOrDefault(contextIdentifier) : null);
        }