Get() public method

Gets the value of a with the given key. If the Amazon.CognitoSync.SyncManager.Record doesn't exist or is marked deleted, null will be returned.
public Get ( string key ) : string
key string Key of the record in the dataset.
return string
Exemplo n.º 1
0
        void Start()
        {

            // Open your datasets
            playerInfo = SyncManager.OpenOrCreateDataset("PlayerInfo");

            // Fetch locally stored data from a previous run
            alias = string.IsNullOrEmpty(playerInfo.Get("alias")) ? "Enter your alias" : playerInfo.Get("alias");
            playerName = string.IsNullOrEmpty(playerInfo.Get("playerName")) ? "Enter your full name" : playerInfo.Get("playerName");

			// Define Synchronize callbacks
			// when ds.Synchronize() is called the localDataset is merged with the remoteDataset 
            // OnDatasetDeleted, OnDatasetMerged, OnDatasetSuccess,  the corresponding callback is fired.
            // The developer has the freedom of handling these events needed for the Dataset
            playerInfo.OnSyncSuccess += this.HandleSyncSuccess; // OnSyncSucess uses events/delegates pattern
            playerInfo.OnSyncFailure += this.HandleSyncFailure; // OnSyncFailure uses events/delegates pattern
            playerInfo.OnSyncConflict = this.HandleSyncConflict;
            playerInfo.OnDatasetMerged = this.HandleDatasetMerged;
            playerInfo.OnDatasetDeleted = this.HandleDatasetDeleted;

        }