using System; using System.Configuration; using System.Collections.Generic; namespace Yavsc { public static class ThanksHelper { public static string[] Links () { List result = new List() ; ThanksConfigurationSection s = (ThanksConfigurationSection) ConfigurationManager.GetSection ("system.web/thanks"); if (s == null) return result.ToArray(); if (s.To == null) return result.ToArray(); foreach (ThanksConfigurationElement e in s.To) { string link = ""; if (!string.IsNullOrEmpty(e.Url)) link = string.Format("",e.Url); link += "
"; string dsp = (string.IsNullOrEmpty(e.Display))?e.Name:e.Display; if (!string.IsNullOrEmpty(e.Image)) { string ttl = (string.IsNullOrEmpty(s.TitleFormat))?"Go and see the website ({0})":s.TitleFormat; ttl = string.Format(ttl,dsp); link += string.Format( "\"{0}\"", dsp,e.Image,ttl); } else link += dsp; link += "
"; if (e.Url!=null) link += "
"; result.Add (link); } return result.ToArray(); } } }