当前位置: 首页>>代码示例>>C#>>正文


C# Amazon.Resolve方法代码示例

本文整理汇总了C#中Amazon.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# Amazon.Resolve方法的具体用法?C# Amazon.Resolve怎么用?C# Amazon.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Amazon的用法示例。


在下文中一共展示了Amazon.Resolve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleSyncConflict

        private bool HandleSyncConflict(Amazon.CognitoSync.SyncManager.Dataset dataset, List<SyncConflict> conflicts)
        {

            statusMessage = "Handling Sync Conflicts.";
            Debug.Log("OnSyncConflict");
            List<Amazon.CognitoSync.SyncManager.Record> resolvedRecords = new List<Amazon.CognitoSync.SyncManager.Record>();

            foreach (SyncConflict conflictRecord in conflicts)
            {
                // This example resolves all the conflicts using ResolveWithRemoteRecord 
                // SyncManager provides the following default conflict resolution methods:
                //      ResolveWithRemoteRecord - overwrites the local with remote records
                //      ResolveWithLocalRecord - overwrites the remote with local records
                //      ResolveWithValue - for developer logic  
                resolvedRecords.Add(conflictRecord.ResolveWithRemoteRecord());
            }

            // resolves the conflicts in local storage
            dataset.Resolve(resolvedRecords);

            // on return true the synchronize operation continues where it left,
            //      returning false cancels the synchronize operation
            return true;
        }
开发者ID:Danubian,项目名称:SwagNito,代码行数:24,代码来源:CognitoSyncManagerSample.cs

示例2: HandleSyncConflict

    private bool HandleSyncConflict(Amazon.CognitoSync.SyncManager.Dataset dataset, List<SyncConflict> conflicts)
    {
		if (dataset.Metadata != null) {
			Debug.LogWarning("Sync conflict " + dataset.Metadata.DatasetName);
		} else {
			//In case we called synchronize after deleting the dataset, we can not access it anymore
			Debug.LogWarning("Sync conflict");
		}

        List<Amazon.CognitoSync.SyncManager.Record> resolvedRecords = new List<Amazon.CognitoSync.SyncManager.Record>();
        foreach (SyncConflict conflictRecord in conflicts)
        {
            resolvedRecords.Add(conflictRecord.ResolveWithRemoteRecord());
        }
        // resolves the conflicts in local storage
        dataset.Resolve(resolvedRecords);
        // on return true the synchronize operation continues where it left,
        //      returning false cancels the synchronize operation
        return true;
    }
开发者ID:NathanSDunn,项目名称:aws-sdk-unity-samples,代码行数:20,代码来源:SaveManager.cs


注:本文中的Amazon.Resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。