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]);
            }
        }
Esempio n. 2
0
 public TextChunkView(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset) : base(node, style)
 {
     this.rules        = rules;
     OffsetPosition    = offset;
     EndOffsetPosition = endOffset;
 }
Esempio n. 3
0
 public PlainTextDocument() : base(new StringDocumentContent())
 {
     rootNode = new ImmutableBranchNode(this);
     rules    = new TextProcessingRules();
 }
Esempio n. 4
0
 public PasswordChunkView(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset, string passwordCharacter)
     : base(rules, node, style, offset, endOffset)
 {
     PasswordCharacter = passwordCharacter;
 }
 public LineBreakFilter(ITextProcessingRules rules)
 {
     this.rules         = rules;
     this.bufferContent = new StringDocumentContent();
     this.buffer        = new StringBuilder();
 }
Esempio n. 6
0
 public static bool IsWordBreakPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(rules.IsWordBreak(prev, curr) != WordBreakType.None);
 }
Esempio n. 7
0
 public static bool IsValidCursorPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(rules.IsLineBreak(prev, curr) == LineBreakType.None);
 }
Esempio n. 8
0
 public static bool IsInvalidCursorPosition(this ITextProcessingRules rules, char prev, char curr)
 {
     return(!rules.IsValidCursorPosition(prev, curr));
 }
Esempio n. 9
0
 ExposingTestChunk(ITextProcessingRules rules, ITextNode node, IStyle style, ITextPosition offset, ITextPosition endOffset) : base(rules, node, style, offset, endOffset)
 {
 }