// script(id/name/type) private static TagConfigItem getTagItem(string key) { TagConfigItem x = new TagConfigItem(); x.PropertyList = new List <String>(); key = key.Trim().TrimEnd(')'); String[] arr = key.Split('('); if (arr.Length == 2) { x.TagName = arr[0].Trim(); String[] arrProperty = arr[1].Split('/'); foreach (String p in arrProperty) { if (strUtil.IsNullOrEmpty(p)) { continue; } x.PropertyList.Add(p.Trim()); } } else { x.TagName = key; } return(x); }
private static Dictionary <String, String> getConfigWhiteList() { Dictionary <String, String> defaultValues = getDefaultAllowedTags(); if (MvcConfig.Instance.TagWhitelist.Count == 0) { return(defaultValues); } Dictionary <String, String> dic = new Dictionary <String, String>(); foreach (String rTag in MvcConfig.Instance.TagWhitelist) { if (strUtil.IsNullOrEmpty(rTag)) { continue; } String key = rTag.ToLower(); TagConfigItem item = getTagItem(key); if (item.PropertyList.Count > 0) { dic.Add(item.TagName, item.GetPropertyString()); } else if (defaultValues.ContainsKey(key)) { dic.Add(item.TagName, defaultValues[key]); } else { dic.Add(item.TagName, ""); } } return(dic); }
// script(id/name/type) private static TagConfigItem getTagItem( string key ) { TagConfigItem x = new TagConfigItem(); x.PropertyList = new List<String>(); key = key.Trim().TrimEnd( ')' ); String[] arr = key.Split( '(' ); if (arr.Length == 2 ) { x.TagName = arr[0].Trim(); String[] arrProperty = arr[1].Split( '/' ); foreach (String p in arrProperty) { if (strUtil.IsNullOrEmpty( p )) continue; x.PropertyList.Add( p.Trim() ); } } else { x.TagName = key; } return x; }