public virtual object Create(Object parent, Object configContextObj, Xml.XmlNode section) { // if called through client config don't even load HttpRuntime if (!HandlerBase.IsServerConfiguration(configContextObj)) { return(null); } HttpConfigurationContext httpConfigContext = (HttpConfigurationContext)configContextObj; return(new CustomErrors(section, httpConfigContext.VirtualPath, (CustomErrors)parent)); }
public static String GetString(string key) { try { XmlParamter xpKey = new XmlParamter("Key", key); xpKey.Direction = System.IO.ParameterDirection.Equal; Xml.XmlNode xn = XMLHelper.GetDataOne(path, "KeyValue", xpKey); if (xn != null) { return(xn.Attributes["Value"].Value); } } catch { } return(""); }
public static Data.KeyValue GetByKey(string key) { Data.KeyValue kv = new Data.KeyValue(); try { XmlParamter xpKey = new XmlParamter("Key", key); xpKey.Direction = System.IO.ParameterDirection.Equal; Xml.XmlNode xn = XMLHelper.GetDataOne(path, "KeyValue", xpKey); if (xn == null) { return(null); } else { kv.Key = xn.Attributes["Key"].Value; kv.Value = xn.Attributes["Value"].Value; kv.Description = xn.Attributes["Description"].Value; kv.UpdateTime = Convert.ToDateTime(xn.Attributes["UpdateTime"].Value); } } catch { } return(kv); }