private void AddTabs(string nspace, IContentTypeComposition node, ContentTypeDescription type) { type.Tabs = new List<TabDescription>(); foreach (var group in node.PropertyGroups.Where(x => !type.IgnoredTabs.Any(y => y.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase)))) { var tab = BuildTabModel(nspace, group, type.IgnoredPropertyAliases, type.ClassName); type.Tabs.Add(tab); } }
private ContentTypeDescription CreateTypeDescription(IContentTypeComposition node, string attributeName) { var type = new ContentTypeDescription(); type.AttributeName = attributeName; type.Alias = node.Alias; type.Name = node.Name; type.AllowAtRoot = node.AllowedAsRoot.ToString().ToLower(); type.ClassName = TypeGeneratorUtils.GetFormattedMemberName(node.Alias); type.EnableListView = node.IsContainer.ToString().ToLower(); type.Icon = node.Icon; type.Description = node.Description == null ? "null" : node.Description.Replace(@"""", @"\"""); return type; }
private void AddAllowedChildTypes(IContentTypeComposition node, ContentTypeDescription type) { if (node.AllowedContentTypes.Count() > 0) { var typeArray = ""; foreach (var allowedType in node.AllowedContentTypes) { if (typeArray != "") { typeArray += ", "; } typeArray += "typeof(" + TypeGeneratorUtils.GetFormattedMemberName(allowedType.Alias) + ")"; } type.AllowedChildren = "new Type[] { " + typeArray + " }"; } else { type.AllowedChildren = "null"; } }