本文整理汇总了C#中TextEditor.GetContent方法的典型用法代码示例。如果您正苦于以下问题:C# TextEditor.GetContent方法的具体用法?C# TextEditor.GetContent怎么用?C# TextEditor.GetContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEditor
的用法示例。
在下文中一共展示了TextEditor.GetContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetExtensibleTextEditor
internal static ExtensibleTextEditor GetExtensibleTextEditor (TextEditor editor)
{
var view = editor.GetContent<SourceEditorView> ();
if (view == null)
return null;
return view.TextEditor;
}
示例2: ShowTooltipWindow
public virtual void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
if (tipWindow == null)
return;
var tipInfoWindow = ((Gtk.Widget)tipWindow) as TooltipInformationWindow;
if (tipInfoWindow != null) {
ShowTipInfoWindow (editor, tipInfoWindow, item, modifierState, mouseX, mouseY);
return;
}
var origin = editor.GetContent<ITextEditorImpl> ().GetEditorWindowOrigin ();
int w;
double xalign;
GetRequiredPosition (editor, tipWindow, out w, out xalign);
w += 10;
var allocation = GetAllocation (editor);
int x = (int)(mouseX + origin.X + allocation.X);
int y = (int)(mouseY + origin.Y + allocation.Y);
Gtk.Widget widget = editor;
var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y));
x -= (int) ((double) w * xalign);
y += 10;
if (x + w >= geometry.X + geometry.Width)
x = geometry.X + geometry.Width - w;
if (x < geometry.Left)
x = geometry.Left;
var gtkWindow = (Gtk.Window)tipWindow;
int h = gtkWindow.SizeRequest ().Height;
if (y + h >= geometry.Y + geometry.Height)
y = geometry.Y + geometry.Height - h;
if (y < geometry.Top)
y = geometry.Top;
gtkWindow.Move (x, y);
gtkWindow.ShowAll ();
}
示例3: GetAllocation
protected Xwt.Rectangle GetAllocation (TextEditor editor)
{
return editor.GetContent<ITextEditorImpl> ().GetEditorAllocation ();
}