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


C# TextEditor.MarginMouseEventArgs类代码示例

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


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


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