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


C# ITreeNode.GetPsiModule方法代码示例

本文整理汇总了C#中ITreeNode.GetPsiModule方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeNode.GetPsiModule方法的具体用法?C# ITreeNode.GetPsiModule怎么用?C# ITreeNode.GetPsiModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITreeNode的用法示例。


在下文中一共展示了ITreeNode.GetPsiModule方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBasedOnRegistrations

        public override IEnumerable<FilteredRegistrationBase> GetBasedOnRegistrations(ITreeNode registrationRootElement)
        {
            IStructuralMatchResult match = Match(registrationRootElement);

            if (match.Matched)
            {
                ITypeElement objectTypeElement = registrationRootElement.GetPsiModule()
                                                                        .GetPredefinedType()
                                                                        .Object.GetTypeElement();

                if (objectTypeElement != null)
                {
                    yield return registrationCreator.Create(registrationRootElement, objectTypeElement);
                }
            }
        }
开发者ID:hmemcpy,项目名称:AgentMulder,代码行数:16,代码来源:Pick.cs

示例2: CreatePsiRuleTarget

    public CreatePsiRuleTarget(PsiRuleReference reference)
    {
      myReference = reference;
      myElement = reference.GetTreeNode();
      string name = reference.GetName();

      var node = myElement.NextSibling;
      while (node != null)
      {
        if (!node.IsWhitespaceToken())
        {
          if (!(node is IRuleParameters))
          {
            break;
          }
          var child = node.FirstChild;
          while (child != null)
          {
            if (!child.IsWhitespaceToken())
            {
              if (child is IRuleBraceParameters)
              {
                myHasBraceParameters = true;
              }
              if (child is IRuleBracketParameters)
              {
                CollectVariableParameters(child as IRuleBracketParameters);
              }
            }
            child = child.NextSibling;
          }
          break;
        }
        node = node.NextSibling;
      }


      myDeclaration = PsiElementFactory.GetInstance(myElement.GetPsiModule()).CreateRuleDeclaration(name, myHasBraceParameters, myVariableParameters);

      Anchor = myElement.GetContainingNode<IRuleDeclaration>();
    }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:41,代码来源:CreatePsiRuleTarget.cs

示例3: ProcessBeforeInterior

        public void ProcessBeforeInterior(ITreeNode element)
        {
            var functionDeclaration = element as ICSharpFunctionDeclaration;
            if (functionDeclaration == null)
                return;
            var psiModule = element.GetPsiModule();
            var sourceFile = element.GetSourceFile();
            if (sourceFile == null)
                return;
            var resolveContext = sourceFile.ResolveContext;
            var disposableInterface = DisposeUtil.GetDisposableInterface(psiModule, resolveContext);
            if (disposableInterface == null)
                return;
            var graf = CSharpControlFlowBuilder.Build(functionDeclaration) as CSharpControlFlowGraf;
            if (graf == null)
                return;

            var name = functionDeclaration.DeclaredName;
            var offset = InvokedExpressionData.GetOffsetByNode(functionDeclaration);

            var grafInspector = new ControlFlowInspector(functionDeclaration, graf, disposableInterface);
            var methodArguments = grafInspector.GetMethodArgumentStatuses();
            _statuses.Add(new DisposeMethodStatus(name, offset, methodArguments, sourceFile));
        }
开发者ID:vorkulsky,项目名称:DisposePlugin,代码行数:24,代码来源:DisposeCacheBuilder.cs

示例4: IsNinjectBindCall

        private bool IsNinjectBindCall(ITreeNode element)
        {
            var invocationExpression = element as IInvocationExpression;
            if (invocationExpression == null)
            {
                return false;
            }

            var resolve = invocationExpression.InvocationExpressionReference.Resolve().Result;
            var method = resolve.DeclaredElement as IMethod;
            if (method == null)
            {
                return false;
            }
            ITypeElement containingType = method.GetContainingType();
            if (containingType == null)
            {
                return false;
            }

            if (bindingRootType == null)
            {
                bindingRootType = TypeFactory.CreateTypeByCLRName("Ninject.Syntax.IBindingRoot", element.GetPsiModule());
            }

            return containingType.IsDescendantOf(bindingRootType.GetTypeElement());
        }
开发者ID:hotgazpacho,项目名称:AgentMulder,代码行数:27,代码来源:BindBasePattern.cs

示例5: CreateDocCommentBlockNode

        /// <summary>
        /// Creates a DocCommentBlockNode with the text provided.
        /// </summary>
        /// <param name="element">
        /// The element to create for.
        /// </param>
        /// <param name="text">
        /// The text to use to create the doc.
        /// </param>
        /// <returns>
        /// An IDocCommentBlockNode that has been created.
        /// </returns>
        public static IDocCommentBlockNode CreateDocCommentBlockNode(ITreeNode element, string text)
        {
            // Fix up the xml terminators to remove the extra space.
            text = text.Replace(" />", "/>");

            StringBuilder builder = new StringBuilder();
            foreach (string line in text.Split('\n'))
            {
                string outputLine = line;
                if (line.StartsWith(" "))
                {
                    outputLine = line.Substring(1);
                }

                builder.Append("/// " + outputLine + Environment.NewLine);
            }

            builder.Append("void fec();");
            IDocCommentBlockOwnerNode declaration =
                (IDocCommentBlockOwnerNode)CSharpElementFactory.GetInstance(element.GetPsiModule()).CreateTypeMemberDeclaration(builder.ToString());

            return declaration.GetDocCommentBlockNode();
        }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:35,代码来源:Utils.cs

示例6: CreateTypeByClrName

 public static IDeclaredType CreateTypeByClrName(ITreeNode node, string containerClrTypeName)
 {
     return TypeFactory.CreateTypeByCLRName(containerClrTypeName, node.GetPsiModule());
 }
开发者ID:hmemcpy,项目名称:AgentMulder,代码行数:4,代码来源:ContainerExtensions.cs


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