Exemple #1
0
        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);
        }
Exemple #2
0
        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;
        }