DataSourceProvider DataSourceProvider DataSourceProvider DataSourceProvider Class

定義

常用的基底類別和 DataSourceProvider 物件協定,是執行幾項查詢以產生單一物件或物件清單 (可當作繫結來源物件使用) 的因素。Common base class and contract for DataSourceProvider objects, which are factories that execute some queries to produce a single object or a list of objects that you can use as binding source objects.

public ref class DataSourceProvider abstract : System::ComponentModel::INotifyPropertyChanged, System::ComponentModel::ISupportInitialize
public abstract class DataSourceProvider : System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.ISupportInitialize
type DataSourceProvider = class
    interface INotifyPropertyChanged
    interface ISupportInitialize
Public MustInherit Class DataSourceProvider
Implements INotifyPropertyChanged, ISupportInitialize
繼承
DataSourceProviderDataSourceProviderDataSourceProviderDataSourceProvider
衍生
實作

備註

DataSourceProvider是現有資料模型的便利包裝函式,它不會取代任何資料模型。DataSourceProvider is a convenience wrapper around an existing data model; it does not replace any data model. 資料提供者不會嘗試將資料模型的複雜性和多樣化部分(例如 ADO)壓縮成一個具有少數屬性的單一物件。A data provider does not attempt to condense the complexity and versatility of a data model such as ADO into one single object with a few properties.

DataSourceProvider這是抽象類別。DataSourceProvider is an abstract class. 使用其中一個衍生的類別,也就XmlDataProviderObjectDataProvider和。Use one of the derived classes, which are XmlDataProvider and ObjectDataProvider. DataSourceProvider會感知Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)執行緒和發送器模型。The DataSourceProvider is aware of the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) threading and dispatcher model. 它會假設建立時的執行緒是UIUI執行緒。It assumes the thread at creation time to be the UIUI thread. 系統會從背景工作執行緒將事件封送處理至應用程式的 UI 執行緒。Events will get marshaled from a worker thread to the UI thread of the application.

建構函式

DataSourceProvider() DataSourceProvider() DataSourceProvider() DataSourceProvider()

初始化 DataSourceProvider 類別的新執行個體。Initializes a new instance of the DataSourceProvider class. 這是受保護的建構函式。This is a protected constructor.

屬性

Data Data Data Data

取得基礎資料物件。Gets the underlying data object.

Dispatcher Dispatcher Dispatcher Dispatcher

取得或設定要使用之 UIUI 執行緒目前的 Dispatcher 物件。Gets or sets the current Dispatcher object to the UIUI thread to use.

Error Error Error Error

取得上次查詢作業的錯誤。Gets the error of the last query operation.

IsInitialLoadEnabled IsInitialLoadEnabled IsInitialLoadEnabled IsInitialLoadEnabled

取得或設定值,這個值表示是否要防止或延遲自動資料載入。Gets or sets a value that indicates whether to prevent or delay the automatic loading of data.

IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred

取得值,指出是否仍然有未處理的 DeferRefresh() 在使用中。Gets a value that indicates whether there is an outstanding DeferRefresh() in use.

方法

BeginInit() BeginInit() BeginInit() BeginInit()

表示這個物件即將開始初始化;直到呼叫對應的 Refresh() 方法,才會發生隱含的 EndInit()Indicates that initialization of this object is about to begin; no implicit Refresh() occurs until the matched EndInit() method is called.

BeginQuery() BeginQuery() BeginQuery() BeginQuery()

在衍生類別中覆寫時,這個基底類別會在已呼叫 InitialLoad()Refresh() 之後呼叫這個方法。When overridden in a derived class, this base class calls this method when InitialLoad() or Refresh() has been called. 如果延後重新整理或停用初始載入,基底類別就會延遲呼叫。The base class delays the call if refresh is deferred or initial load is disabled.

DeferRefresh() DeferRefresh() DeferRefresh() DeferRefresh()

進入延後循環,您可以用來變更提供者屬性,並且延遲自動重新整理。Enters a defer cycle that you can use to change properties of the provider and delay automatic refresh.

EndInit() EndInit() EndInit() EndInit()

指出這個物件的初始化已經完成,如果沒有任何其他未處理的 Refresh(),這就會導致 DeferRefresh()Indicates that the initialization of this object has completed; this causes a Refresh() if no other DeferRefresh() is outstanding.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InitialLoad() InitialLoad() InitialLoad() InitialLoad()

啟動基礎資料模型的初始查詢。Starts the initial query to the underlying data model. 結果會針對 Data 屬性傳回。The result is returned on the Data property.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs)

使用提供的引數,引發 PropertyChanged 事件。Raises the PropertyChanged event with the provided arguments.

OnQueryFinished(Object) OnQueryFinished(Object) OnQueryFinished(Object) OnQueryFinished(Object)

衍生類別會呼叫這個方法來指出查詢已經完成。Derived classes call this method to indicate that a query has finished.

OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object)

衍生類別會呼叫這個方法來指出查詢已經完成。Derived classes call this method to indicate that a query has finished.

Refresh() Refresh() Refresh() Refresh()

啟始基礎資料模型的重新整理作業。Initiates a refresh operation to the underlying data model. 結果會針對 Data 屬性傳回。The result is returned on the Data property.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

事件

DataChanged DataChanged DataChanged DataChanged

Data 屬性有新值時發生。Occurs when the Data property has a new value.

PropertyChanged PropertyChanged PropertyChanged PropertyChanged

當屬性值變更時發生。Occurs when a property value changes.

明確介面實作

INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged

當屬性值變更時發生。Occurs when a property value changes.

ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit()

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit()

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

適用於