public static object GetNodeValue(string source, XmlHelper.XmlType xmlType__1, string nodeName) { XmlDocument xmlDocument = new XmlDocument(); bool flag = xmlType__1 == XmlHelper.XmlType.File; if (flag) { xmlDocument.Load(source); } else { xmlDocument.LoadXml(source); } XmlElement documentElement = xmlDocument.DocumentElement; XmlNode xmlNode = documentElement.SelectSingleNode("//" + nodeName); flag = (xmlNode != null); object result; if (flag) { result = xmlNode.InnerText; } else { result = null; } return result; }
public static DataSet GetDataSet(string source, XmlHelper.XmlType xmlType__1) { DataSet dataSet = new DataSet(); bool flag = xmlType__1 == XmlHelper.XmlType.File; if (flag) { dataSet.ReadXml(source); } else { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(source); XmlNodeReader reader = new XmlNodeReader(xmlDocument); dataSet.ReadXml(reader); } return dataSet; }
public static object GetTableCell(string source, XmlHelper.XmlType xmlType__1, string tableName, int rowIndex, int colIndex) { DataSet dataSet = new DataSet(); bool flag = xmlType__1 == XmlHelper.XmlType.File; if (flag) { dataSet.ReadXml(source); } else { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(source); XmlNodeReader reader = new XmlNodeReader(xmlDocument); dataSet.ReadXml(reader); } return dataSet.Tables[tableName].Rows[rowIndex][colIndex]; }