Beispiel #1
0
        private ListCreationInformation BuildListCreationInformation(ClientContext context, Type entityType)
        {
            ListCreationInformation listCreationInfo = new ListCreationInformation
            {
                Title        = EntityHelper.GetInternalNameFromEntityType(entityType),
                TemplateType = EntityHelper.GetListTemplateType(entityType),
                Description  = EntityHelper.GetDescriptionFromEntityType(entityType),
            };
            int?documentTemplateType = GetTableDocumentTemplateType(entityType);

            if (documentTemplateType.HasValue)
            {
                listCreationInfo.DocumentTemplateType = documentTemplateType.Value;
            }

            QuickLaunchOptions?quickLaunchOption = GetQuickLaunchOption(entityType);

            if (quickLaunchOption.HasValue)
            {
                listCreationInfo.QuickLaunchOption = quickLaunchOption.Value;
            }

            string url = GetTableUrl(entityType);

            if (url != null)
            {
                listCreationInfo.Url = url;
            }

            return(listCreationInfo);
        }