Exemple #1
0
        public override XElement ToXElement(string @namespace)
        {
            var elements = new List <XElement>(
                new[] {
                new XElement(XName.Get("Name", @namespace), Name),
                new XElement(XName.Get("Title", @namespace), Title),
            });

            if (!string.IsNullOrEmpty(Abstract))
            {
                elements.Add(new XElement(XName.Get("Abstract", @namespace), Abstract));
            }

            if (LegendURL.Count > 0)
            {
                foreach (var legendURL in LegendURL)
                {
                    elements.Add(legendURL.ToXElement(@namespace));
                }
            }

            if (_styleSheetURLField != null)
            {
                elements.Add(_styleSheetURLField.ToXElement(@namespace));
            }
            if (_styleURLField != null)
            {
                elements.Add(_styleURLField.ToXElement(@namespace));
            }
            return(new XElement(XName.Get("Style", @namespace), elements.ToArray()));
        }