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


C# TypeNode.GetNamespace方法代码示例

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


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

示例1: IsRequiredType

        //=====================================================================

        /// <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;
        }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:26,代码来源:NamespaceFilter.cs

示例2: HasExposedMembers

        /// <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;
        }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:18,代码来源:NamespaceFilter.cs

示例3: WriteTypeContainers

        /// <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();
        }
开发者ID:armin-bauer,项目名称:SHFB,代码行数:19,代码来源:MRefWriter.cs

示例4: IsExposedType

        /// <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;
        }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:37,代码来源:NamespaceFilter.cs

示例5: WriteMemberContainers

        /// <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();
        }
开发者ID:armin-bauer,项目名称:SHFB,代码行数:14,代码来源:MRefWriter.cs


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