예제 #1
0
        protected string SerializeValue(EPiImagePropertyData value)
        {
            var data = value;

            if (data != null && !String.IsNullOrEmpty(data.ImageUrl))
            {
                var xml = new XmlDocument();
                var img = xml.CreateElement("img");
                img.SetAttribute("src", data.ImageUrl);
                img.SetAttribute("alt", data.Description);
                img.SetAttribute("title", data.Title);
                if (!string.IsNullOrEmpty(data.LinkUrl))
                {
                    var a = xml.CreateElement("a");
                    a.SetAttribute("href", data.LinkUrl);
                    xml.AppendChild(a);
                    a.AppendChild(img);
                }
                else
                {
                    xml.AppendChild(img);
                }
                return(xml.OuterXml);
            }
            return(String.Empty);
        }
예제 #2
0
 protected string SerializeValue(EPiImagePropertyData value)
 {
     var data = value;
     if (data != null && !String.IsNullOrEmpty(data.ImageUrl))
     {
        var xml = new XmlDocument();
         var img = xml.CreateElement("img");
         img.SetAttribute("src", data.ImageUrl);
         img.SetAttribute("alt", data.Description);
         img.SetAttribute("title", data.Title);
         if (!string.IsNullOrEmpty(data.LinkUrl))
         {
             var a = xml.CreateElement("a");
             a.SetAttribute("href", data.LinkUrl);
             xml.AppendChild(a);
             a.AppendChild(img);
         }
         else
         {
             xml.AppendChild(img);
         }
         return xml.OuterXml;
     }
     return String.Empty;
 }