示例#1
0
 public ReadOnlyDocumentLine(ReadOnlyDocument doc, int lineNumber)
 {
     this.doc        = doc;
     this.lineNumber = lineNumber;
     this.offset     = doc.GetStartOffset(lineNumber);
     this.endOffset  = doc.GetEndOffset(lineNumber);
 }
示例#2
0
			public ReadOnlyDocumentLine(ReadOnlyDocument doc, int lineNumber)
			{
				this.doc = doc;
				this.lineNumber = lineNumber;
				this.offset = doc.GetStartOffset(lineNumber);
				this.endOffset = doc.GetEndOffset(lineNumber);
			}
        public void AddCodeBlock(string textContent, bool keepLargeMargin = false)
        {
            var document = new ReadOnlyDocument(textContent);
            var highlightingDefinition = HighlightingManager.Instance.GetDefinition("C#");

            var block = DocumentPrinter.ConvertTextDocumentToBlock(document, highlightingDefinition);

            block.FontFamily = GetCodeFont();
            if (!keepLargeMargin)
            {
                block.Margin = new Thickness(0, 6, 0, 6);
            }
            AddBlock(block);
        }
        public void AddSignatureBlock(string signature, int currentParameterOffset, int currentParameterLength, string currentParameterName)
        {
            ParameterName = currentParameterName;
            var document = new ReadOnlyDocument(signature);
            var highlightingDefinition = HighlightingManager.Instance.GetDefinition("C#");

            var richText = DocumentPrinter.ConvertTextDocumentToRichText(document, highlightingDefinition).ToRichTextModel();

            richText.SetFontWeight(currentParameterOffset, currentParameterLength, FontWeights.Bold);
            var block = new Paragraph();

            block.Inlines.AddRange(new RichText(signature, richText).CreateRuns());             // TODO richText.CreateRuns(document)
            block.FontFamily    = GetCodeFont();
            block.TextAlignment = TextAlignment.Left;
            AddBlock(block);
        }
			public ReadOnlyDocumentLine(ReadOnlyDocument doc, int lineNumber)
			{
				this.doc = doc;
				this.lineNumber = lineNumber;
			}