本文整理汇总了C#中ICSharpCode.TextEditor.Document.TextMarker类的典型用法代码示例。如果您正苦于以下问题:C# TextMarker类的具体用法?C# TextMarker怎么用?C# TextMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextMarker类属于ICSharpCode.TextEditor.Document命名空间,在下文中一共展示了TextMarker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BreakPoint
public void BreakPoint(int start, int end, int lineStart, int colStart, int lineEnd, int colEnd)
{
var offset = start;
var length = (end - start);
var marker = new TextMarker(offset, length, TextMarkerType.SolidBlock, Color.Yellow);
txtDebug.Document.MarkerStrategy.AddMarker(marker);
}
示例2: IsCodeCoverageTextMarkerMatch
bool IsCodeCoverageTextMarkerMatch(TextMarker marker)
{
if (marker is CodeCoverageTextMarker) {
return true;
}
return false;
}
示例3: CreateMarker
protected override TextMarker CreateMarker()
{
LineSegment lineSeg = Anchor.Line;
TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, defaultColor, Color.White);
Document.MarkerStrategy.AddMarker(marker);
return marker;
}
示例4: CreateMarker
protected override TextMarker CreateMarker()
{
LineSegment lineSeg = Document.GetLineSegment(startLine - 1);
TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue);
Document.MarkerStrategy.InsertMarker(0, marker);
return marker;
}
示例5: SetUp
public void SetUp()
{
document = new DocumentFactory().CreateDocument();
document.TextContent = "0123456789";
marker = new TextMarker(3, 3, TextMarkerType.Underlined);
document.MarkerStrategy.AddMarker(marker);
}
示例6: Validate
public void Validate(String doc,TextArea textArea)
{
this.textArea = textArea;
textArea.Document.MarkerStrategy.RemoveAll(p => true);
XmlReaderSettings settings = new XmlReaderSettings();
settings.CloseInput = true;
settings.ValidationEventHandler += new ValidationEventHandler(settings_ValidationEventHandler); // Your callback...
settings.ValidationType = ValidationType.Schema;
settings.Schemas.Add(schemaset);
settings.ValidationFlags =
XmlSchemaValidationFlags.ReportValidationWarnings |
XmlSchemaValidationFlags.ProcessIdentityConstraints |
XmlSchemaValidationFlags.ProcessInlineSchema |
XmlSchemaValidationFlags.ProcessSchemaLocation;
// Wrap document in an XmlNodeReader and run validation on top of that
try
{
using (XmlReader validatingReader = XmlReader.Create(new StringReader(doc), settings))
{
while (validatingReader.Read()) { /* just loop through document */ }
}
}
catch (XmlException e)
{
var offset = textArea.Document.PositionToOffset(new TextLocation(e.LinePosition, e.LineNumber));
var mk = new TextMarker(offset, 5, TextMarkerType.WaveLine, Color.DarkBlue );
mk.ToolTip = e.Message;
textArea.Document.MarkerStrategy.AddMarker(mk);
}
}
示例7: CreateMarker
protected override TextMarker CreateMarker()
{
LineSegment lineSeg = Anchor.Line;
TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock,
Color.FromArgb(180, 38, 38), Color.White);
return marker;
}
示例8: OnValidate
protected void OnValidate(object _, ValidationEventArgs vae)
{
var offset = textArea.Document.PositionToOffset(new TextLocation(vae.Exception.LinePosition-1,vae.Exception.LineNumber-1));
var mk = new TextMarker(offset, GetWordLen(offset), TextMarkerType.WaveLine, vae.Severity == XmlSeverityType.Error ? Color.DarkBlue : Color.Green);
mk.ToolTip = vae.Message;
textArea.Document.MarkerStrategy.AddMarker(mk);
}
示例9: TextEditorTextContext
/// <summary>
/// Initializes a new instance of the TextEditorTextContent class.
/// This TextEditorTextContent instance will be linked with a
/// TextEditorControl.
/// </summary>
/// <param name="textBox">The TextEditorControl to link with.</param>
public TextEditorTextContext(TextEditorControl textBox)
{
TextBox = textBox;
SubscribeToTextBox();
remoteMarker = new TextMarker(0, 0, TextMarkerType.SolidBlock, System.Drawing.Color.Yellow);
// TODO: implement insert / delete
}
示例10: CreateMarker
protected override TextMarker CreateMarker()
{
if (LineNumber >= Document.TotalNumberOfLines)
LineNumber = Document.TotalNumberOfLines - 1;
LineSegment lineSeg = Document.GetLineSegment(LineNumber);
TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, Color.Red, Color.White);
Document.MarkerStrategy.AddMarker(marker);
return marker;
}
示例11: NiTextMarker
public NiTextMarker(NiTextLines owner, TextMarker marker)
{
if (owner == null)
throw new ArgumentNullException("owner");
if (marker == null)
throw new ArgumentNullException("marker");
_owner = owner;
_marker = marker;
}
示例12: MakeReadOnly
/// <summary>
/// Makes the current control content read-only (but still allows appending more content at the end).
/// </summary>
protected void MakeReadOnly()
{
if (this.Document.TextLength == 0)
return;
this.ActiveTextAreaControl.Caret.Position = this.Document.OffsetToPosition(this.Document.TextLength);
if (readOnlyMarker == null) {
readOnlyMarker = new TextMarker(0, this.Document.TextLength, TextMarkerType.Invisible) { IsReadOnly = true };
this.Document.MarkerStrategy.AddMarker(readOnlyMarker);
}
readOnlyMarker.Offset = 0;
readOnlyMarker.Length = this.Document.TextLength;
this.Document.UndoStack.ClearAll(); // prevent user from undoing the prompt insertion
}
示例13: SetMarker
public void SetMarker(Context context)
{
editor.Document.MarkerStrategy.RemoveAll(m => m != null);
if (Context.CurrentStatement != null)
{
statusBarLabel.Text = Context.CurrentStatement.ToString().Split('\n')[0].Trim();
txtOutput.Text = debugStartContext.RootContext.Interpreter.Output;
LineSegment seg = editor.Document.GetLineSegment(Context.CurrentStatement.LineNumber);
TextMarker marker = new TextMarker(seg.Offset + Context.CurrentStatement.ColumnNumber, seg.Length - Context.CurrentStatement.ColumnNumber, TextMarkerType.SolidBlock, Color.Yellow);
editor.Document.MarkerStrategy.AddMarker(marker);
editor.ActiveTextAreaControl.Caret.Position = editor.Document.OffsetToPosition(seg.Offset);
tree.Nodes.Clear();
while (context.parent != null)
{
foreach (object key in context.Variables.Keys)
addNode(null, key.ToString(), context.Variables[key]);
context = context.parent;
}
Application.DoEvents();
this.Refresh();
}
}
示例14: evaluate
public void evaluate()
{
var reader = new SchemeReader();
var evaluator = new SchemeEvaluator();
//var ast = reader.parseString( ActiveEditor.Text );
var ast = reader.parseStringWithPos( ActiveEditor.Text, ActiveEditor.Name );
List<SchemeObject> res;
try
{
res = evaluator.evaluate(ast);
}
catch (SchemeException e)
{
var document = codeWindow.Document;
var marker = new TextMarker(e.offset, e.length, TextMarkerType.SolidBlock);
document.MarkerStrategy.AddMarker(marker);
var update = new TextAreaUpdate(TextAreaUpdateType.WholeTextArea);
document.RequestUpdate(update);
document.CommitUpdate();
int length = resultWindow.Text.Length;
resultWindow.AppendText(e.Message);
resultWindow.Select(length, (resultWindow.Text.Length - length));
resultWindow.SelectionColor = Color.Red;
return;
}
// resultWindow.
foreach( SchemeObject obj in res )
{
resultWindow.AppendText( obj.ToString() + "\n" );
}
}
示例15: SetScanRegion
/// <summary>Sets the region to search. The region is updated
/// automatically as the document changes.</summary>
public void SetScanRegion(int offset, int length)
{
var bkgColor = _document.HighlightingStrategy.GetColorFor("Default").BackgroundColor;
_region = new TextMarker(offset, length, TextMarkerType.SolidBlock,
bkgColor.HalfMix(Color.FromArgb(160,160,160)));
_document.MarkerStrategy.AddMarker(_region);
}