public static ViewDef GetCamlViewDef(this XElement xmlNode) { XNamespace defaultNs = xmlNode.GetDefaultNamespace(); ViewDef view = new ViewDef(); XElement viewNode = xmlNode.Element(defaultNs + "View"); view.Name = viewNode.Attribute("Name").Value; view.DisplayName = viewNode.Attribute("DisplayName").Value; view.Query = viewNode.Element(defaultNs + "Query").GetXmlNode(); view.ViewFields = viewNode.Element(defaultNs + "ViewFields").Elements("FieldRef").Select(n => n.GetCamlFieldRef()).ToList(); view.ListDef = xmlNode.Element(defaultNs + "List").GetCamlListDef(); return(view); }
public static ViewDef GetCamlViewDef(this XElement xmlNode) { XNamespace defaultNs = xmlNode.GetDefaultNamespace(); ViewDef view = new ViewDef(); XElement viewNode = xmlNode.Element(defaultNs + "View"); view.Name = viewNode.Attribute("Name").Value; view.DisplayName = viewNode.Attribute("DisplayName").Value; view.Query = viewNode.Element(defaultNs + "Query").GetXmlNode(); view.ViewFields = viewNode.Element(defaultNs + "ViewFields").Elements("FieldRef").Select(n => n.GetCamlFieldRef()).ToList(); view.ListDef = xmlNode.Element(defaultNs + "List").GetCamlListDef(); return view; }