Beispiel #1
0
        //=====================================================================

        /// <summary>
        /// Check to see if the type is required or not by this entry
        /// </summary>
        /// <param name="type">The type to check</param>
        /// <returns>Null if the type is not within the namespace of this entry, true if it is and it is required
        /// or false if it is and it is not required.</returns>
        public bool? IsRequiredType(TypeNode type)
        {
            if(this.IsExposedNamespace(type.GetNamespace()) != null)
            {
                foreach(TypeFilter typeFilter in typeFilters)
                {
                    bool? result = typeFilter.IsRequiredType(type);

                    if(result != null)
                        return result;
                }

                // No filters match so it's not required
                return false;
            }

            return null;
        }
Beispiel #2
0
        /// <summary>
        /// This is used to find out if the given type is in this namespace and has any exposed members
        /// </summary>
        /// <param name="type">The type to check</param>
        /// <returns>True if the type is in this namespace and has exposed members, false if not</returns>
        public bool HasExposedMembers(TypeNode type)
        {
            if(this.IsExposedNamespace(type.GetNamespace()) != null)
                foreach(TypeFilter typeFilter in typeFilters)
                {
                    bool? result = typeFilter.IsExposedType(type);

                    if(result != null)
                        return typeFilter.HasExposedMembers(type);
                }

            return false;
        }
Beispiel #3
0
        /// <summary>
        /// Write out type containers
        /// </summary>
        /// <param name="type">The type for which to write out containers</param>
        private void WriteTypeContainers(TypeNode type)
        {
            writer.WriteStartElement("containers");

            this.WriteLibraryReference(type.DeclaringModule);
            this.WriteNamespaceReference(type.GetNamespace());

            // For nested types, record outer types
            TypeNode outer = type.DeclaringType;

            if(outer != null)
                this.WriteTypeReference(outer);

            writer.WriteEndElement();
        }
Beispiel #4
0
        /// <summary>
        /// Check to see if the type is exposed or not by this entry
        /// </summary>
        /// <param name="type">The type to check</param>
        /// <returns>Null if the type is not within the namespace of this entry, true if it is and it is exposed
        /// or false if it is and it is not exposed.</returns>
        public bool? IsExposedType(TypeNode type)
        {
            if(this.IsExposedNamespace(type.GetNamespace()) != null)
            {
                foreach(TypeFilter typeFilter in typeFilters)
                {
                    bool? result = typeFilter.IsExposedType(type);

                    if(result != null)
                        return result;
                }

                // No filter matches for this type, check the parents since it could be nested
                TypeNode parent = type.DeclaringType;

                while(parent != null)
                {
                    bool? parentExposed = this.IsExposedType(parent);

                    if(parentExposed != null)
                        return parentExposed;

                    parent = type.DeclaringType;
                }

                // No filters match for the parents either, use the namespace setting
                return exposed;
            }

            return null;
        }
Beispiel #5
0
        /// <summary>
        /// Write out member containers
        /// </summary>
        /// <param name="type">The declaring type of the member</param>
        private void WriteMemberContainers(TypeNode type)
        {
            writer.WriteStartElement("containers");

            this.WriteLibraryReference(type.DeclaringModule);
            this.WriteNamespaceReference(type.GetNamespace());
            this.WriteTypeReference(type);

            writer.WriteEndElement();
        }