Example #1
0
        private DataViewTemplateEntry GetDataViewTemplateEntryInternal(IType platformType, DataViewTemplate dataViewTemplate)
        {
            if (platformType == null)
            {
                return((DataViewTemplateEntry)null);
            }
            DataViewTemplateEntry viewTemplateEntry = dataViewTemplate.TemplateEntries.Find((Predicate <DataViewTemplateEntry>)(entry => entry.DataType.IsAssignableFrom((ITypeId)platformType)));

            if (viewTemplateEntry == null)
            {
                if (!DataViewBuilder.ShouldTreatAsStringType(platformType))
                {
                    return((DataViewTemplateEntry)null);
                }
                platformType      = this.Platform.Metadata.ResolveType(PlatformTypes.String);
                viewTemplateEntry = dataViewTemplate.TemplateEntries.Find((Predicate <DataViewTemplateEntry>)(entry => entry.DataType.IsAssignableFrom((ITypeId)platformType)));
            }
            return(viewTemplateEntry);
        }
Example #2
0
        public static DocumentCompositeNode GenerateDataView(IPlatform platform, IDocumentContext documentContext, IList <DataSchemaNodePath> entries, DataViewCategory category, DocumentCompositeNode containerNode, IDataViewLayoutBuilder layoutBuilder)
        {
            DataViewBuilder dataViewBuilder = new DataViewBuilder(platform);

            return(dataViewBuilder != null?dataViewBuilder.GenerateDataView(documentContext, entries, category, containerNode, layoutBuilder) : (DocumentCompositeNode)null);
        }