Beispiel #1
0
    public static XMDomainCollection GetCustomDomainins()
    {
        XMDomainCollection xmDomains = new XMDomainCollection();
        XMLayer            xmLayer   = new XMLayer();

        try
        {
            xmLayer = XMServer.CreateXMLayer();
            xmLayer.Login();

            string domains = xmLayer.ListCustomDomains();
            using (StringReader sr = new StringReader(domains))
            {
                string line = string.Empty;
                while ((line = sr.ReadLine()) != null)
                {
                    line = line.Trim();
                    if (line == ".")
                    {
                        break;
                    }
                    string domainName = line.Trim(new char[] { '"' });
                    xmDomains.Add(new XMDomain(domainName, domainName, AdminPanelConstants.UserType.xm));
                }
            }
            xmLayer.Logout();
        }
        catch (Exception error)
        {
            Log.WriteException(error);
            throw;
        }
        return(xmDomains);
    }