Exemplo n.º 1
0
        public AttributeInfo getAttributeInfo()
        {
            List <String> list       = indexTypes == null ? null : indexTypes;
            bool          collection = type is ContainerType;
            TypeFamily    family     = collection ? ((ContainerType)type).GetItemType().GetFamily() : type.GetFamily();

            return(new AttributeInfo(GetName(), family, collection, list));
        }
Exemplo n.º 2
0
 public AttributeInfo(AttributeInfo info)
 {
     this.name       = info.getName();
     this.family     = info.getFamily();
     this.collection = info.isCollection();
     this.key        = info.isKey();
     this.value      = info.isValue();
     this.words      = info.isWords();
 }
Exemplo n.º 3
0
 public AttributeInfo(String name, TypeFamily family, bool collection, bool key, bool value, bool words)
 {
     this.name       = name;
     this.family     = family;
     this.collection = collection;
     this.key        = key;
     this.value      = value;
     this.words      = words;
 }
Exemplo n.º 4
0
 public AttributeInfo(String name, TypeFamily family, bool collection, ICollection <String> indexTypes)
 {
     this.name       = name;
     this.family     = family;
     this.collection = collection;
     if (indexTypes != null)
     {
         key   = indexTypes.Contains(KEY);
         value = indexTypes.Contains(VALUE);
         words = indexTypes.Contains(WORDS);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Determines whether a MemberInfo of the given type should be included in the options.
        /// </summary>
        protected virtual bool ValidateMemberType(Type type)
        {
            bool validFamily = false;
            bool validType;

            // Allow type families based on the filter attribute

            TypeFamily families = filter.TypeFamilies;

            if (families.HasFlag(TypeFamily.Array))
            {
                validFamily |= type.IsArray;
            }
            if (families.HasFlag(TypeFamily.Class))
            {
                validFamily |= type.IsClass;
            }
            if (families.HasFlag(TypeFamily.Enum))
            {
                validFamily |= type.IsEnum;
            }
            if (families.HasFlag(TypeFamily.Interface))
            {
                validFamily |= type.IsInterface;
            }
            if (families.HasFlag(TypeFamily.Primitive))
            {
                validFamily |= type.IsPrimitive;
            }
            if (families.HasFlag(TypeFamily.Reference))
            {
                validFamily |= !type.IsValueType;
            }
            if (families.HasFlag(TypeFamily.Value))
            {
                validFamily |= (type.IsValueType && type != typeof(void));
            }
            if (families.HasFlag(TypeFamily.Void))
            {
                validFamily |= type == typeof(void);
            }

            // Allow types based on the filter attribute
            // If no filter types are specified, all types are allowed.

            if (filter.Types.Count > 0)
            {
                validType = false;

                foreach (Type allowedType in filter.Types)
                {
                    if (allowedType.IsAssignableFrom(type))
                    {
                        validType = true;
                        break;
                    }
                }
            }
            else
            {
                validType = true;
            }

            return(validFamily && validType);
        }
Exemplo n.º 6
0
 protected ContainerType(TypeFamily family, IType itemType, String typeName)
     : base(family, itemType, typeName)
 {
 }
Exemplo n.º 7
0
 public NativeType(TypeFamily family)
     : base(family)
 {
 }
Exemplo n.º 8
0
 protected BaseType(TypeFamily family)
 {
     this.family = family;
 }
Exemplo n.º 9
0
 protected IterableType(TypeFamily family, IType itemType, String typeName)
     : base(family)
 {
     this.itemType = itemType;
     this.typeName = typeName;
 }
Exemplo n.º 10
0
 protected BinaryType(TypeFamily family)
     : base(family)
 {
 }
Exemplo n.º 11
0
 public CategoryType(TypeFamily family, String typeName)
     : base(family)
 {
     this.typeName = typeName;
 }