Esempio n. 1
0
 public virtual void FinalizeConfiguration(ClientContext ctx)
 {
     if (!string.IsNullOrEmpty(ContentType))
     {
         ListInfo = new ListInfo(List, ContentType);
     }
     if (NoCrawl || Hidden)
     {
         List.NoCrawl = NoCrawl;
         List.Hidden  = Hidden;
         List.Update();
     }
     if (CustomActionCreators != null && CustomActionCreators.Count > 0)
     {
         var customActionManager = new CustomActionManager {
             CustomActions = CustomActionCreators
         };
         customActionManager.CreateAll(ctx, List);
     }
 }
        private void CreateGlobalResourcesCustomAction(string manifestName, string globalResources)
        {
            var customActionName    = manifestName + " Generated Mappings";
            var customActionManager = new CustomActionManager(_ctx);
            var customActions       = new Dictionary <string, CustomActionCreator>
            {
                [customActionName] = new CustomActionCreator
                {
                    SiteScope   = false,
                    Location    = "ScriptLink",
                    Sequence    = _sequence + 100,
                    ScriptBlock = string.Format(_appSettingsCustomActionWrapper, globalResources),
                    Title       = customActionName
                }
            };

            customActionManager.CustomActions = customActions;
            customActionManager.CreateAll(_ctx, _ctx.Web);
            OnNotify(ProvisioningNotificationLevels.Verbose, "Provisioned generated custom action " + customActionName);
        }
Esempio n. 3
0
        public virtual void FinalizeConfiguration(ClientContext ctx, Web web)
        {
            if (!string.IsNullOrEmpty(ContentType))
            {
                ListInfo = new ListInfo(List, ContentType);
            }
            List.EnableModeration     = EnableModeration;
            List.EnableAttachments    = EnableAttachments;
            List.EnableFolderCreation = EnableFolderCreation;
            List.EnableMinorVersions  = EnableMinorVersions;
            List.EnableVersioning     = EnableVersioning;
            List.ValidationMessage    = ValidationMessage;
            List.ValidationFormula    = ValidationFormula;
            List.NoCrawl = NoCrawl;
            List.Hidden  = Hidden;
            List.Update();
            ctx.ExecuteQuery();

            try
            {
                List.ListExperienceOptions = ListExperienceOptions;
                List.Update();
                ctx.ExecuteQuery();
            }
            catch
            {
                //ignored
            }

            if (CustomActionCreators != null && CustomActionCreators.Count > 0)
            {
                var customActionManager = new CustomActionManager(ctx)
                {
                    CustomActions = CustomActionCreators
                };
                customActionManager.CreateAll(ctx, List);
            }
        }