Пример #1
0
        private static bool TryFormatRss20Cloud(Rss20Cloud cloudToFormat, out XElement cloudElement)
        {
            cloudElement = default;

            if (cloudToFormat == null)
            {
                return(false);
            }

            cloudElement = new XElement("cloud");
            cloudElement.Add(new XAttribute("domain", cloudToFormat.Domain ?? ""));
            cloudElement.Add(new XAttribute("port", cloudToFormat.Port ?? ""));
            cloudElement.Add(new XAttribute("path", cloudToFormat.Path ?? ""));
            cloudElement.Add(new XAttribute("registerProcedure", cloudToFormat.RegisterProcedure ?? ""));
            cloudElement.Add(new XAttribute("protocol", cloudToFormat.Protocol ?? ""));

            return(true);
        }
Пример #2
0
        private static bool TryParseRss20Cloud(XElement cloudElement, out Rss20Cloud parsedCloud)
        {
            parsedCloud = default;

            if (cloudElement == null)
            {
                return(false);
            }

            parsedCloud                   = new Rss20Cloud();
            parsedCloud.Domain            = cloudElement.Attribute("domain")?.Value;
            parsedCloud.Port              = cloudElement.Attribute("port")?.Value;
            parsedCloud.Path              = cloudElement.Attribute("path")?.Value;
            parsedCloud.RegisterProcedure = cloudElement.Attribute("registerProcedure")?.Value;
            parsedCloud.Protocol          = cloudElement.Attribute("protocol")?.Value;

            return(true);
        }