private string CreateOneGroup(UINodeGroup uINodeGroup) { string temp = ""; var nodes = uINodeGroup.nodes; string typeName = uINodeGroup.typeName; for (int i = 0; i < nodes.Count; i++) { temp += k_Tab + $"public {typeName} {nodes[i].name.Replace(" ", "")};\r\n"; } return(temp); }
private string GetRepetitiveName(UINodeGroup uINodeGroup) { var nodes = uINodeGroup.nodes; //先去重复 //然后查找赌赢Key的个数 ,大于1就是重复 List <string> strList = new List <string>(); for (int i = 0; i < nodes.Count; i++) { strList.Add(nodes[i].name); } var group = strList.GroupBy(str => str).Where(g => g.Count() > 1).Select(y => new { Element = y.Key, Counter = y.Count() }).ToList(); string content = ""; for (int i = 0; i < group.Count; i++) { content += $"重复元素:{group[i].Element} 重复的个数为:{group[i].Counter}"; } return(content); }