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


C# IQuickInfoSession.Start方法代码示例

本文整理汇总了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();
            }
              }
        }
开发者ID:dbremner,项目名称:dafny,代码行数:14,代码来源:HoverText.cs

示例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();
            }
        }
开发者ID:klewin,项目名称:NDjango,代码行数:30,代码来源:Controller.cs

示例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();
                }
            }
        }
开发者ID:mreu,项目名称:ProtobufLanguageService,代码行数:26,代码来源:QuickInfoController.cs

示例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();
                }
            }
        }
开发者ID:IntranetFactory,项目名称:ndjango,代码行数:36,代码来源:Controller.cs


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