Пример #1
0
        public static ContextData GetCommentsTarget(
            this ISingleLinkedList <ContextData> context)
        {
            var result = context.SkipWhile(c => ContextExtensions.ExactScalar(c.Type, ContextType.Comment));

            return(result.Value);
        }
Пример #2
0
        public static bool StartsWithCommentsSequence(
            this ISingleLinkedList <ContextData> context,
            out Guid topCommentId,
            out ISingleLinkedList <ContextData> comments,
            out ContextData commentsTarget,
            out ISingleLinkedList <ContextData> tail)
        {
            var(commentsResult, rest) = context.Span(c => ContextExtensions.ExactScalar(c.Type, ContextType.Comment));

            if (commentsResult.Any())
            {
                topCommentId   = commentsResult.Value.EntityId.Value;
                comments       = commentsResult.Tail;
                commentsTarget = rest.Value;
                tail           = rest.Tail;

                return(true);
            }

            topCommentId   = Guid.Empty;
            comments       = null;
            commentsTarget = null;
            tail           = null;
            return(false);
        }
Пример #3
0
 public void UpdateViewData()
 {
     ViewData[ContextKey] = ContextExtensions.Select(FullContext
                                                     .Where(x => !ContextExtensions.ExactScalar(x.Type, ContextType.Empty)), ContextExtensions.ContextDataTransferModel);
 }