Ejemplo n.º 1
0
        public static List GetList(this Web web, SPOListPipeBind identity)
        {
            List list = null;

            if (identity.List != null)
            {
                list = identity.List;
            }
            else if (identity.Id != Guid.Empty)
            {
                list = web.Lists.GetById(identity.Id);
            }
            else if (!string.IsNullOrEmpty(identity.Title))
            {
                list = web.GetListByTitle(identity.Title);
                if (list == null)
                {
                    list = web.GetListByUrl(identity.Title);
                }
            }

            web.Context.Load(list, l => l.Id, l => l.BaseTemplate, l => l.OnQuickLaunch, l => l.DefaultViewUrl, l => l.Title, l => l.Hidden);
            web.Context.ExecuteQuery();
            return(list);
        }
Ejemplo n.º 2
0
        public static List GetList(this Web web, SPOListPipeBind identity)
        {
            List list = null;
            if (identity.List != null)
            {
                list = identity.List;
            }
            else if (identity.Id != Guid.Empty)
            {
                list = web.Lists.GetById(identity.Id);
            }
            else if (!string.IsNullOrEmpty(identity.Title))
            {
                list = web.GetListByTitle(identity.Title);
                if (list == null)
                {
                    list = web.GetListByUrl(identity.Title);
                }
            }

            web.Context.Load(list, l => l.Id, l => l.BaseTemplate, l => l.OnQuickLaunch, l => l.DefaultViewUrl, l => l.Title, l => l.Hidden);
            web.Context.ExecuteQuery();
            return list;
        }
Ejemplo n.º 3
0
        public SPOList GetList(string urlOrTitle, bool detailed)
        {
            SPOListPipeBind listPB = new SPOListPipeBind(urlOrTitle);

            return(listPB.Read(this.Web, detailed));
        }
Ejemplo n.º 4
0
        public SPOList GetList(Guid id, bool detailed)
        {
            SPOListPipeBind listPB = new SPOListPipeBind(id);

            return(listPB.Read(this.Web, detailed));
        }