XmlnsDictionary XmlnsDictionary XmlnsDictionary XmlnsDictionary Class

定義

表示包含 WPF 中 XAML 命名空間之 xmlns 對應的字典。Represents a dictionary that contains xmlns mappings for XAML namespaces in WPF.

public ref class XmlnsDictionary : System::Collections::IDictionary, System::Xaml::IXamlNamespaceResolver
public class XmlnsDictionary : System.Collections.IDictionary, System.Xaml.IXamlNamespaceResolver
type XmlnsDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
    interface IXamlNamespaceResolver
Public Class XmlnsDictionary
Implements IDictionary, IXamlNamespaceResolver
繼承
XmlnsDictionaryXmlnsDictionaryXmlnsDictionaryXmlnsDictionary
實作

備註

XmlnsDictionary將 XAML 命名空間前置詞對應至完整的 XAML 命名空間 URI。XmlnsDictionary maps XAML namespace prefixes to the complete XAML namespace URI. 對於一般應用程式和 XAML 命名空間中的 XAML 用法,URI 通常不是包含http://的架構樣式 URI。For XAML usage in applications and XAML namespaces in general, the URI is often not a schema-style URI that includes http://. 它會改為使用者定義的 CLR 命名空間和元件對應。It is instead a user-defined mapping to a CLR namespace and assembly. 該元件包含所參考的支援類型。That assembly contains the backing types being referred to. 如需詳細資訊,請參閱WPF xaml 的 Xaml 命名空間和命名空間對應For details, see XAML Namespaces and Namespace Mapping for WPF XAML.

會為 XAML 命名空間加入範圍的概念。XmlnsDictionaryThe XmlnsDictionary adds the concept of scope for a XAML namespace. 預設值IDictionary可能包含首碼索引鍵和 XML 命名空間 URI 值。A default IDictionary might contain prefix keys and XML namespace URI values. XmlnsDictionary的範圍概念會與 XML 概念平行,可能會重新定義前置詞。The scope concept in XmlnsDictionary parallels the XML concept that a prefix might be redefined. 若是如此,則重新定義僅適用于該層級,或在 XML 的 DOM 視圖中(先前的定義適用于 DOM 中較高的層級)。If so, the redefinition only applies at that level or below in a DOM view of the XML (the previous definition applies at higher level in the DOM). 範圍概念大多會在XmlnsDictionary API 中抽象化,讓您可以呼叫 api (例如) LookupNamespace ,而不會擔心範圍。The scope concept is mostly abstracted away in the XmlnsDictionary API, such that you can call APIs such as LookupNamespace without being concerned about scope. 不過, XmlnsDictionary會公開PushScopePopScope因此變更範圍的ParserContext自訂XmlnsDictionary執行可以與的範圍同步處理。However, XmlnsDictionary does expose PushScope and PopScope so that a custom ParserContext implementation that changes scope can synchronize with the scope for the XmlnsDictionary.

建構函式

XmlnsDictionary() XmlnsDictionary() XmlnsDictionary() XmlnsDictionary()

初始化 XmlnsDictionary 類別的新執行個體。Initializes a new instance of the XmlnsDictionary class.

XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary)

使用指定的字典做為複製來源,初始化 XmlnsDictionary 類別的新執行個體。Initializes a new instance of the XmlnsDictionary class by using the specified dictionary as a copy source.

屬性

Count Count Count Count

取得 XmlnsDictionary 中的項目數。Gets the number of items in the XmlnsDictionary.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

取得值,這個值表示 XmlnsDictionary 的大小是否是固定的。Gets a value that indicates whether the size of the XmlnsDictionary is fixed.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,這個值表示 XmlnsDictionary 是否為唯讀。Gets a value that indicates whether the XmlnsDictionary is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

取得值,這個值表示對該 XmlnsDictionary 的存取是否為安全執行緒。Gets a value that indicates whether access to this XmlnsDictionary is thread safe.

Item[Object] Item[Object] Item[Object] Item[Object]

取得或設定與指定的前置字元關聯的 XAML 命名空間 URI。Gets or sets the XAML namespace URI associated with the specified prefix.

Item[String] Item[String] Item[String] Item[String]

取得或設定與指定的前置字元關聯的 XAML 命名空間 URI。Gets or sets the XAML namespace URI associated with the specified prefix.

Keys Keys Keys Keys

取得 XmlnsDictionary 中所有索引鍵的集合。Gets a collection of all the keys in the XmlnsDictionary.

Sealed Sealed Sealed Sealed

取得值,這個值表示 XmlnsDictionary 是否是密封的。Gets a value that indicates whether the XmlnsDictionary is sealed.

SyncRoot SyncRoot SyncRoot SyncRoot

取得可用以同步存取 XmlnsDictionary 的物件。Gets an object that can be used to synchronize access to the XmlnsDictionary.

Values Values Values Values

取得 XmlnsDictionary 中所有值的集合。Gets a collection of all the values in the XmlnsDictionary.

方法

Add(Object, Object) Add(Object, Object) Add(Object, Object) Add(Object, Object)

將前置 URI 組加入至這個 XmlnsDictionaryAdds a prefix-URI pair to this XmlnsDictionary.

Add(String, String) Add(String, String) Add(String, String) Add(String, String)

將前置 URI 組加入至這個 XmlnsDictionaryAdds a prefix-URI pair to this XmlnsDictionary.

Clear() Clear() Clear() Clear()

從此 XmlnsDictionary 移除所有項目。Removes all entries from this XmlnsDictionary.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

傳回值,這個值指出所指定的前置索引鍵是否在這個 XmlnsDictionary 中。Returns a value that indicates whether the specified prefix key is in this XmlnsDictionary.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

XmlnsDictionary 中的項目複製至指定的陣列。Copies the entries in the XmlnsDictionary to the specified array.

CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32)

XmlnsDictionary 中的項目複製至指定的 DictionaryEntry 陣列中。Copies the entries in the XmlnsDictionary to the specified DictionaryEntry array.

DefaultNamespace() DefaultNamespace() DefaultNamespace() DefaultNamespace()

查詢與預設 XAML 命名空間相對應的 XAML 命名空間。Looks up the XAML namespace that corresponds to the default XAML namespace.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetDictionaryEnumerator() GetDictionaryEnumerator() GetDictionaryEnumerator() GetDictionaryEnumerator()

傳回可對這個 XmlnsDictionary 逐一查看的字典列舉值。Returns a dictionary enumerator that iterates through this XmlnsDictionary.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回可對這個 XmlnsDictionary 逐一查看的列舉程式。Returns an enumerator that iterates through this XmlnsDictionary.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetNamespace(String) GetNamespace(String) GetNamespace(String) GetNamespace(String)

針對提供的前置字串來擷取 XAML 命名空間。Retrieves a XAML namespace for the provided prefix string.

GetNamespacePrefixes() GetNamespacePrefixes() GetNamespacePrefixes() GetNamespacePrefixes()

傳回作用中結構描述內容中提供之所有可能的前置詞-XAML 命名空間對應 (NamespaceDeclaration 值)。Returns all possible prefix-XAML namespace mappings (NamespaceDeclaration values) that are available in the active schema context.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
LookupNamespace(String) LookupNamespace(String) LookupNamespace(String) LookupNamespace(String)

傳回對應至指定的 XAML 命名空間前置詞的 XML 命名空間 URI。Returns the XAML namespace URI that corresponds to the specified XML namespace prefix.

LookupPrefix(String) LookupPrefix(String) LookupPrefix(String) LookupPrefix(String)

傳回對應至指定的 XAML 命名空間 URI 的前置詞。Returns the prefix that corresponds to the specified XAML namespace URI.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
PopScope() PopScope() PopScope() PopScope()

快顯 XmlnsDictionary 的範圍。Pops the scope of the XmlnsDictionary.

PushScope() PushScope() PushScope() PushScope()

推入 XmlnsDictionary 的範圍。Pushes the scope of the XmlnsDictionary.

Remove(Object) Remove(Object) Remove(Object) Remove(Object)

XmlnsDictionary 中移除具有指定的前置索引鍵的項目。Removes the item with the specified prefix key from the XmlnsDictionary.

Remove(String) Remove(String) Remove(String) Remove(String)

XmlnsDictionary 中移除具有指定的前置索引鍵的項目。Removes the item with the specified prefix key from the XmlnsDictionary.

Seal() Seal() Seal() Seal()

鎖定字典,以便無法對其進行變更。Locks the dictionary so that it cannot be changed.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator()

如需這個成員的說明,請參閱 GetEnumerator()For a description of this member, see GetEnumerator().

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

如需這個成員的說明,請參閱 GetEnumerator()For a description of this member, see GetEnumerator().

擴充方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱