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

C# TextEditor.MarginMouseEventArgs类代码示例

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

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



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

示例1: InformMouseHover

		public override void InformMouseHover (Mono.TextEditor.MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
		{
			if (!(margin is ActionMargin))
				return;
			string toolTip;
			if (unitTest.IsFixture) {
				if (isFailed) {
					toolTip = GettextCatalog.GetString ("NUnit Fixture failed (click to run)");
					if (!string.IsNullOrEmpty (failMessage))
						toolTip += Environment.NewLine + failMessage.TrimEnd ();
				} else {
					toolTip = GettextCatalog.GetString ("NUnit Fixture (click to run)");
				}
			} else {
				if (isFailed) {
					toolTip = GettextCatalog.GetString ("NUnit Test failed (click to run)");
					if (!string.IsNullOrEmpty (failMessage))
						toolTip += Environment.NewLine + failMessage.TrimEnd ();
					foreach (var id in unitTest.TestCases) {
						if (host.IsFailure (unitTest.UnitTestIdentifier, id)) {
							var msg = host.GetMessage (unitTest.UnitTestIdentifier, id);
							if (!string.IsNullOrEmpty (msg)) {
								toolTip += Environment.NewLine + "Test" + id + ":";
								toolTip += Environment.NewLine + msg.TrimEnd ();
							}
						}
					}
				} else {
					toolTip = GettextCatalog.GetString ("NUnit Test (click to run)");
				}

			}
			editor.TooltipText = toolTip;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:34,代码来源:UnitTestMarker.cs


示例2: TextEventArgsWrapper

		bool IActionTextLineMarker.MousePressed (Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args)
		{
			var handler = MousePressed;
			if (handler != null)
				handler (this, new TextEventArgsWrapper (args));
			return false;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:SmartTagMarker.cs


示例3: TextEventArgsWrapper

		void IActionTextLineMarker.MouseHover (MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
		{
			MouseHover?.Invoke (this, new TextEventArgsWrapper (args));
			result.Cursor = textLinkCursor;
			if (OnlyShowLinkOnHover) {
				editor.GetTextEditorData ().Document.CommitLineUpdate (args.LineSegment);
				editor.TextViewMargin.HoveredLineChanged += new UpdateOldLine (editor, args.LineSegment).TextViewMargin_HoveredLineChanged;
			}
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:9,代码来源:LinkMarker.cs


示例4:

		bool IActionTextLineMarker.MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args)
		{
			if ((Platform.IsMac && (args.ModifierState & Gdk.ModifierType.Mod2Mask) == Gdk.ModifierType.Mod2Mask) ||
			    (!Platform.IsMac && (args.ModifierState & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask))
				activateLink?.Invoke (LinkRequest.RequestNewView);
			else
				activateLink?.Invoke (LinkRequest.SameView);
			
			return false;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:10,代码来源:LinkMarker.cs


示例5:

		void IIconBarMarker.MouseHover (MarginMouseEventArgs args)
		{
			var sb = new System.Text.StringBuilder ();
			foreach (var error in errors) {
				if (sb.Length > 0)
					sb.AppendLine ();
				sb.Append (error.ErrorMessage);
			}
			args.Editor.TooltipText = sb.ToString ();
		}
开发者ID:halleyxu,项目名称:monodevelop,代码行数:10,代码来源:MessageBubbleTextMarker_IconBar.cs


示例6: MouseReleased

		internal protected override void MouseReleased (MarginMouseEventArgs args)
		{
			base.MouseReleased (args);
			
			DocumentLine lineSegment = args.LineSegment;
			if (lineSegment != null) {
				foreach (TextLineMarker marker in lineSegment.Markers) {
					if (marker is IIconBarMarker) 
						((IIconBarMarker)marker).MouseRelease (args);
				}
			}
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:12,代码来源:IconMargin.cs


示例7: MousePressed

		internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);

			DocumentLine lineSegment = args.LineSegment;
			if (lineSegment != null) {
				foreach (TextLineMarker marker in lineSegment.Markers) {
					var marginMarker = marker as MarginMarker;
					if (marginMarker != null) 
						marginMarker.InformMousePress (editor, this, args);
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:ActionMargin.cs


示例8: InformMouseHover

		public override void InformMouseHover (MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
		{
			base.InformMouseHover (editor, margin, args);
			if (!string.IsNullOrEmpty (Tooltip)) {
				if (CanDrawForeground (margin))
					// update tooltip during the next ui loop run,
					// otherwise Gtk will not update the position of the tooltip
					Gtk.Application.Invoke (delegate {
						args.Editor.TooltipText = Tooltip;
					});
				else if (args.Editor.TooltipText == Tooltip)
					args.Editor.TooltipText = null;
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:14,代码来源:DebugTextMarker.cs


示例9: MousePressed

		internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			DocumentLine lineSegment = args.LineSegment;
			if (lineSegment != null) {
				foreach (TextLineMarker marker in lineSegment.Markers) {
					var marginMarker = marker as MarginMarker;
					if (marginMarker != null) 
						marginMarker.InformMousePress (editor, this, args);

#pragma warning disable 618
					if (marker is IIconBarMarker) 
						((IIconBarMarker)marker).MousePress (args);
#pragma warning restore 618
				}
			}
		}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:18,代码来源:IconMargin.cs


示例10:

		void IActionTextLineMarker.MouseHover (Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
		{
			if (args.Button != 0)
				return;
			var line = editor.GetLine (loc.Line);
			if (line == null)
				return;
			var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
			//var y = editor.LineToY (line.LineNumber + 1) - editor.VAdjustment.Value;
			const double xAdditionalSpace = tagMarkerWidth;
			if (args.X - x >= -xAdditionalSpace * editor.Options.Zoom && 
				args.X - x < (tagMarkerWidth + xAdditionalSpace) * editor.Options.Zoom /*&& 
				    args.Y - y < (editor.LineHeight / 2) * editor.Options.Zoom*/) {
				result.Cursor = null;
				ShowPopup?.Invoke (null, null);
			} else {
				CancelPopup?.Invoke (null, null);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:19,代码来源:SmartTagMarker.cs


示例11:

			void IActionTextLineMarker.MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
			{
				if (args.Button != 0)
					return;
				var line = editor.GetLine (loc.Line);
				var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value;
				var y = editor.LineToY (line.LineNumber) - editor.VAdjustment.Value;
				if (args.X - x >= 0 * editor.Options.Zoom && 
				    args.X - x < tagMarkerWidth * editor.Options.Zoom && 
				    y - args.Y < (tagMarkerHeight) * editor.Options.Zoom) {
					result.Cursor = arrowCursor;
					Popup ();
				} else {
					codeActionEditorExtension.CancelSmartTagPopupTimeout ();
				}
			}
开发者ID:kenkendk,项目名称:monodevelop,代码行数:16,代码来源:CodeActionEditorExtension.cs


示例12: MouseHover

		public void MouseHover (TextEditor editor, MarginMouseEventArgs args, TextMarkerHoverResult result)
		{
			bool isOver = MouseIsOverMarker (editor, args);
			if (isOver != oldIsOver)
				editor.Document.CommitLineUpdate (this.LineSegment);
			oldIsOver = isOver;
			
			int errorNumber = MouseIsOverError (editor, args);
			if (errorNumber >= 0) {
				result.Cursor = arrowCursor;
				if (!isOver)
					// don't show tooltip when hovering over error counter layout.
					result.TooltipMarkup = GLib.Markup.EscapeText (errors[errorNumber].ErrorMessage);
			}
			
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:16,代码来源:MessageBubbleTextMarker.cs


示例13: MousePress

		public void MousePress (MarginMouseEventArgs args)
		{
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:3,代码来源:BookmarkMarker.cs


示例14: OnIconButtonPress

		void OnIconButtonPress (object s, MarginMouseEventArgs args)
		{
			if (args.TriggersContextMenu ()) {
				TextEditor.Caret.Line = args.LineNumber;
				TextEditor.Caret.Column = 1;
				IdeApp.CommandService.ShowContextMenu (WorkbenchWindow.ExtensionContext, "/MonoDevelop/SourceEditor2/IconContextMenu/Editor");
			} else if (args.Button == 1) {
				if (!string.IsNullOrEmpty (this.Document.FileName)) {
					if (args.LineSegment != null)
						DebuggingService.Breakpoints.Toggle (this.Document.FileName, args.LineNumber);
				}
			}
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:13,代码来源:SourceEditorView.cs


示例15: MousePressed

		internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			if (lineHover == null)
				return;
			foreach (FoldSegment segment in editor.Document.GetStartFoldings (lineHover)) {
				segment.IsFolded = !segment.IsFolded; 
			}
			editor.SetAdjustments ();
			editor.Caret.MoveCaretBeforeFoldings ();
			editor.QueueDraw ();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:FoldMarkerMargin.cs


示例16: MousePressed

		public bool MousePressed (TextEditor editor, MarginMouseEventArgs args)
		{
			return false;
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:4,代码来源:MessageBubbleTextMarker.cs


示例17: MouseReleased

		protected internal override void MouseReleased (MarginMouseEventArgs args)
		{
			if (args.Button != 2 && !InSelectionDrag)
				textEditor.ClearSelection ();
			InSelectionDrag = false;
			if (inDrag)
				Caret.Location = clickLocation;
			base.MouseReleased (args);
		}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:9,代码来源:TextViewMargin.cs


示例18: MouseReleased

		protected internal override void MouseReleased (MarginMouseEventArgs args)
		{
			if (args.Button != 2 && !InSelectionDrag)
				textEditor.ClearSelection ();

			DocumentLine line = Document.GetLine (clickLocation.Line);
			bool isHandled = false;
			if (line != null) {
				foreach (TextLineMarker marker in line.Markers) {
					if (marker is IActionTextLineMarker) {
						isHandled |= ((IActionTextLineMarker)marker).MouseReleased(textEditor, args);
						if (isHandled)
							break;
					}
				}
				var locNotSnapped = PointToLocation (args.X, args.Y, snapCharacters: false);
				foreach (var marker in Document.GetTextSegmentMarkersAt (Document.GetOffset (locNotSnapped)).Where (m => m.IsVisible)) {
					if (marker is IActionTextLineMarker) {
						isHandled |= ((IActionTextLineMarker)marker).MouseReleased (textEditor, args);
						if (isHandled)
							break;
					}
				}
			}


			InSelectionDrag = false;
			if (inDrag)
				Caret.Location = clickLocation;
			base.MouseReleased (args);
		}
开发者ID:powerumc,项目名称:monodevelop_korean,代码行数:31,代码来源:TextViewMargin.cs


示例19: MousePressed

		protected internal override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			if (args.TriggersContextMenu ())
				return;
			
			InSelectionDrag = false;
			inDrag = false;
			Selection selection = textEditor.MainSelection;
			int oldOffset = textEditor.Caret.Offset;

			string link = GetLink != null ? GetLink (args) : null;
			if (!String.IsNullOrEmpty (link)) {
				textEditor.FireLinkEvent (link, args.Button, args.ModifierState);
				return;
			}

			if (args.Button == 1) {
				if (!CalculateClickLocation (args.X, args.Y, out clickLocation))
					return;

				DocumentLine line = Document.GetLine (clickLocation.Line);
				bool isHandled = false;
				if (line != null) {
					foreach (TextLineMarker marker in line.Markers) {
						if (marker is IActionTextLineMarker) {
							isHandled |= ((IActionTextLineMarker)marker).MousePressed (textEditor, args);
							if (isHandled)
								break;
						}
					}
					foreach (var marker in Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)) {
						if (marker is IActionTextLineMarker) {
							isHandled |= ((IActionTextLineMarker)marker).MousePressed (textEditor, args);
							if (isHandled)
								break;
						}
					}
				}
				if (isHandled)
					return;

				int offset = Document.LocationToOffset (clickLocation);
				if (offset < 0) {
					textEditor.RunAction (CaretMoveActions.ToDocumentEnd);
					return;
				}
				if (args.Button == 2 && !selection.IsEmpty && selection.Contains (Document.OffsetToLocation (offset))) {
					textEditor.ClearSelection ();
					return;
				}

				if (args.Type == EventType.TwoButtonPress) {
					var data = textEditor.GetTextEditorData ();
					mouseWordStart = data.FindCurrentWordStart (offset);
					mouseWordEnd = data.FindCurrentWordEnd (offset);
					Caret.Offset = mouseWordEnd;
					textEditor.MainSelection = new Selection (textEditor.Document.OffsetToLocation (mouseWordStart), textEditor.Document.OffsetToLocation (mouseWordEnd));
					InSelectionDrag = true;
					mouseSelectionMode = MouseSelectionMode.Word;

					// folding marker
					int lineNr = args.LineNumber;
					foreach (var shownFolding in GetFoldRectangles (lineNr)) {
						if (shownFolding.Item1.Contains ((int)(args.X + this.XOffset), (int)args.Y)) {
							shownFolding.Item2.IsFolded = false;
							return;
						}
					}
					return;
				} else if (args.Type == EventType.ThreeButtonPress) {
					int lineNr = Document.OffsetToLineNumber (offset);
					textEditor.SetSelectLines (lineNr, lineNr);

					var range = textEditor.SelectionRange;
					mouseWordStart = range.Offset;
					mouseWordEnd = range.EndOffset;

					InSelectionDrag = true;
					mouseSelectionMode = MouseSelectionMode.WholeLine;
					return;
				}
				mouseSelectionMode = MouseSelectionMode.SingleChar;

				if (textEditor.IsSomethingSelected && textEditor.SelectionRange.Offset <= offset && offset < textEditor.SelectionRange.EndOffset && clickLocation != textEditor.Caret.Location) {
					inDrag = true;
				} else {
					if ((args.ModifierState & Gdk.ModifierType.ShiftMask) == ModifierType.ShiftMask) {
						InSelectionDrag = true;
						Caret.PreserveSelection = true;
						if (!textEditor.IsSomethingSelected) {
							textEditor.MainSelection = new Selection (Caret.Location, clickLocation);
							Caret.Location = clickLocation;
						} else {
							Caret.Location = clickLocation;
							textEditor.ExtendSelectionTo (clickLocation);
						}
						Caret.PreserveSelection = false;
					} else {
//.........这里部分代码省略.........
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:101,代码来源:TextViewMargin.cs


示例20: InformMouseHover

		/// <summary>
		/// Informs the margin marker of a mouse hover event.
		/// </summary>
		/// <param name="editor">The text editor in which the event press occured.</param>
		/// <param name="margin">The margin in which the event occured.</param>
		/// <param name="args">The event arguments.</param>
		public virtual void InformMouseHover (TextEditor editor, Margin margin, MarginMouseEventArgs args)
		{
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:9,代码来源:MarginMarker.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TextEditor.ReplaceEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# TextEditor.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