• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Document.TextMarker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICSharpCode.TextEditor.Document.TextMarker的典型用法代码示例。如果您正苦于以下问题:C# TextMarker类的具体用法?C# TextMarker怎么用?C# TextMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextMarker类属于ICSharpCode.TextEditor.Document命名空间,在下文中一共展示了TextMarker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: AddMarker

 public void AddMarker(TextMarker marker)
 {
     _markers.Add(marker);
     _document.MarkerStrategy.AddMarker(marker);
 }
开发者ID:hol353,项目名称:ApsimX,代码行数:5,代码来源:FindAndReplaceForm.cs


示例17: btnHighlightAll_Click

        private void btnHighlightAll_Click(object sender, EventArgs e)
        {
            if (!_highlightGroups.ContainsKey(_editor))
                _highlightGroups[_editor] = new HighlightGroup(_editor);
            HighlightGroup group = _highlightGroups[_editor];

            if (string.IsNullOrEmpty(LookFor))
                // Clear highlights
                group.ClearMarkers();
            else {
                _search.LookFor = txtLookFor.Text;
                _search.MatchCase = chkMatchCase.Checked;
                _search.MatchWholeWordOnly = chkMatchWholeWord.Checked;

                bool looped = false;
                int offset = 0, count = 0;
                for(;;) {
                    TextRange range = _search.FindNext(offset, false, out looped);
                    if (range == null || looped)
                        break;
                    offset = range.Offset + range.Length;
                    count++;

                    var m = new TextMarker(range.Offset, range.Length,
                            TextMarkerType.SolidBlock, Color.Yellow, Color.Black);
                    group.AddMarker(m);
                }
                if (count == 0)
                    MessageBox.Show("Search text not found.");
                else
                    Close();
            }
        }
开发者ID:hol353,项目名称:ApsimX,代码行数:33,代码来源:FindAndReplaceForm.cs


示例18: IsXPathNodeTextMarkerMatch

 static bool IsXPathNodeTextMarkerMatch(TextMarker marker)
 {
     return marker is XPathNodeTextMarker;
 }
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:4,代码来源:XPathNodeTextMarker.cs


示例19: DrawMarker

		void DrawMarker(Graphics g, TextMarker marker, RectangleF drawingRect)
		{
			// draw markers later so they can overdraw the following text
			markersToDraw.Add(new MarkerToDraw(marker, drawingRect));
		}
开发者ID:modulexcite,项目名称:FluentSharp_Fork.SharpDevelopEditor,代码行数:5,代码来源:TextView.cs


示例20: MarkerToDraw

			public MarkerToDraw(TextMarker marker, RectangleF drawingRect)
			{
				this.marker = marker;
				this.drawingRect = drawingRect;
			}
开发者ID:modulexcite,项目名称:FluentSharp_Fork.SharpDevelopEditor,代码行数:5,代码来源:TextView.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TreeView.SharpTreeNode类代码示例发布时间:2022-05-26
下一篇:
C# Document.LineSegment类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap