DataConnectionProperties.AddProperty 方法 (String, Type, array<Attribute[])
動態地將新屬性加入至這個資料連接屬性執行個體原本辨識屬性的集合。
命名空間: Microsoft.VisualStudio.Data.Framework
組件: Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)
語法
'宣告
Protected Function AddProperty ( _
name As String, _
type As Type, _
ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
string name,
Type type,
params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
String^ name,
Type^ type,
... array<Attribute^>^ attributes
)
member AddProperty :
name:string *
type:Type *
attributes:Attribute[] -> PropertyDescriptor
protected function AddProperty(
name : String,
type : Type,
... attributes : Attribute[]
) : PropertyDescriptor
參數
name
類型:String屬性名稱。
type
類型:Type屬性的資料型別。
attributes
類型:array<Attribute[]附加的一組屬性的屬性。
傳回值
類型:PropertyDescriptor
新加入之屬性的描述項。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | name 和 type 參數為 nullnull 參考 (即 Visual Basic 中的 Nothing)。 |
ArgumentException | 指定的屬性已經存在。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。