Ejemplo n.º 1
0
        public void Config(IConfigProvider provider)
        {
            var config = provider.GetPluginConfigPart("redis");
            foreach (var child in config.Children())
            {
                string hostName = ((JProperty) child).Name;
                string host = child.First["Host"].Value<string>();
                int port = child.First["Port"].Value<int>();
                int timeout = child.First["Timeout"].Value<int>();

                connections.Add(hostName, ConnectionUtils.Connect(string.Format("{0}:{1}", host, port), false));
            }
        }
 public void Config(IConfigProvider provider)
 {
     var config = provider.GetPluginConfigPart("network");
     var server = config["server"].Value<string>();
     int idx = server.IndexOf(':');
     if (idx > 0)
     {
         host = server.Substring(0, idx);
         port = int.Parse(server.Substring(idx + 1));
     }
     else
     {
         host = server;
         port = 25826;
     }
 }
 public void Config(IConfigProvider provider)
 {
     var config = provider.GetPluginConfigPart("interface");
     excluded = config["exclude"].Select(x => (string)x).ToArray();
     included = config["include"].Select(x => (string)x).ToArray();
 }