コード例 #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;
         }
     }
 }
コード例 #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);
        }
コード例 #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);
        }