語言

ExpressionsCollectionEditor.EditValue 方法

定義

編輯指定物件的值,並使用指定的服務提供者與上下文。

public:
 override System::Object ^ EditValue(System::ComponentModel::ITypeDescriptorContext ^ context, IServiceProvider ^ provider, System::Object ^ value);
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj -> obj
Public Overrides Function EditValue (context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object

參數

context
ITypeDescriptorContext

一個 ITypeDescriptorContext 可以用來獲取額外上下文資訊(如相關控制項)的物件。

provider
IServiceProvider

一個服務提供者物件,可透過此取得編輯服務。

value
Object

物件被編輯的實例。

傳回

ExpressionBindingCollection包含所選表達式的物件;否則,若未選取任何表達式,則為value物件。

備註

此 EditValue 方法啟動使用者介面以編輯物件 value 。 當你嘗試編輯該編輯器所關聯屬性的值時,設計主機會呼叫該 EditValue 方法。 輸入服務提供者用於取得 EditValue.

設計主機,如 Visual Studio 2005,使用 ExpressionBuilder 和 ExpressionEditor 類別實作,搭配 ExpressionsCollectionEditor 和 ExpressionsCollectionConverter 類別,在設計時設定控制屬性的表達式綁定,並以 ControlPersister 類別持久化執行時表達式。 表達式字串會參考可本地化的資源、應用程式設定、連線字串或自訂表達式類型。 表達式字串在設計時綁定於控制屬性,然後在執行時用來決定屬性的值。

如果使用者取消使用者介面而不修改表達式綁定集合,該 EditValue 方法會回傳輸入 value 參數。

適用於

另請參閱