InitializeReplicaMetadata 方法
在衍生類別中覆寫時,會針對複寫建立、初始化及儲存新的中繼資料。
命名空間: Microsoft.Synchronization.MetadataStorage
組件: Microsoft.Synchronization.MetadataStorage (在 Microsoft.Synchronization.MetadataStorage.dll 中)
語法
'宣告
Public MustOverride Function InitializeReplicaMetadata ( _
idFormats As SyncIdFormatGroup, _
replicaId As SyncId, _
customItemFieldSchemas As IEnumerable(Of FieldSchema), _
customIndexedFieldSchemas As IEnumerable(Of IndexSchema) _
) As ReplicaMetadata
'用途
Dim instance As MetadataStore
Dim idFormats As SyncIdFormatGroup
Dim replicaId As SyncId
Dim customItemFieldSchemas As IEnumerable(Of FieldSchema)
Dim customIndexedFieldSchemas As IEnumerable(Of IndexSchema)
Dim returnValue As ReplicaMetadata
returnValue = instance.InitializeReplicaMetadata(idFormats, _
replicaId, customItemFieldSchemas, _
customIndexedFieldSchemas)
public abstract ReplicaMetadata InitializeReplicaMetadata(
SyncIdFormatGroup idFormats,
SyncId replicaId,
IEnumerable<FieldSchema> customItemFieldSchemas,
IEnumerable<IndexSchema> customIndexedFieldSchemas
)
public:
virtual ReplicaMetadata^ InitializeReplicaMetadata(
SyncIdFormatGroup^ idFormats,
SyncId^ replicaId,
IEnumerable<FieldSchema^>^ customItemFieldSchemas,
IEnumerable<IndexSchema^>^ customIndexedFieldSchemas
) abstract
abstract InitializeReplicaMetadata :
idFormats:SyncIdFormatGroup *
replicaId:SyncId *
customItemFieldSchemas:IEnumerable<FieldSchema> *
customIndexedFieldSchemas:IEnumerable<IndexSchema> -> ReplicaMetadata
public abstract function InitializeReplicaMetadata(
idFormats : SyncIdFormatGroup,
replicaId : SyncId,
customItemFieldSchemas : IEnumerable<FieldSchema>,
customIndexedFieldSchemas : IEnumerable<IndexSchema>
) : ReplicaMetadata
參數
- idFormats
型別:Microsoft.Synchronization. . :: . .SyncIdFormatGroup
提供者的識別碼格式結構描述。
- replicaId
型別:Microsoft.Synchronization. . :: . .SyncId
複寫的複寫識別碼,由正在建立和初始化的中繼資料代表。
- customItemFieldSchemas
型別:System.Collections.Generic. . :: . .IEnumerable< (Of < ( <'FieldSchema> ) > ) >
結構描述資訊,用來描述與中繼資料項目有關的自訂中繼資料欄位。如果沒有任何自訂中繼資料欄位存在,可以為 nullNothingnullptrunitnull 參考 (在 Visual Basic 中為 Nothing)。
- customIndexedFieldSchemas
型別:System.Collections.Generic. . :: . .IEnumerable< (Of < ( <'IndexSchema> ) > ) >
索引結構描述清單,可以用於更有效率地尋找中繼資料存放區內的項目。如果沒有任何索引結構描述存在,可以為 nullNothingnullptrunitnull 參考 (在 Visual Basic 中為 Nothing)。
傳回值
型別:Microsoft.Synchronization.MetadataStorage. . :: . .ReplicaMetadata
表示新建之複寫中繼資料的 ReplicaMetadata 物件。
例外
例外狀況 | 條件 |
---|---|
SyncIdFormatMismatchException | idFormats 所指定的識別碼格式結構描述不符合用來初始化複寫中繼資料的結構描述。 |
備註
這個方法必須於中繼資料存放區上執行所有必要的工作來建立及初始化複寫中繼資料,好讓傳回的 ReplicaMetadata 物件可立即用來存取及修改此中繼資料。
使用 customItemFieldSchemas 可對項目中繼資料定義一組自訂欄位,每一個欄位都是由唯一的字串名稱和值所組成。這些欄位可用來存放有關預設項目中繼資料集合所不支援之項目的任何其他中繼資料。這些欄位可使用 ItemMetadata 上的各種方法 (如 ItemMetadata..::..GetByteField 或 ItemMetadata..::..SetCustomField) 來存取。
使用 customIndexedFieldSchemas 可定義一組索引結構描述,這樣就可以使用自訂欄位集合當做索引,更有效率地尋找中繼資料存放區內的項目。索引結構描述可定義為唯一的項目,以確保此索引會定義單一項目。索引結構描述內所包含的每一個欄位也必須存在於為此複寫所定義的自訂欄位結構描述中。索引欄位可用於 ReplicaMetadata..::..FindItemMetadataByIndexedField 和 ReplicaMetadata..::..FindItemMetadataByUniqueIndexedFields 等方法中。