Ejemplo n.º 1
0
        private void GetSpaceInfoResponse(bool error, RestGetSpaceResponseData spaceData)
        {
            if (error)
            {
                ProcessError(Process.Fetching);
            }
            else
            {
                try
                {
                    ProcessEnd(Process.Fetching);

                    // NOTE: TinyJSON does not serialize System.DateTime values correctly, so this will always return true.
                    if (this.modified < JSONTools.ParseDateTimeFromString(spaceData.modified_at))
                    {
                        CopyFromGetResponseData(spaceData);
                        SaveToCache();
                    }

                    //RegisterAssets();
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    ProcessError(Process.Fetching);
                }
            }
        }
Ejemplo n.º 2
0
 private void CopyFromGetResponseData(RestGetSpaceResponseData responseData)
 {
     this.id           = responseData.id;
     this.creatorID    = responseData.creator_id;
     this.ownerID      = responseData.owner_id;
     this.name         = responseData.name;
     this.basePath     = responseData.base_path;
     this.lastAccessed = JSONTools.ParseDateTimeFromString(responseData.last_accessed_at);
     this.created      = JSONTools.ParseDateTimeFromString(responseData.created_at);
     this.modified     = JSONTools.ParseDateTimeFromString(responseData.modified_at);
     this.assetIDs     = new List <string>(responseData.asset_ids);
 }