public static List CreateList(string title, string description, string url, ListTemplateType templateType, Web web, QuickLaunchOptions quicklaunchOptions) { ClientContext clientContext = web.Context as ClientContext; ListCreationInformation createInfo = new ListCreationInformation(); createInfo.Title = title; createInfo.TemplateType = (int)templateType; createInfo.QuickLaunchOption = quicklaunchOptions; if (!string.IsNullOrEmpty(description)) { createInfo.Description = description; } if (!string.IsNullOrEmpty(url)) { createInfo.Url = url; } // clientContext.Load(web.Lists); List newList = web.Lists.Add(createInfo); clientContext.ExecuteQuery(); clientContext.Load(newList); clientContext.ExecuteQuery(); return newList; }
public static List CreateList(ClientContext ctx, int templateType, string title, string url, QuickLaunchOptions quickLaunchOptions) { ListCreationInformation listCreationInfo = new ListCreationInformation { TemplateType = templateType, Title = title, Url = url, QuickLaunchOption = quickLaunchOptions }; List spList = ctx.Web.Lists.Add(listCreationInfo); ctx.Load(spList); ctx.ExecuteQuery(); return spList; }
public static List CreateList(ClientContext ctx, int templateType, string title, string url, QuickLaunchOptions quickLaunchOptions) { ListCreationInformation listCreationInfo = new ListCreationInformation { TemplateType = templateType, Title = title, Url = url, QuickLaunchOption = quickLaunchOptions }; List spList = ctx.Web.Lists.Add(listCreationInfo); ctx.Load(spList); ctx.ExecuteQuery(); return(spList); }
public QuickLaunchOptionAttribute(bool displayOnQuickLaunch) { QuickLaunchOption = displayOnQuickLaunch ? QuickLaunchOptions.On : QuickLaunchOptions.Off; }
public QuickLaunchOptionAttribute(QuickLaunchOptions quickLaunchOption) { QuickLaunchOption = quickLaunchOption; }
protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader) { bool flag = base.InitOnePropertyFromJson(peekedName, reader); if (flag) { return(flag); } switch (peekedName) { case "CustomSchemaXml": flag = true; reader.ReadName(); this.m_customSchemaXml = reader.ReadString(); break; case "DataSourceProperties": flag = true; reader.ReadName(); this.m_dataSourceProperties = reader.ReadDictionary <string>(); break; case "Description": flag = true; reader.ReadName(); this.m_description = reader.ReadString(); break; case "DocumentTemplateType": flag = true; reader.ReadName(); this.m_documentTemplateType = reader.ReadInt32(); break; case "QuickLaunchOption": flag = true; reader.ReadName(); this.m_quickLaunchOption = reader.ReadEnum <QuickLaunchOptions>(); break; case "TemplateFeatureId": flag = true; reader.ReadName(); this.m_templateFeatureId = reader.ReadGuid(); break; case "TemplateType": flag = true; reader.ReadName(); this.m_templateType = reader.ReadInt32(); break; case "Title": flag = true; reader.ReadName(); this.m_title = reader.ReadString(); break; case "Url": flag = true; reader.ReadName(); this.m_url = reader.ReadString(); break; } return(flag); }