Пример #1
0
        private ListName GetListName(XmlNode mapping)
        {
            XmlNode listCollection = mapping.SelectSingleNode(".//*[local-name() = 'ListCollection']");
            XmlNode useName        = listCollection.SelectSingleNode("@*[local-name() = 'useName']");
            XmlNode listName       = listCollection.SelectSingleNode("@*[local-name() = 'ListName']");

            ListName ln = new ListName();

            ln.ID      = listCollection.InnerText;
            ln.UseName = useName != null && useName.Value == "true";
            ln.Name    = listName.Value;

            return(ln);
        }
Пример #2
0
        private ListItemIdList PerformMappingAndSubmit(XmlDocument doc, string siteUrl, XmlNode mapping)
        {
            ListItemIdList itemIdList = new ListItemIdList();

            Dictionary <int, XmlNode> methodMap;
            XmlNamespaceManager       nsm = GenerateBatch.BuildNamespaceManager(doc);
            ListName listName             = GetListName(mapping);


            XmlElement batch = GenerateBatch.GenerateBatchElement(doc, nsm, mapping, out methodMap);

            if (null == batch)
            {
                return(itemIdList);
            }

            itemIdList = UploadData(siteUrl, listName.ListNameToUse, batch);

            return(itemIdList);
        }