コード例 #1
0
        public JustifiedTextChunkView(ITextProcessingRules rules,
                                      ITextNode node,
                                      IStyle style,
                                      IList <ITextChunkView <TDocument> > chunks) : base(node, style)
        {
            this.rules = rules;
            if (chunks.Count == 0)
            {
                throw new ArgumentException();
            }

            Offset    = chunks[0].Offset;
            EndOffset = chunks[chunks.Count - 1].EndOffset;
            EndOffsetWithoutLineBreaks = chunks[chunks.Count - 1].EndOffsetWithoutLineBreaks;
            for (int i = 0; i < chunks.Count; i += 1)
            {
                ChopText(chunks[i]);
            }
        }
コード例 #2
0
 public TextChunkView(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset) : base(node, style)
 {
     this.rules        = rules;
     OffsetPosition    = offset;
     EndOffsetPosition = endOffset;
 }
コード例 #3
0
 public PlainTextDocument() : base(new StringDocumentContent())
 {
     rootNode = new ImmutableBranchNode(this);
     rules    = new TextProcessingRules();
 }
コード例 #4
0
 public PasswordChunkView(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset, string passwordCharacter)
     : base(rules, node, style, offset, endOffset)
 {
     PasswordCharacter = passwordCharacter;
 }
コード例 #5
0
 public LineBreakFilter(ITextProcessingRules rules)
 {
     this.rules         = rules;
     this.bufferContent = new StringDocumentContent();
     this.buffer        = new StringBuilder();
 }
コード例 #6
0
 public static bool IsWordBreakPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(rules.IsWordBreak(prev, curr) != WordBreakType.None);
 }
コード例 #7
0
 public static bool IsValidCursorPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(rules.IsLineBreak(prev, curr) == LineBreakType.None);
 }
コード例 #8
0
 public static bool IsInvalidCursorPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(!rules.IsValidCursorPosition(prev, curr));
 }
コード例 #9
0
 ExposingTestChunk(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset) : base(rules, node, style, offset, endOffset)
 {
 }