為指定的類型和成員名稱建立資源索引鍵。
命名空間: Microsoft.Windows.Design.Interaction
組件: Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)
語法
'宣告
Public Shared Function CreateResourceKey ( _
owningType As Type, _
publicMember As String _
) As ResourceKey
public static ResourceKey CreateResourceKey(
Type owningType,
string publicMember
)
public:
static ResourceKey^ CreateResourceKey(
Type^ owningType,
String^ publicMember
)
static member CreateResourceKey :
owningType:Type *
publicMember:string -> ResourceKey
public static function CreateResourceKey(
owningType : Type,
publicMember : String
) : ResourceKey
參數
- owningType
型別:System.Type
擁有這個資源的類型。
- publicMember
型別:System.String
公開 (Expose) 此資源之公用靜態成員的名稱。
傳回值
型別:System.Windows.ResourceKey
新的資源索引鍵。
例外狀況
| 例外狀況 | 條件 |
|---|---|
| ArgumentNullException | owningType 或 publicMember 是 nullNull 參照 (即 Visual Basic 中的 Nothing)。 |
備註
建立資源索引鍵之後,請呼叫 RegisterResources 方法來註冊可以依該索引鍵提供資源的資源回呼 (Callback)。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間