Пример #1
0
        public JabberClientConfiguration GetClientConfiguration(int tenantId)
        {
            JabberClientConfiguration result = null;

            if (IsServiceProbablyNotAvailable())
            {
                return(result);
            }

            using (var service = GetService())
            {
                try
                {
                    var serverCfg = service.GetClientConfiguration(tenantId);
                    result = new JabberClientConfiguration();
                    if (serverCfg.ContainsKey("Domain"))
                    {
                        result.Domain = serverCfg["Domain"];
                    }
                    if (serverCfg.ContainsKey("BoshUri"))
                    {
                        result.BoshUri = new Uri(serverCfg["BoshUri"]);
                    }
                    if (serverCfg.ContainsKey("Port"))
                    {
                        result.Port = int.Parse(serverCfg["Port"]);
                    }
                }
                catch (Exception error)
                {
                    ProcessError(error);
                }
            }
            return(result);
        }
Пример #2
0
        public JabberClientConfiguration GetClientConfiguration(int tenantId)
        {
            JabberClientConfiguration result = null;
            if (IsServiceProbablyNotAvailable()) return result;

            using (var service = GetService())
            {
                try
                {
                    var serverCfg = service.GetClientConfiguration(tenantId);
                    result = new JabberClientConfiguration();
                    if (serverCfg.ContainsKey("Domain")) result.Domain = serverCfg["Domain"];
                    if (serverCfg.ContainsKey("BoshUri")) result.BoshUri = new Uri(serverCfg["BoshUri"]);
                    if (serverCfg.ContainsKey("Port")) result.Port = int.Parse(serverCfg["Port"]);
                }
                catch (Exception error)
                {
                    ProcessError(error);
                }
            }
            return result;
        }