コード例 #1
0
 protected IEnumerable <IValueReference <TValue> > EnumerateChildren([NotNull] IObjectValueRole <TValue> valueRole,
                                                                     IPresentationOptions options,
                                                                     CancellationToken token)
 {
     // This is essentially the same as ChildrenRenderingUtil.EnumerateMembersFlat and EnumerateMembersWithBaseNode
     // but allows us to split enumerating, sorting, and rendering into separate steps so we can also insert
     // filtering.
     return(options.FlattenHierarchy
         ? ChildrenRenderingUtil.CollectMembersByOverridingRules(valueRole, options, token)
         : GetPropertiesAndFields(valueRole));
 }
コード例 #2
0
        private IEnumerable <IValueEntity> EnumerateMembersFlat(IObjectValueRole <TValue> valueRole,
                                                                IPresentationOptions options,
                                                                CancellationToken token,
                                                                IValueServicesFacade <TValue> valueServices)
        {
            var sortedReferences = ChildrenRenderingUtil.CollectMembersByOverridingRules(valueRole, token)
                                   .Where(IsAllowedReference)
                                   .OrderBy(IdentityFunc <IValueReference <TValue> > .Instance, ByNameReferenceComparer <TValue> .Instance);

            foreach (var memberValue in ChildrenRenderingUtil.RenderReferencesWithVisibilityGroups(sortedReferences, options, token, valueServices))
            {
                yield return(memberValue);
            }

            foreach (var staticMember in ChildrenRenderingUtil.EnumerateStaticMembersIfNeeded(valueRole, options, token, valueServices))
            {
                yield return(staticMember);
            }
        }