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 DeleteGlobalResourcesCustomAction(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, ScriptBlock = string.Format(_appSettingsCustomActionWrapper, globalResources), Title = customActionName } }; customActionManager.CustomActions = customActions; customActionManager.DeleteAll(); OnNotify(ProvisioningNotificationLevels.Verbose, "Removed generated custom action " + customActionName); }
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); } }