ModelFactory.CreateStaticMemberItem 方法 (EditingContext, TypeIdentifier, String)
建立新的模型項目,這個項目表示指定之類別的靜態成員值。
命名空間: Microsoft.Windows.Design.Model
組件: Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)
語法
'宣告
Public Shared Function CreateStaticMemberItem ( _
context As EditingContext, _
typeIdentifier As TypeIdentifier, _
memberName As String _
) As ModelItem
public static ModelItem CreateStaticMemberItem(
EditingContext context,
TypeIdentifier typeIdentifier,
string memberName
)
public:
static ModelItem^ CreateStaticMemberItem(
EditingContext^ context,
TypeIdentifier typeIdentifier,
String^ memberName
)
static member CreateStaticMemberItem :
context:EditingContext *
typeIdentifier:TypeIdentifier *
memberName:string -> ModelItem
public static function CreateStaticMemberItem(
context : EditingContext,
typeIdentifier : TypeIdentifier,
memberName : String
) : ModelItem
參數
- context
型別:Microsoft.Windows.Design.EditingContext
設計工具的編輯內容。
- typeIdentifier
型別:Microsoft.Windows.Design.Metadata.TypeIdentifier
要參考之型別的識別項。
- memberName
型別:System.String
參考之靜態成員的名稱。
傳回值
型別:Microsoft.Windows.Design.Model.ModelItem
ModelItem ,表示新建立的項目型別。如果無法解析型別識別項,這個方法可能傳回 nullNull 參照 (即 Visual Basic 中的 Nothing)。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | context 或 memberName 是 nullNull 參照 (即 Visual Basic 中的 Nothing)。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.Windows.Design.Model 命名空間