ResXDataNode.GetValue 方法

定義

擷取這個節點所儲存的物件。Retrieves the object that is stored by this node.

多載

GetValue(ITypeResolutionService)

藉由使用型別解析服務,擷取這個節點所儲存的物件。Retrieves the object that is stored by this node by using the specified type resolution service.

GetValue(AssemblyName[])

藉由搜尋指定的組件,擷取這個節點所儲存的物件。Retrieves the object that is stored by this node by searching the specified assemblies.

GetValue(ITypeResolutionService)

藉由使用型別解析服務,擷取這個節點所儲存的物件。Retrieves the object that is stored by this node by using the specified type resolution service.

public:
 System::Object ^ GetValue(System::ComponentModel::Design::ITypeResolutionService ^ typeResolver);
public object GetValue (System.ComponentModel.Design.ITypeResolutionService typeResolver);
member this.GetValue : System.ComponentModel.Design.ITypeResolutionService -> obj
Public Function GetValue (typeResolver As ITypeResolutionService) As Object

參數

typeResolver
ITypeResolutionService

在尋找型別轉換子時所要使用的型別解析服務。The type resolution service to use when looking for a type converter.

傳回

Object

對應至預存值的物件。The object that corresponds to the stored value.

例外狀況

找不到對應的型別,或適當型別轉換子無法使用。The corresponding type could not be found, or an appropriate type converter is not available.

備註

如果儲存的值目前存在於記憶體中,就會直接傳回。If the stored value currently exists in memory, it is returned directly. 如果儲存在資源檔中,而不是檔案參考,則會 GetValue TypeConverter 使用可從字串轉換成適當物件的指定類型解析服務,尋找。If it is stored in the resource file and it is not a file reference, GetValue looks for a TypeConverter by using the specified type resolution service that can convert from a string to the appropriate object. 如果資源是檔案參考,則會 GetValue 嘗試將它還原序列化。If the resource is a file reference, GetValue tries to de-serialize it.

適用於

GetValue(AssemblyName[])

藉由搜尋指定的組件,擷取這個節點所儲存的物件。Retrieves the object that is stored by this node by searching the specified assemblies.

public:
 System::Object ^ GetValue(cli::array <System::Reflection::AssemblyName ^> ^ names);
public object GetValue (System.Reflection.AssemblyName[] names);
member this.GetValue : System.Reflection.AssemblyName[] -> obj
Public Function GetValue (names As AssemblyName()) As Object

參數

names
AssemblyName[]

要搜尋物件類型的組件清單。The list of assemblies to search for the type of the object.

傳回

Object

對應至預存值的物件。The object that corresponds to the stored value.

例外狀況

找不到對應的型別,或適當型別轉換子無法使用。The corresponding type could not be found, or an appropriate type converter is not available.

備註

如果儲存的值目前存在於記憶體中,就會直接傳回。If the stored value currently exists in memory, it is returned directly. 如果它儲存在資源檔中,而不是檔案參考,則會 GetValue 查看以名稱識別的元件來尋找物件的對應類型,然後尋找 TypeConverter 可從字串轉換成適當物件的。If it is stored in the resource file and it is not a file reference, GetValue looks in the assemblies identified by names to find the object's corresponding type, and then looks for a TypeConverter that can convert from a string to the appropriate object. 如果資源是檔案參考,則會 GetValue 嘗試將它還原序列化。If the resource is a file reference, GetValue tries to deserialize it.

適用於