public static AddValue ( StringBuilder &input, string separator, string value ) : void | ||
input | StringBuilder | |
separator | string | |
value | string | |
Résultat | void |
static public string ConcatCellValues(ResultCell[] cells, string separator) { string result = ""; foreach (var cell in cells) { Helper.AddValue(ref result, separator, cell.DisplayValue); } return(result); }
public static void InitCategoryTreeNode(TreeNodeCollection categoryNodes, List <MetaTable> tables) { categoryNodes.Clear(); if (tables.Count > 0) { List <MetaColumn> columns = new List <MetaColumn>(); foreach (MetaTable table in tables) { foreach (MetaColumn column in table.Columns) { columns.Add(column); } } foreach (var column in columns.OrderBy(i => i.DisplayOrder)) { string[] categories = column.Category.Split('/'); TreeNodeCollection nodes = categoryNodes; TreeNode categoryNode = null; string path = ""; foreach (var category in categories) { Helper.AddValue(ref path, "/", category); categoryNode = getCategoryTreeNode(nodes, category); if (categoryNode == null) { categoryNode = new TreeNode(category) { Tag = new CategoryFolder() { Name = category, Path = path }, ImageIndex = 2, SelectedImageIndex = 2 }; nodes.Add(categoryNode); } nodes = categoryNode.Nodes; } var tn = new TreeNode(column.DisplayName) { Tag = column, ImageIndex = 7, SelectedImageIndex = 7 }; categoryNode.Nodes.Add(tn); } } }