Esempio n. 1
0
 /// <summary>
 /// Configures the API from a child node.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <param name="apinode">The apinode.</param>
 private static void ConfigureApi(XmlNode node, ApiNode apinode)
 {
     NodeAttributes attributes = new NodeAttributes(node);
     Type dtoType = GetDtoType(attributes.AsString("dtoType"), attributes.AsString("dtoName"), attributes.AsString("path"), attributes.AsString("entityName"), attributes.AsString("entityType"));
     if (dtoType != null)
     {
         string parameterName = attributes.AsString("parameterName");
         if (string.IsNullOrEmpty(parameterName))
         {
             parameterName = GetParameterName(attributes.AsString("path"), dtoType);
         }
         ApiNode childnode = apinode.AddNode(attributes.AsString("path"), dtoType, parameterName, attributes.AsString("byparent"));
         foreach (XmlNode subnode in node.SelectNodes("api"))
         {
             ConfigureApi(subnode, childnode);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Configures the API from a child node.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <param name="apinode">The apinode.</param>
        private static void ConfigureApi(XmlNode node, ApiNode apinode)
        {
            NodeAttributes attributes = new NodeAttributes(node);
            Type           dtoType    = GetDtoType(attributes.AsString("dtoType"), attributes.AsString("dtoName"), attributes.AsString("path"), attributes.AsString("entityName"), attributes.AsString("entityType"));

            if (dtoType != null)
            {
                string parameterName = attributes.AsString("parameterName");
                if (string.IsNullOrEmpty(parameterName))
                {
                    parameterName = GetParameterName(attributes.AsString("path"), dtoType);
                }
                ApiNode childnode = apinode.AddNode(attributes.AsString("path"), dtoType, parameterName, attributes.AsString("byparent"));
                foreach (XmlNode subnode in node.SelectNodes("api"))
                {
                    ConfigureApi(subnode, childnode);
                }
            }
        }