本文整理匯總了VB.NET中System.Web.Configuration.NamespaceCollection類的典型用法代碼示例。如果您正苦於以下問題:VB.NET NamespaceCollection類的具體用法?VB.NET NamespaceCollection怎麽用?VB.NET NamespaceCollection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了NamespaceCollection類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1:
' Get the AutoImportVBNamespace property.
Console.WriteLine( _
"AutoImportVBNamespace: '{0}'", _
pagesSection.Namespaces.AutoImportVBNamespace)
' Set the AutoImportVBNamespace property.
pagesSection.Namespaces.AutoImportVBNamespace = True
' Get all current Namespaces in the collection.
Dim i As Int16
For i = 0 To pagesSection.Namespaces.Count - 1
Console.WriteLine( _
"Namespaces {0}: '{1}'", i, _
pagesSection.Namespaces(i).Namespace)
Next
' Create a new NamespaceInfo object.
Dim namespaceInfo As System.Web.Configuration.NamespaceInfo = _
New System.Web.Configuration.NamespaceInfo("System")
' Set the Namespace property.
namespaceInfo.Namespace = "System.Collections"
' Execute the Add Method.
pagesSection.Namespaces.Add(namespaceInfo)
' Add a NamespaceInfo object using a constructor.
pagesSection.Namespaces.Add( _
New System.Web.Configuration.NamespaceInfo( _
"System.Collections.Specialized"))
' Execute the RemoveAt method.
pagesSection.Namespaces.RemoveAt(0)
' Execute the Clear method.
pagesSection.Namespaces.Clear()
' Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections")
' Get the current AutoImportVBNamespace property value.
Console.WriteLine( _
"Current AutoImportVBNamespace value: '{0}'", _
pagesSection.Namespaces.AutoImportVBNamespace)
' Set the AutoImportVBNamespace property to false.
pagesSection.Namespaces.AutoImportVBNamespace = False