Example #1
0
 public void SetOption(string name, dynamic value)
 {
     Serializer.Serializer serializer = new Serializer.Serializer();
     Table <Option>().Set(name, new Option {
         Value = serializer.Serialize(value)
     });
 }
Example #2
0
        public dynamic GetOption(string name)
        {
            Serializer.Serializer serializer = new Serializer.Serializer();
            var option = Table <Option>().Get(name);

            if (option == null || option.Value == null)
            {
                return(null);
            }
            return(serializer.Deserialize(option.Value));
        }
Example #3
0
        public T GetOption <T>(string name)
        {
            Serializer.Serializer serializer = new Serializer.Serializer();
            var option = Table <Option>().Get(name);

            if (option == null || option.Value == null)
            {
                return(default(T));
            }
            return((T)serializer.Deserialize(option.Value));
        }