當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。