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


C# ITypeElement类代码示例

本文整理汇总了C#中ITypeElement的典型用法代码示例。如果您正苦于以下问题:C# ITypeElement类的具体用法?C# ITypeElement怎么用?C# ITypeElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SetConstructorsState

 private void SetConstructorsState(ITypeElement typeElement, UsageState state)
 {
     foreach (IConstructor constructor in typeElement.Constructors)
     {
         collectUsagesStageProcess.SetElementState(constructor, state);
     }
 }
开发者ID:renana,项目名称:AgentMulder,代码行数:7,代码来源:TypeUsageManager.cs

示例2: CreateContext

    public ContextElement CreateContext(ITypeElement type)
    {
      if (_cache.Classes.ContainsKey(type))
      {
        return _cache.Classes[type];
      }

      var context = GetOrCreateContextElement(_provider,
#if RESHARPER_61
                                              _manager,
                                              _psiModuleManager,
                                              _cacheManager,
#endif
                                              _project,
                                              _projectEnvoy,
                                              type.GetClrName().FullName,
                                              _assemblyPath,
                                              type.GetSubjectString(),
                                              type.GetTags(),
                                              type.IsIgnored());

      foreach (var child in context.Children)
      {
        child.State = UnitTestElementState.Pending;
      }

      _cache.Classes.Add(type, context);
      return context;
    }
开发者ID:icewwn,项目名称:machine.specifications,代码行数:29,代码来源:ContextFactory.cs

示例3: BasedOnRegistration

        public BasedOnRegistration(ITreeNode registrationRootElement, ITypeElement basedOnElement, IEnumerable<WithServiceRegistration> withServices)
            : base(registrationRootElement, withServices)
        {
            this.basedOnElement = basedOnElement;

            name = basedOnElement.GetClrName().FullName;
        }
开发者ID:derigel23,项目名称:AgentMulder,代码行数:7,代码来源:BasedOnRegistration.cs

示例4: IsValidReferenceAndQualifier

    private bool IsValidReferenceAndQualifier(LanguageElement activeRerence, out ITypeElement callerType, out Expression qualifier)
    {
      qualifier = null;
      callerType = null;
      if (!(activeRerence is IHasQualifier))
        return false;

      // should be undeclared....
      IElement declaration = activeRerence.GetDeclaration(false);
      if (declaration != null)
        return false;


      qualifier = (activeRerence as IHasQualifier).Qualifier;
      if (qualifier is MethodReferenceExpression)
        qualifier = (qualifier as MethodReferenceExpression).Qualifier;
      if (qualifier == null)
        return false;

      callerType = qualifier.Resolve(ParserServices.SourceTreeResolver) as ITypeElement;
      if (callerType == null)
        return false;

      return true;
    }
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:25,代码来源:PlugIn1.cs

示例5: SearchGenericImplementationsRequest

 public SearchGenericImplementationsRequest(DeclaredElementTypeUsageInfo declaredElement,
                                            ITypeElement originType,
                                            ISearchDomain searchDomain,
                                            IEnumerable<IDeclaredType> originTypeParams)
     : base(declaredElement, originType, searchDomain) {
     _originTypeParams = originTypeParams;
 }
开发者ID:emilol,项目名称:Teapot,代码行数:7,代码来源:SearchGenericImplementationsRequest.cs

示例6: IsSatisfiedBy

        public override bool IsSatisfiedBy(ITypeElement typeElement)
        {
            if (!types.Contains(typeElement))
                return false;

            return basedOn.IsSatisfiedBy(typeElement);
        }
开发者ID:dpvreony-forks,项目名称:AgentMulder,代码行数:7,代码来源:TypesBasedOnRegistration.cs

示例7: ExtendsTheCallerType

        private bool ExtendsTheCallerType(IMethodElement method, ITypeElement callerType, Expression qualifier)
        {
            if (method == null || callerType == null)
                return false;

            if (method.Parameters.Count == 0)
                return false;
            ISourceTreeResolver resolver = ParserServices.SourceTreeResolver;
            ExpressionCollection arguments = new ExpressionCollection();
            arguments.Add(qualifier);
            method = GenericElementActivator.ActivateMemberIfNeeded(resolver, method, arguments, null, ArgumentsHelper.ResolveArgumentTypes(resolver, arguments)) as IMethodElement;

            if (method == null)
                return false;

            IParameterElement extensionParam = method.Parameters[0] as IParameterElement;
            if (extensionParam == null)
                return false;

            ITypeReferenceExpression typeRef = extensionParam.Type;
            if (typeRef == null)
                return false;
            ITypeElement type = typeRef.GetDeclaration() as ITypeElement;
            if (type == null)
                return false;
            IArrayTypeElement arrayType = callerType as IArrayTypeElement;
            //if (arrayType != null)
            //{
            //  return true;
            //}
            //else
            return ArgumentsHelper.HasParamConversion(resolver, extensionParam, callerType, qualifier, TypeConversionMode.ImplicitConversion);
        }
开发者ID:RoryBecker,项目名称:CR_ExtensionMethodsHelper,代码行数:33,代码来源:PlugIn1.cs

示例8: ControlFlowInspector

 public ControlFlowInspector([NotNull] ICSharpFunctionDeclaration functionDeclaration,
     [NotNull] CSharpControlFlowGraf graf, int maxLevel, [NotNull] ITypeElement disposableInterface)
     : base(functionDeclaration, graf)
 {
     _disposableInterface = disposableInterface;
     _maxLevel = maxLevel;
 }
开发者ID:vorkulsky,项目名称:DisposePlugin,代码行数:7,代码来源:ControlFlowInspector.cs

示例9: BasedOnRegistration

        public BasedOnRegistration(ITreeNode registrationRootElement, ITypeElement basedOnElement)
            : base(registrationRootElement)
        {
            this.basedOnElement = basedOnElement;

            name = basedOnElement.GetClrName().FullName;
        }
开发者ID:renana,项目名称:AgentMulder,代码行数:7,代码来源:BasedOnRegistration.cs

示例10: IsElementOfType

 /// <summary>
 /// Is element of type
 /// </summary>
 public bool IsElementOfType(ITypeElement DeclaredTypeElement, string type)
 {
     if (DeclaredTypeElement == null)
         return false;
     if (DeclaredTypeElement.FullName.Replace("`1", "") == type || DeclaredTypeElement.DescendsFrom(type))
         return true;
     return false;
 } // IsElementOfType(DeclaredTypeElement, type)
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:11,代码来源:ConvertToXPOPropertyPlugin.cs

示例11: IsSatisfiedBy

        public override bool IsSatisfiedBy(ITypeElement typeElement)
        {
            if (!typeElement.IsDescendantOf(basedOnElement))
            {
                return false;
            }

            return base.IsSatisfiedBy(typeElement);;
        }
开发者ID:renana,项目名称:AgentMulder,代码行数:9,代码来源:BasedOnRegistration.cs

示例12: IsSatisfiedBy

public override bool IsSatisfiedBy(ITypeElement typeElement)
{
    if (defaultFilter(typeElement))
            {
                return true;
            }

            return false;
}
开发者ID:renana,项目名称:AgentMulder,代码行数:9,代码来源:BasedOnRegistrationBase.cs

示例13: ComponentRegistration

        public ComponentRegistration(ITreeNode registrationElement, ITypeElement serviceType)
            : base(registrationElement)
        {
            this.serviceType = serviceType;

            // for some reason, in tests this throws an exception
            // copying the name to display later in ToString()
            name = GetDisplayName(serviceType);
        }
开发者ID:derigel23,项目名称:AgentMulder,代码行数:9,代码来源:ComponentRegistration.cs

示例14: IsSatisfiedBy

public override bool IsSatisfiedBy(ITypeElement typeElement)
{
    if (!defaultFilter(typeElement))
            {
                return false;
            }

            return withServices.All(registration => registration.IsSatisfiedBy(typeElement));
}
开发者ID:derigel23,项目名称:AgentMulder,代码行数:9,代码来源:BasedOnRegistrationBase.cs

示例15: IsSatisfiedBy

        public override bool IsSatisfiedBy(ITypeElement typeElement)
        {
            var attributesOwner = typeElement as IAttributesOwner;
            if (attributesOwner == null)
            {
                return false;
            }

            return attributesOwner.HasAttributeInstance(attributeType.GetClrName(), true);
        }
开发者ID:renana,项目名称:AgentMulder,代码行数:10,代码来源:HasAttributeRegistration.cs


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