コード例 #1
0
        private static DataNode IdentifyUniqueConstruct(string name, List <string> paramList, string nodeTypeToAdd,
                                                        DataNode parentNode)
        {
            var baseString = GetBaseString(paramList, name);

            foreach (var child in parentNode.Children)
            {
                var childParam     = new List <string>();
                var childParamNode = child.Set(Consts.Parameters);
                foreach (var node in childParamNode.Children)
                {
                    var paramType = node[Consts.ParamType];
                    childParam.Add(paramType);
                }
                var childMethodString = child.Name + OccApiGenerator.NativeMethodSuffix(childParam);
                if (childMethodString == baseString)
                {
                    return(child);
                }
            }
            var result = parentNode.Add(nodeTypeToAdd);

            return(result);
        }