当前位置: 首页>>代码示例>>C#>>正文


C# Document.TextMarker类代码示例

本文整理汇总了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);
 }
开发者ID:Diullei,项目名称:Storm,代码行数:7,代码来源:DebuggerControl.cs

示例2: IsCodeCoverageTextMarkerMatch

		bool IsCodeCoverageTextMarkerMatch(TextMarker marker)
		{
			if (marker is CodeCoverageTextMarker) {
				return true;
			}
			return false;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:CodeCoverageHighlighter.cs

示例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;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:BreakpointBookmark.cs

示例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;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:CurrentLineBookmark.cs

示例5: SetUp

		public void SetUp()
		{
			document = new DocumentFactory().CreateDocument();
			document.TextContent = "0123456789";
			marker = new TextMarker(3, 3, TextMarkerType.Underlined);
			document.MarkerStrategy.AddMarker(marker);
		}
开发者ID:nano-byte,项目名称:ICSharpCode.TextEditor,代码行数:7,代码来源:TextMarkerTests.cs

示例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);
            }
        }
开发者ID:FelicePollano,项目名称:Fatica.Labs.XmlEditor,代码行数:32,代码来源:XmlSchemaSquiggleValidator.cs

示例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;
 }
开发者ID:lazanet,项目名称:messylab,代码行数:7,代码来源:BreakpointBookmark.cs

示例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);
        }
开发者ID:FelicePollano,项目名称:Fatica.Labs.XmlEditor,代码行数:8,代码来源:XmlSchemaSquiggleValidator.cs

示例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
        }
开发者ID:424f,项目名称:lebowski,代码行数:15,代码来源:TextEditorTextContext.cs

示例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;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:BreakpointBookmark.cs

示例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;
        }
开发者ID:netide,项目名称:netide,代码行数:10,代码来源:NiTextMarker.cs

示例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
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:16,代码来源:CommandPromptControl.cs

示例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();
            }
        }
开发者ID:fizikci,项目名称:Cinar,代码行数:24,代码来源:CinarDebugger.cs

示例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" );
            }
        }
开发者ID:juliusf,项目名称:lambda,代码行数:36,代码来源:CodeEditorForm.cs

示例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);
 }
开发者ID:hol353,项目名称:ApsimX,代码行数:9,代码来源:FindAndReplaceForm.cs


注:本文中的ICSharpCode.TextEditor.Document.TextMarker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。