public void Deserialize(JToken token)
        {
            if (token == null)
            {
                return;
            }

            FilterOptions =
                new MessageFilterOptions {
                SendToJournal = token["SendToJournal"]?.ToObject <bool>() ?? false
            };
        }
Beispiel #2
0
        public void Deserialize(JToken token)
        {
            if (token == null)
            {
                return;
            }

            try
            {
                FilterOptions = new MessageFilterOptions
                {
                    SendToJournal = token["SendToJournal"]?.ToObject <bool>() ?? false,
                    MessageLimit  = token["MessageLimit"]?.ToObject <int>() ?? 5,
                    TimeLimit     = token["TimeLimit"]?.ToObject <int>() ?? 5,
                    BlockedTime   = token["BlockedTime"]?.ToObject <int>() ?? 5
                };
            }
            catch (Exception)
            {
                FilterOptions = new MessageFilterOptions();
            }
        }
 public void ResetOptions()
 {
     FilterOptions = new MessageFilterOptions();
 }