@@ -127,9 +127,9 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
127127 {
128128 text += " top:" + attributes [ "top" ] ;
129129 }
130- if ( attributes . ContainsKey ( "count" ) )
130+ if ( attributes . ContainsKey ( "distinct" ) && attributes [ "distinct" ] == "true" )
131131 {
132- text += " cnt:" + attributes [ "count" ] ;
132+ text += " dist" ;
133133 }
134134 if ( attributes . ContainsKey ( "returntotalrecordcount" ) && attributes [ "returntotalrecordcount" ] == "true" )
135135 {
@@ -139,9 +139,9 @@ public static void SetNodeText(TreeNode node, FetchXmlBuilder fxb, bool validate
139139 {
140140 text += " aggr" ;
141141 }
142- if ( attributes . ContainsKey ( "distinct" ) && attributes [ "distinct" ] == "true" )
142+ if ( attributes . ContainsKey ( "count" ) )
143143 {
144- text += " dist" ;
144+ text += " cnt:" + attributes [ "count" ] ;
145145 }
146146 if ( attributes . ContainsKey ( "page" ) )
147147 {
@@ -579,16 +579,16 @@ internal static void AddXmlNode(TreeNode currentNode, XmlNode parentXmlNode)
579579 else
580580 {
581581 newNode = parentXmlNode . OwnerDocument . CreateElement ( currentNode . Name ) ;
582- foreach ( string key in collec . Keys )
582+ foreach ( var key in collec . Keys )
583583 {
584584 if ( key == "#text" )
585585 {
586- XmlText newText = parentXmlNode . OwnerDocument . CreateTextNode ( collec [ key ] ) ;
586+ var newText = parentXmlNode . OwnerDocument . CreateTextNode ( collec [ key ] ) ;
587587 newNode . AppendChild ( newText ) ;
588588 }
589589 else
590590 {
591- XmlAttribute attr = parentXmlNode . OwnerDocument . CreateAttribute ( key ) ;
591+ var attr = parentXmlNode . OwnerDocument . CreateAttribute ( key ) ;
592592 attr . Value = collec [ key ] ;
593593 newNode . Attributes . Append ( attr ) ;
594594 }
@@ -601,7 +601,7 @@ internal static void AddXmlNode(TreeNode currentNode, XmlNode parentXmlNode)
601601 others . Add ( childNode ) ;
602602 }
603603
604- foreach ( TreeNode otherNode in others )
604+ foreach ( var otherNode in others )
605605 {
606606 AddXmlNode ( otherNode , newNode ) ;
607607 }
0 commit comments