using System; using System.Web; using System.Text; namespace CustomerManagement.css { /// /// Summary description for svg /// public class svg : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "image/svg+xml"; string str = Input.GetQueryString("stops"); string[] values = str.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var sb = new StringBuilder(); sb.Append(""); sb.AppendLine(); sb.Append(""); sb.AppendLine(); sb.Append(""); sb.AppendLine(); foreach (var val in values) { string[] items = val.Split(new Char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); sb.Append(""); sb.AppendLine(); } sb.Append(""); sb.AppendLine(); sb.Append(""); sb.AppendLine(); sb.Append(""); sb.AppendLine(); sb.Append(""); sb.AppendLine(); context.Response.Write(sb.ToString()); } public bool IsReusable { get { return false; } } } public static class Input { public static T GetQueryString(string key) where T : IConvertible { T result = default(T); if (String.IsNullOrEmpty(HttpContext.Current.Request.QueryString[key]) == false) { string value = HttpContext.Current.Request.QueryString[key]; try { result = (T)Convert.ChangeType(value, typeof(T)); } catch { //Could not convert. Pass back default value... result = default(T); } } return result; } } }