Example #1
0
 protected ControllerNodeSet CreateExpression(string rootElement, params System.String[] attributes)
 {
     foreach (XPathNavigator node in _nodes)
     {
         ControllerNodeSet nodeSet  = new ControllerNodeSet(this, node);
         ControllerNodeSet rootNode = nodeSet.Select(rootElement);
         if (rootNode.Nodes.Count == 0)
         {
             Select(String.Format("<{0}/>", rootElement)).AppendTo(nodeSet);
             rootNode = nodeSet.Select(rootElement);
         }
         ControllerNodeSet expressionNode = nodeSet.Select("expression[1]");
         if (expressionNode.Nodes.Count == 0)
         {
             Select("<expression/>").AppendTo(rootNode);
             expressionNode = rootNode.Select("expression");
         }
         int i = 0;
         while (i < attributes.Length)
         {
             expressionNode.Attr(attributes[i], attributes[(i + 1)]);
             i = (i + 2);
         }
     }
     return(this);
 }
Example #2
0
        public ControllerNodeSet CreateAction(string commandName, string commandArgument, string id)
        {
            ControllerNodeSet actionNode = Select("<action/>").AppendTo(this).Select("action[last()]");

            if (!(String.IsNullOrEmpty(id)))
            {
                actionNode.Attr("id", id);
            }
            if (!(String.IsNullOrEmpty(commandName)))
            {
                actionNode.Attr("commandName", commandName);
            }
            if (!(String.IsNullOrEmpty(commandArgument)))
            {
                actionNode.Attr("commandArgument", commandArgument);
            }
            return(actionNode);
        }
Example #3
0
        public ControllerNodeSet CreateActionGroup(string id)
        {
            ControllerNodeSet actionGroupNode = new ControllerNodeSet(_navigator, _resolver).Select("<actionGroup/>").AppendTo("/dataController/actions").Select("/dataController/actions/actionGroup[last()]");

            if (!(String.IsNullOrEmpty(id)))
            {
                actionGroupNode.Attr(id);
            }
            return(actionGroupNode);
        }
Example #4
0
 private ControllerNodeSet SetProperty(string name, object value, params System.String[] requiresElement)
 {
     foreach (XPathNavigator node in _nodes)
     {
         ControllerNodeSet nodeSet = new ControllerNodeSet(this, node);
         if (Array.IndexOf(requiresElement, node.Name) >= 0)
         {
             nodeSet.Elem(name, value);
         }
         else
         {
             nodeSet.Attr(name, value);
         }
     }
     return(this);
 }
Example #5
0
 public ControllerNodeSet CreateDataField(string fieldName, string aliasFieldName)
 {
     foreach (XPathNavigator node in _nodes)
     {
         ControllerNodeSet parentNode     = new ControllerNodeSet(this, node);
         ControllerNodeSet dataFieldsNode = parentNode;
         if (node.Name != "dataFields")
         {
             dataFieldsNode = parentNode.Select("dataFields|ancestor::dataFields[1]");
             if (dataFieldsNode.Nodes.Count == 0)
             {
                 Select("<dataFields/>").AppendTo(parentNode);
                 dataFieldsNode = parentNode.Select("dataFields");
             }
         }
         ControllerNodeSet dataFieldNode = Select("<dataField/>").AppendTo(dataFieldsNode).Select("dataField[last()]").Attr("fieldName", fieldName);
         if (!(String.IsNullOrEmpty(aliasFieldName)))
         {
             dataFieldNode.Attr("aliasFieldName", aliasFieldName);
         }
         return(dataFieldNode);
     }
     return(this);
 }