void InitFunctions(TreeNode ndRoot) { ArrayList ar = new ArrayList(); ar.AddRange(StaticLists.FunctionList); // Build list of methods in the VBFunctions class fyiReporting.RDL.FontStyleEnum fsi = FontStyleEnum.Italic; // just want a class from RdlEngine.dll assembly Assembly a = Assembly.GetAssembly(fsi.GetType()); if (a == null) { return; } Type ft = a.GetType("fyiReporting.RDL.VBFunctions"); BuildMethods(ar, ft, ""); // build list of financial methods in Financial class ft = a.GetType("fyiReporting.RDL.Financial"); BuildMethods(ar, ft, "Financial."); a = Assembly.GetAssembly("".GetType()); ft = a.GetType("System.Math"); BuildMethods(ar, ft, "Math."); ft = a.GetType("System.Convert"); BuildMethods(ar, ft, "Convert."); ft = a.GetType("System.String"); BuildMethods(ar, ft, "String."); ar.Sort(); string previous = ""; foreach (string item in ar) { if (item != previous) // don't add duplicates { // Add the node to the tree TreeNode aRoot = new TreeNode(item); ndRoot.Nodes.Add(aRoot); } previous = item; } }
//Done: Look at grouping items, such as Math, Financial, etc // Josh: 6:21:10 added grouping for common items. void InitFunctions() { List <string> ar = new List <string>(); ar.AddRange(StaticLists.FunctionList); // Build list of methods in the VBFunctions class fyiReporting.RDL.FontStyleEnum fsi = FontStyleEnum.Italic; // just want a class from RdlEngine.dll assembly Assembly a = Assembly.GetAssembly(fsi.GetType()); if (a == null) { return; } Type ft = a.GetType("fyiReporting.RDL.VBFunctions"); BuildMethods(ar, ft, ""); // build list of financial methods in Financial class ft = a.GetType("fyiReporting.RDL.Financial"); BuildMethods(ar, ft, "Financial."); a = Assembly.GetAssembly("".GetType()); ft = a.GetType("System.Math"); BuildMethods(ar, ft, "Math."); ft = a.GetType("System.Convert"); BuildMethods(ar, ft, "Convert."); ft = a.GetType("System.String"); BuildMethods(ar, ft, "String."); ar.Sort(); TreeNode ndRoot = new TreeNode("Functions"); tvOp.Nodes.Add(ndRoot); foreach (TreeNode node in GroupMethods(RemoveDuplicates(ar))) { ndRoot.Nodes.Add(node); } }