SfcReferenceAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重要
此 API 不符合 CLS 規範。
屬性用於指向單一目標的(軟)參考。
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=true, Inherited=true)]
[System.CLSCompliant(false)]
public class SfcReferenceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=true, Inherited=true)>]
[<System.CLSCompliant(false)>]
type SfcReferenceAttribute = class
inherit Attribute
Public Class SfcReferenceAttribute
Inherits Attribute
- 繼承
-
SfcReferenceAttribute
- 屬性
建構函式
| 名稱 | Description |
|---|---|
| SfcReferenceAttribute(Type, String, String[]) |
參考會以屬性名稱中傳遞的值來解析 |
| SfcReferenceAttribute(Type, String[], String, String[]) |
參考會以屬性名稱中傳遞的值來解析 |
| SfcReferenceAttribute(Type, String[], Type, String, String[]) |
推薦人將透過致電代表來解決 |
| SfcReferenceAttribute(Type, String[]) |
參考將透過建立指定解析器類型的實例,並使用可選的鍵與參數來解析。 |
| SfcReferenceAttribute(Type, Type, String, String[]) |
推薦人將透過致電代表來解決 |
| SfcReferenceAttribute(Type) |
參考將透過建立給定解析器類型的實例來解析。 |
屬性
| 名稱 | Description |
|---|---|
| Arguments |
關於骨灰盒模板的論點。 |
| InstanceResolver |
自訂解析器介面。 |
| Keys |
參與參考的鍵。 |
| Resolver |
自訂解析器方法。 |
| Type |
參考的類型 |
| UrnTemplate |
骨灰盒範本,呈現為 String.Format 字串。 範例為「Server/Login[@Name = '{0}']」。 |
方法
| 名稱 | Description |
|---|---|
| GetUrn(Object) |
回歸骨灰盒的參考。 若屬性未定義路徑表達式,則回傳 null。 |
| Resolve(Object) |
從給定的來源物件中解析單一目標物件。 如果定義了自訂解析器介面,就會使用該介面。 否則如果有自訂的解析器代理輔助器,它就會使用該輔助工具。 在沒有自訂解析器的情況下,它會用參數評估給定的 Urn 路徑表達式範本。 |
| Resolve<T,S>(S) |
解析來自給定來源物件的強型別單一目標物件。 如果定義了自訂解析器介面,就會使用該介面。 否則如果有自訂的解析器代理輔助器,它就會使用該輔助工具。 在沒有自訂解析器的情況下,它會用參數評估給定的 Urn 路徑表達式範本。 |