public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
        {
            var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

            var fullyQualifiedTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
            var typeName = GetNormalizedTypeName(fullyQualifiedTypeName);

            var behaviorElement = GetOrCreateBehavior(_provider,
#if RESHARPER_61
                                                      _manager, _psiModuleManager, _cacheManager,
#endif
                                                      _project,
                                                      _projectEnvoy,
                                                      context,
                                                      behavior.DeclaringType.FullyQualifiedName,
                                                      behavior.Name,
                                                      behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                                      fullyQualifiedTypeName);

            if (!TypeNameCache.ContainsKey(typeName))
            {
                TypeNameCache.Add(typeName, fullyQualifiedTypeName);
            }

            return(behaviorElement);
        }
        public IEnumerable<BehaviorSpecificationElement> CreateBehaviorSpecificationsFromBehavior(
          BehaviorElement behavior,
          IMetadataField behaviorSpecification)
        {
            var typeContainingBehaviorSpecifications = behaviorSpecification.GetFirstGenericArgument();

            foreach (var specification in typeContainingBehaviorSpecifications.GetSpecifications())
            {
                yield return this.CreateBehaviorSpecification(behavior, specification);
            }
        }
Ejemplo n.º 3
0
        public IEnumerable <BehaviorSpecificationElement> CreateBehaviorSpecificationsFromBehavior(
            BehaviorElement behavior,
            IMetadataField behaviorSpecification)
        {
            var typeContainingBehaviorSpecifications = behaviorSpecification.GetFirstGenericArgument();

            foreach (var specification in typeContainingBehaviorSpecifications.GetSpecifications())
            {
                yield return(this.CreateBehaviorSpecification(behavior, specification));
            }
        }
    public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
    {
      IMetadataTypeInfo typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

      return new BehaviorElement(_provider,
                                 context,
                                 _projectEnvoy,
                                 behavior.DeclaringType.FullyQualifiedName,
                                 behavior.Name,
                                 behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored());
    }
Ejemplo n.º 5
0
        public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
        {
            IMetadataTypeInfo typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

            return(new BehaviorElement(_provider,
                                       context,
                                       _project,
                                       behavior.DeclaringType.FullyQualifiedName,
                                       behavior.Name,
                                       behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored()));
        }
        public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
        {
            var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

            var metadataTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
            var fieldType        = new NormalizedTypeName(new ClrTypeName(metadataTypeName));

            var behaviorElement = GetOrCreateBehavior(context,
                                                      _reflectionTypeNameCache.GetClrName(behavior.DeclaringType),
                                                      behavior.Name,
                                                      behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                                      fieldType);

            return(behaviorElement);
        }
        public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
        {
            var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

            var metadataTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
            var fieldType = new NormalizedTypeName(metadataTypeName);

            var behaviorElement = this.GetOrCreateBehavior(context,
                                                      this._reflectionTypeNameCache.GetClrName(behavior.DeclaringType),
                                                      behavior.Name,
                                                      behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                                      fieldType);

            return behaviorElement;
        }
    public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
    {
      var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

      var metadataTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
      var fieldType = new NormalizedTypeName(new ClrTypeName(metadataTypeName));

      var behaviorElement = GetOrCreateBehavior(_provider,
                                                _manager,
                                                _psiModuleManager,
                                                _cacheManager,
                                                _project,
                                                _projectEnvoy,
                                                context,
                                                _reflectionTypeNameCache.GetClrName(behavior.DeclaringType),
                                                behavior.Name,
                                                behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                                fieldType);

      return behaviorElement;
    }
    public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
    {
      var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

      var fullyQualifiedTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
      var typeName = GetNormalizedTypeName(fullyQualifiedTypeName);

      var behaviorElement = new BehaviorElement(_provider,
                                 context,
                                 _projectEnvoy,
                                 behavior.DeclaringType.FullyQualifiedName,
                                 behavior.Name,
                                 behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                 fullyQualifiedTypeName);

      if (!TypeNameCache.ContainsKey(typeName))
      {
        TypeNameCache.Add(typeName, fullyQualifiedTypeName);
      }

      return behaviorElement;
    }
Ejemplo n.º 10
0
    public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
    {
      var typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();

      var fullyQualifiedTypeName = behavior.FirstGenericArgumentClass().FullyQualifiedName();
      var typeName = GetNormalizedTypeName(fullyQualifiedTypeName);

      var behaviorElement = GetOrCreateBehavior(_provider,
#if RESHARPER_61
                                                _manager, _psiModuleManager, _cacheManager, 
#endif
                                                _project,
                                                _projectEnvoy,
                                                context,
#if RESHARPER_61
                                                _reflectionTypeNameCache.GetClrName(behavior.DeclaringType),
#else
                                                new ClrTypeName(behavior.DeclaringType.FullyQualifiedName), // may work incorrect in ReSharper 6.0
#endif
                                                behavior.Name,
                                                behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored(),
                                                fullyQualifiedTypeName);

      if (!TypeNameCache.ContainsKey(typeName))
      {
        TypeNameCache.Add(typeName, fullyQualifiedTypeName);
      }

      return behaviorElement;
    }