Exemple #1
0
 public ValueType this[KeyType Key] {
     get
     {
         var Str_Key = WebStorage.GetItem(GetKey(Key));
         return(MyUTF.GetBytes(Str_Key).Deserialize <ValueType>());
     }
     set
     {
         WebStorage.SetItem(GetKey(Key), MyUTF.GetString(value.Serialize()));
     }
 }
Exemple #2
0
 public ValueType this[KeyType Key] {
     get
     {
         var Str_Key = SharedActions.GetItem(StorageKey + MyUTF.GetString(Key.Serialize()));
         return(MyUTF.GetBytes(Str_Key).Deserialize <ValueType>());
     }
     set
     {
         SharedActions.SetItem(
             StorageKey + MyUTF.GetString(Key.Serialize()),
             MyUTF.GetString(value.Serialize()));
     }
 }
 public Table(string TableName,
              Func <ValueType, KeyType> GetKey, bool IsUpdatAble) :
     base(
         (b) =>
 {
     var KeyName = "K" + MyUTF.GetString(TableName.Serialize());
     SharedActions.SetItem(KeyName, MyUTF.GetString(b));
 },
         () =>
 {
     var KeyName = "K" + MyUTF.GetString(TableName.Serialize());
     if (SharedActions.ContainKey(KeyName))
     {
         return(MyUTF.GetBytes(SharedActions.GetItem(KeyName)));
     }
     return(null);
 },
         new StorageDictionary <KeyType, ValueType>("V" + TableName), GetKey, IsUpdatAble)
 {
     this.TableName = TableName;
 }
 public void SetItem(KeyType Key, ValueType Value)
 {
     SharedActions.SetItem(
         StorageKey + MyUTF.GetString(Key.Serialize()),
         MyUTF.GetString(Value.Serialize()));
 }
        public ValueType GetItem(KeyType Key)
        {
            var Str_Key = SharedActions.GetItem(StorageKey + MyUTF.GetString(Key.Serialize()));

            return(MyUTF.GetBytes(Str_Key).Deserialize <ValueType>());
        }
 public void DeleteItem(KeyType Key)
 {
     SharedActions.DeleteItem(StorageKey + MyUTF.GetString(Key.Serialize()));
 }
 public bool ContainKey(KeyType Key)
 {
     return(SharedActions.ContainKey(StorageKey + MyUTF.GetString(Key.Serialize())));
 }
Exemple #8
0
 private string GetKey(KeyType Key) => StorageKey + MyUTF.GetString(Key.Serialize());