Exemplo n.º 1
0
 public void SetStringValue(string key, string content, TimeSpan life = default(TimeSpan), ItemExpirationMode expirationMode = ItemExpirationMode.Eternal)
 {
     SetValue(key, ValueType.String, content, life, expirationMode);
 }
Exemplo n.º 2
0
        private void SetValue(string key, ValueType type, object content, TimeSpan life = default(TimeSpan), ItemExpirationMode expirationMode = ItemExpirationMode.Eternal)
        {
            var item = new Value(type, expirationMode)
            {
                Content = content, Time = DateTime.UtcNow, Life = life
            };

            lock (Items)
            {
                Items[key] = item;
            }
        }
Exemplo n.º 3
0
 public void SetMapValue(string key, Dictionary <string, string> content, TimeSpan life = default(TimeSpan), ItemExpirationMode expirationMode = ItemExpirationMode.Eternal)
 {
     SetValue(key, ValueType.Map, content, life, expirationMode);
 }
Exemplo n.º 4
0
 public Value(ValueType type, ItemExpirationMode expirationMode)
 {
     Type           = type;
     ExpirationMode = expirationMode;
 }
Exemplo n.º 5
0
 public void SetSetValue(string key, string[] content, TimeSpan life = default(TimeSpan), ItemExpirationMode expirationMode = ItemExpirationMode.Eternal)
 {
     content = content.Distinct().ToArray();
     SetValue(key, ValueType.Set, content, life, expirationMode);
 }