本文整理汇总了C#中IQuickInfoSession.Start方法的典型用法代码示例。如果您正苦于以下问题:C# IQuickInfoSession.Start方法的具体用法?C# IQuickInfoSession.Start怎么用?C# IQuickInfoSession.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuickInfoSession
的用法示例。
在下文中一共展示了IQuickInfoSession.Start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTextViewMouseHover
void OnTextViewMouseHover(object sender, MouseHoverEventArgs e)
{
SnapshotPoint? point = GetMousePosition(new SnapshotPoint(_textView.TextSnapshot, e.Position));
if (point != null) {
ITrackingPoint triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position, PointTrackingMode.Positive);
// Find the broker for this buffer
if (!_componentContext.QuickInfoBroker.IsQuickInfoActive(_textView)) {
_session = _componentContext.QuickInfoBroker.CreateQuickInfoSession(_textView, triggerPoint, true);
_session.Start();
}
}
}
示例2: textView_MouseHover
/// <summary>
/// Activates a new QuickInfo session in response to the MouseHover event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void textView_MouseHover(object sender, MouseHoverEventArgs e)
{
if (activeSession != null)
activeSession.Dismiss();
SnapshotPoint? point = e.TextPosition.GetPoint(
textBuffer =>
(
buffer == textBuffer
// only text buffers require expilicit session activation
// XML and HTML already have quickInfo session activation code
// adding our own would cause 'double vision' - our source would be hit
// by our session as well as by the standard one
&& textBuffer.ContentType.TypeName == "plaintext"
)
,PositionAffinity.Predecessor);
if (point.HasValue)
{
ITrackingPoint triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position, PointTrackingMode.Positive);
activeSession = provider.quickInfoBroker.CreateQuickInfoSession(textView, triggerPoint, true);
activeSession.Start();
}
}
示例3: OnTextViewMouseHover
/// <summary>
/// Add the mouse hover event handler that triggers the QuickInfo session.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The <see cref="MouseHoverEventArgs"/>.
/// </param>
private void OnTextViewMouseHover(object sender, MouseHoverEventArgs e)
{
// find the mouse position by mapping down to the subject buffer
var point = GetMousePosition(new SnapshotPoint(textView.TextSnapshot, e.Position));
if (point != null)
{
var triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position, PointTrackingMode.Positive);
// Find the broker for this buffer
if (!componentContext.QuickInfoBroker.IsQuickInfoActive(textView))
{
session = componentContext.QuickInfoBroker.CreateQuickInfoSession(textView, triggerPoint, true);
session.Start();
}
}
}
示例4: textView_MouseHover
/// <summary>
/// Activates a new QuickInfo session in response to the MouseHover event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void textView_MouseHover(object sender, MouseHoverEventArgs e)
{
if (activeSession != null)
activeSession.Dismiss();
SnapshotPoint? point = e.TextPosition.GetPoint(
textBuffer =>
(
subjectBuffers.Contains(textBuffer)
&& nodeProviderBroker.IsNDjango(textBuffer, context)
&& brokerMapService.GetBrokerForTextView(textView, textBuffer) != null
&& !(textBuffer is IProjectionBuffer)
)
,PositionAffinity.Predecessor);
if (point.HasValue)
{
NodeProvider nodeProvider = nodeProviderBroker.GetNodeProvider(point.Value.Snapshot.TextBuffer);
List<INode> quickInfoNodes = nodeProvider.GetNodes(point.Value);
if (quickInfoNodes != null)
{
// the invocation occurred in a subject buffer of interest to us
IQuickInfoBroker broker = brokerMapService.GetBrokerForTextView(textView, point.Value.Snapshot.TextBuffer);
ITrackingPoint triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position, PointTrackingMode.Positive);
activeSession = broker.CreateQuickInfoSession(triggerPoint, true);
activeSession.Properties.AddProperty(typeof(SourceProvider), quickInfoNodes);
activeSession.Start();
}
}
}