Ejemplo n.º 1
0
        private string ClientSideWebPartEnumToName(DefaultClientSideWebParts webPart)
        {
            switch (webPart)
            {
            case DefaultClientSideWebParts.ContentRollup: return("daf0b71c-6de8-4ef7-b511-faae7c388708");

            case DefaultClientSideWebParts.BingMap: return("e377ea37-9047-43b9-8cdb-a761be2f8e09");

            case DefaultClientSideWebParts.ContentEmbed: return("490d7c76-1824-45b2-9de3-676421c997fa");

            case DefaultClientSideWebParts.DocumentEmbed: return("b7dd04e1-19ce-4b24-9132-b60a1c2b910d");

            case DefaultClientSideWebParts.Image: return("d1d91016-032f-456d-98a4-721247c305e8");

            case DefaultClientSideWebParts.ImageGallery: return("af8be689-990e-492a-81f7-ba3e4cd3ed9c");

            case DefaultClientSideWebParts.LinkPreview: return("6410b3b6-d440-4663-8744-378976dc041e");

            case DefaultClientSideWebParts.NewsFeed: return("0ef418ba-5d19-4ade-9db0-b339873291d0");

            case DefaultClientSideWebParts.NewsReel: return("a5df8fdf-b508-4b66-98a6-d83bc2597f63");

            case DefaultClientSideWebParts.PowerBIReportEmbed: return("58fcd18b-e1af-4b0a-b23b-422c2c52d5a2");

            case DefaultClientSideWebParts.QuickChart: return("91a50c94-865f-4f5c-8b4e-e49659e69772");

            case DefaultClientSideWebParts.SiteActivity: return("eb95c819-ab8f-4689-bd03-0c2d65d47b1f");

            case DefaultClientSideWebParts.VideoEmbed: return("275c0095-a77e-4f6d-a2a0-6a7626911518");

            case DefaultClientSideWebParts.YammerEmbed: return("31e9537e-f9dc-40a4-8834-0e3b7df418bc");

            default: return("");
            }
        }
Ejemplo n.º 2
0
        public ClientSideWebPart InstantiateDefaultWebPart(DefaultClientSideWebParts webPart)
        {
            var webPartName = this.ClientSideWebPartEnumToName(webPart);
            var webParts    = this.AvailableClientSideComponents(webPartName);

            if (webParts.Count() == 1)
            {
                return(new ClientSideWebPart(webParts.First()));
            }

            return(null);
        }
Ejemplo n.º 3
0
 public System.Collections.Generic.IEnumerable <ClientSideComponent> AvailableClientSideComponents(DefaultClientSideWebParts webPart)
 {
     return(this.AvailableClientSideComponents(this.ClientSideWebPartEnumToName(webPart)));
 }