本文整理汇总了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;
}
示例2: TextEventArgsWrapper
bool IActionTextLineMarker.MousePressed (Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args)
{
var handler = MousePressed;
if (handler != null)
handler (this, new TextEventArgsWrapper (args));
return false;
}
示例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;
}
}
示例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;
}
示例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 ();
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
}
示例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
}
}
}
示例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);
}
}
示例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 ();
}
}
示例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);
}
}
示例13: MousePress
public void MousePress (MarginMouseEventArgs args)
{
}
示例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);
}
}
}
示例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 ();
}