public static int Compare(FormulaFunction f1, FormulaFunction f2) { if (f1 == null) { if (f2 == null) { return(0); } return(-1); } if (f2 == null) { return(1); } return(string.Compare(f1.Name, f2.Name)); }
static void ReadFormulaInformation() { Stream manifestResourceStream = typeof(FormulaFunctionList).GetTypeInfo().Assembly.GetManifestResourceStream("Dt.Cells.Res.FunctionInformation.zh_CN.xml"); StreamReader reader = new StreamReader(manifestResourceStream); string s = reader.ReadToEnd(); reader.Dispose(); manifestResourceStream.Dispose(); string attribute = string.Empty; string str3 = string.Empty; string str4 = string.Empty; if (s != null) { using (StringReader reader2 = new StringReader(s)) { using (XmlReader reader3 = XmlReader.Create((TextReader)reader2)) { while (reader3.Read()) { if (reader3.NodeType == ((XmlNodeType)((int)XmlNodeType.Element))) { break; } } while (reader3.Read()) { if (reader3.NodeType == ((XmlNodeType)((int)XmlNodeType.Element))) { attribute = reader3.GetAttribute(0); str3 = reader3.GetAttribute(1); str4 = reader3.GetAttribute(2); FormulaFunction function = _allList[attribute]; if (function != null) { function.Description = str4; function.FullName = attribute + "(" + str3 + ")"; function.Param = str3.Split(new char[] { ',' }); } } } } } } }