NamespaceInfo クラス

定義

単一の構成名前空間参照が格納されます。Import ディレクティブと類似しています。 このクラスは継承できません。

public ref class NamespaceInfo sealed : System::Configuration::ConfigurationElement
public sealed class NamespaceInfo : System.Configuration.ConfigurationElement
type NamespaceInfo = class
    inherit ConfigurationElement
Public NotInheritable Class NamespaceInfo
Inherits ConfigurationElement
継承

この例では、 クラスと NamespaceInfo クラスのプロパティに対して宣言的に値を指定する方法をNamespaceCollection示します。

次の構成ファイルの例は、 セクションの値を宣言的に指定する方法を namespaces 示しています。

<system.web>  
  <pages>  
    <namespaces>  
      <add namespace="System" />  
      <add namespace="System.Collections" />  
      <add namespace="System.Collections.Specialized" />  
      <add namespace="System.ComponentModel" />  
      <add namespace="System.Configuration" />  
      <add namespace="System.Web" />  
    </namespaces>  
  </pages>  
</system.web>  

次のコード例では、 クラスの使用方法 NamespaceInfo を示します。 このコード例は、PagesSection クラスのために提供されている大規模な例の一部です。

// Create a new NamespaceInfo object.
System.Web.Configuration.NamespaceInfo namespaceInfo =
    new System.Web.Configuration.NamespaceInfo("System");

// Set the Namespace property.
namespaceInfo.Namespace = "System.Collections";

// Execute the Add Method.
pagesSection.Namespaces.Add(namespaceInfo);
' 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)

注釈

には NamespaceCollection 、 セクション内の NamespaceInfo 要素に対応する add オブジェクトが namespaces 含まれています。 各NamespaceInfoオブジェクトは、構成ファイルのスコープ内のすべてのページとコントロールに適用される (<%@ Import %>) ディレクティブと同じですImportImportディレクティブを使用すると、名前空間を ASP.NET ページにインポートして、そのすべてのクラスをページで使用できるようにします。

コンストラクター

NamespaceInfo(String)

指定した名前空間参照を使用して、NamespaceInfo クラスの新しいインスタンスを初期化します。

プロパティ

CurrentConfiguration

現在の Configuration インスタンスが属している構成階層を表す最上位の ConfigurationElement インスタンスへの参照を取得します。

(継承元 ConfigurationElement)
ElementInformation

ElementInformation オブジェクトのカスタマイズできない情報と機能を格納する ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
ElementProperty

ConfigurationElementProperty オブジェクト自体を表す ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
EvaluationContext

ContextInformation オブジェクトの ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
HasContext

CurrentConfiguration プロパティが null であるかどうかを示す値を取得します。

(継承元 ConfigurationElement)
Item[ConfigurationProperty]

この構成要素のプロパティまたは属性を取得または設定します。

(継承元 ConfigurationElement)
Item[String]

この構成要素のプロパティ、属性、または子要素を取得または設定します。

(継承元 ConfigurationElement)
LockAllAttributesExcept

ロックされている属性のコレクションを取得します。

(継承元 ConfigurationElement)
LockAllElementsExcept

ロックされている要素のコレクションを取得します。

(継承元 ConfigurationElement)
LockAttributes

ロックされている属性のコレクションを取得します。

(継承元 ConfigurationElement)
LockElements

ロックされている要素のコレクションを取得します。

(継承元 ConfigurationElement)
LockItem

要素がロックされているかどうかを示す値を取得または設定します。

(継承元 ConfigurationElement)
Namespace

名前空間参照を取得または設定します。

Properties

プロパティのコレクションを取得します。

(継承元 ConfigurationElement)

メソッド

DeserializeElement(XmlReader, Boolean)

構成ファイルから XML を読み取ります。

(継承元 ConfigurationElement)
Equals(Object)

現在のインスタンスと、渡された NamespaceInfo オブジェクトとを比較します。

GetHashCode()

現在のインスタンスのハッシュ値を返します。

GetTransformedAssemblyString(String)

指定されたアセンブリ名を変換して返します。

(継承元 ConfigurationElement)
GetTransformedTypeString(String)

指定された型名を変換して返します。

(継承元 ConfigurationElement)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
Init()

ConfigurationElement オブジェクトを初期状態に設定します。

(継承元 ConfigurationElement)
InitializeDefault()

ConfigurationElement オブジェクトの既定の値セットを初期化するために使用します。

(継承元 ConfigurationElement)
IsModified()

派生クラスに実装された場合、この構成要素が最後の保存または読み込み以降に変更されたかどうかを示します。

(継承元 ConfigurationElement)
IsReadOnly()

ConfigurationElement オブジェクトが読み取り専用かどうかを示す値を取得します。

(継承元 ConfigurationElement)
ListErrors(IList)

この ConfigurationElement オブジェクトおよびすべてのサブ要素の無効なプロパティのエラーを、渡されたリストに追加します。

(継承元 ConfigurationElement)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnDeserializeUnrecognizedAttribute(String, String)

逆シリカル化中に不明な属性が発生したかどうかを示す値を取得します。

(継承元 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

逆シリカル化中に不明な要素が発生したかどうかを示す値を取得します。

(継承元 ConfigurationElement)
OnRequiredPropertyNotFound(String)

必要なプロパティが見つからないと例外がスローされます。

(継承元 ConfigurationElement)
PostDeserialize()

逆シリアル化後に呼び出されます。

(継承元 ConfigurationElement)
PreSerialize(XmlWriter)

シリアル化前に呼び出されます。

(継承元 ConfigurationElement)
Reset(ConfigurationElement)

ConfigurationElement オブジェクトの内部状態 (ロックやプロパティ コレクションなど) をリセットします。

(継承元 ConfigurationElement)
ResetModified()

IsModified() メソッドの値が派生クラスに実装されたときに、false にリセットします。

(継承元 ConfigurationElement)
SerializeElement(XmlWriter, Boolean)

派生クラスに実装されている場合、この構成要素の内容を構成ファイルに書き込みます。

(継承元 ConfigurationElement)
SerializeToXmlElement(XmlWriter, String)

派生クラスに実装されている場合、この構成要素の外側のタグを構成ファイルに書き込みます。

(継承元 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

プロパティを指定した値に設定します。

(継承元 ConfigurationElement)
SetReadOnly()

IsReadOnly() オブジェクトおよびすべてのサブ要素に ConfigurationElement プロパティを設定します。

(継承元 ConfigurationElement)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

保存しないすべての値を削除するには、ConfigurationElement オブジェクトを変更します。

(継承元 ConfigurationElement)

適用対象

こちらもご覧ください