Ejemplo n.º 1
0
        //private static IEnumerable<List> Get_Lists(ClientContext ctx, Web web)
        //{
        //    var alllists = web.Lists;

        //    IEnumerable<List> lists = ctx.LoadQuery(alllists.Where
        //        (list => list.BaseType == BaseType.GenericList)
        //        );

        //    ctx.ExecuteQuery();
        //    return lists;
        //}

        private XlHlp.XlLocation AddSection_Lists(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Lists", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Lists", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            IEnumerable <List> lists = VNCSP.Helper.GetLists(ctx, web);

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_Lists(insertAt, lists, false, "OneLevel");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblLists_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Ejemplo n.º 2
0
        private XlHlp.XlLocation AddSection_SiteColumns(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "SiteColumns", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "SiteColumns", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            var siteColumns = VNCSP.Helper.GetSiteColumns(ctx, web);

            //ctx.Load(web.Fields);
            //ctx.ExecuteQuery();

            //var siteColumns = web.Fields;

            //ctx.ExecuteQuery();


            insertAt.MarkStart(XlHlp.MarkType.GroupTable);


            insertAt = DisplayListOf_SiteColumns(insertAt, siteColumns, false, "OneLevel");


            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblSiteColumns_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Ejemplo n.º 3
0
        private XlHlp.XlLocation AddSection_WebInfo(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            //ctx.Load(web, info => info.HasUniqueRoleAssignments);
            //ctx.Load(web1,
            //    info => info.Url,
            //    info => info.MasterUrl,
            //    info => info.Description,
            //    info => info.HasUniqueRoleAssignments,
            //    info => info.Created);
            //ctx.ExecuteQuery();

            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Url:", ctx.Url);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Title:", web.Title);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Created:", web.Created.ToString());
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Description:", web.Description);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Id:", web.Id.ToString());
            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "HasUniqueRoleAssignments:", web.HasUniqueRoleAssignments.ToString());
            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "MasterUrl:", web.MasterUrl);

            return(insertAt);
        }
Ejemplo n.º 4
0
        private XlHlp.XlLocation AddSection_ContentTypes(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "ContentTypes", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "ContentTypes", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            ctx.Load(web.ContentTypes);
            ctx.ExecuteQuery();

            //IEnumerable<List> cTypes = ctx.LoadQuery(allContentTypes.Where
            //    (list => list.BaseType == BaseType.DocumentLibrary)
            //    );

            ctx.ExecuteQuery();

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_ContentTypes(insertAt, web.ContentTypes, false, "Full");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblContentTypes_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }