Exemple #1
0
        public static EntityValues GetEntityValues(XmlNode node)
        {
            var property = LoadProperties(node);

            var fields  = new List <EntityValues>();
            var manager = new XmlNamespaceManager(new NameTable());

            manager.AddNamespace("f", "http://schemas.microsoft.com/sharepoint/soap/");
            foreach (XmlNode fieldXml in node.SelectNodes(".//f:Field", manager))
            {
                var field = new EntityValues()
                {
                    Properties = LoadProperties(fieldXml)
                };

                fields.Add(field);
            }

            var values = new EntityValues();

            values.Properties = property;
            values.AddRange("Fields", fields);

            return(values);
        }
Exemple #2
0
        public EntityValues GetView([NotNull] string listName, [NotNull] string viewName)
        {
            Assert.ArgumentNotNull(listName, "listName");
            Assert.ArgumentNotNull(viewName, "viewName");

            XmlNode viewNode = this.ViewsWebService.GetView(listName, viewName);

            var view = new EntityValues
            {
                Properties = XmlUtils.LoadProperties(viewNode)
            };

            var viewFields = new List <EntityValues>();

            foreach (XmlNode viewFieldNode in XmlUtils.Select(viewNode, "/f:ViewFields/f:FieldRef"))
            {
                var viewField = new EntityValues
                {
                    Properties = XmlUtils.LoadProperties(viewFieldNode)
                };

                viewFields.Add(viewField);
            }

            view.AddRange("ViewFields", viewFields);

            return(view);
        }