示例#1
0
        public virtual string BuildCaml(ListsReference listsReference)
        {
            StringBuilder listReferencesSB = new StringBuilder();

            foreach (Guid listID in listsReference.ListsIds)
            {
                listReferencesSB.AppendFormat("<List ID='{0}'/>", listID);
            }

            string listsAttrAppendFormat = "{0}='{1}' ";

            StringBuilder listsAttributesSB = new StringBuilder();

            if (listsReference.ListsServerTemplate.HasValue)
            {
                listsAttributesSB.AppendFormat(listsAttrAppendFormat, "ServerTemplate", (int)listsReference.ListsServerTemplate);
            }

            if (!String.IsNullOrEmpty(listsReference.ListsBaseType))
            {
                listsAttributesSB.AppendFormat(listsAttrAppendFormat, "BaseType", listsReference.ListsBaseType);
            }

            if (listsReference.MaxListsLimit != 0)
            {
                listsAttributesSB.AppendFormat(listsAttrAppendFormat, "MaxListsLimit", listsReference.MaxListsLimit);
            }

            if (listsReference.SearchInHiddenLists)
            {
                listsAttributesSB.AppendFormat(listsAttrAppendFormat, "Hidden", "TRUE");
            }

            return(String.Format("<Lists {0}>{1}</Lists>", listsAttributesSB.ToString(), listReferencesSB.ToString()));
        }
示例#2
0
 public SiteQuery(Query query, ListsReference listsReference, SiteQueryWebScope webScope, List <SiteQueryFieldReference> viewFields = null)
 {
     this.Query          = query;
     this.ListsReference = listsReference;
     this.WebScope       = webScope;
     this.ViewFields     = viewFields ?? new List <SiteQueryFieldReference>();
 }