本文整理汇总了C#中Parse.ParseUser.Get方法的典型用法代码示例。如果您正苦于以下问题:C# ParseUser.Get方法的具体用法?C# ParseUser.Get怎么用?C# ParseUser.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseUser
的用法示例。
在下文中一共展示了ParseUser.Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SignUp
public async Task<IHttpActionResult> SignUp([FromBody]Usuario user)
{
try
{
ParseUser usuario = new ParseUser()
{
Username = user.usuario,
Password = user.psw,
Email = user.correo
};
usuario["nombre"] = user.nombre;
Byte[] bytes = Convert.FromBase64String(user.foto);
ParseFile foto = new ParseFile("foto.png", bytes);
await foto.SaveAsync();
usuario["foto"] = foto;
usuario["sexo"] = user.sexo;
usuario["tipo"] = user.tipo;
await usuario.SignUpAsync();
Usuario resp = new Usuario();
resp.usuario = user.usuario;
resp.psw = user.psw;
resp.correo = usuario.Get<string>("email");
resp.foto = usuario.Get<ParseFile>("foto").Url.AbsoluteUri;
resp.sexo = usuario.Get<string>("sexo");
resp.tipo = usuario.Get<string>("tipo");
resp.nombre = usuario.Get<string>("nombre");
resp.ObjectId = usuario.ObjectId;
return Ok(resp);
}
catch (ParseException e) {
return InternalServerError(e);
}
}
示例2: SaveLocationToParseUser
/// <summary>
/// Save a new location data to the parse user.
/// This method does not save the data to the server.
/// Need to call SaveAsync on the user afterwards.
/// </summary>
/// <param name="user">the user whose location is to be saved</param>
/// <param name="newData">the new location data</param>
public static void SaveLocationToParseUser(ParseUser user, GeoPosition<GeoCoordinate> newData)
{
int lastLocationIndex = user.Get<int>(ParseContract.UserTable.LAST_LOCATION_INDEX);
int newLocationIndex = lastLocationIndex + 1;
newLocationIndex %= user.Get<int>(ParseContract.UserTable.LOCATION_DATA_SIZE);
user[ParseContract.UserTable.LAST_LOCATION_INDEX] = newLocationIndex;
if (!user.ContainsKey(ParseContract.UserTable.LOCATION(newLocationIndex)))//If the new slot was not filled.
{
user[ParseContract.UserTable.LOCATION(newLocationIndex)] = ParseContract.LocationTable.GeoPositionToParseObject(newData);
}
else//If the new slot contains a valid location
{
ParseObject newLocation = user.Get<ParseObject>(ParseContract.UserTable.LOCATION(newLocationIndex));
//Change the location entry without creating a new one.
ParseContract.LocationTable.GeoPositionSetParseObject(newData, newLocation);
}
user[ParseContract.UserTable.LAST_GEO_POINT] = new ParseGeoPoint(newData.Location.Latitude, newData.Location.Longitude);
}
示例3: enterConversation
private void enterConversation(ParseUser partner)
{
leaveConversation();
chatUsername.GetComponent<Text>().text = (string)partner[UserValues.NICK];
StartCoroutine(setUserPicture(partner, partner.Get<ParseFile>(UserValues.PICTURE), chatImage.GetComponent<Image>()));
//getUserPartners(ParseUser.CurrentUser)
if (!partnerList.Contains(partner))
{
Task saveCurrentUserTask = conversationAdded(ParseUser.CurrentUser, partner);
StartCoroutine(saveCurrentUserInvokeUpdates(partner, saveCurrentUserTask));
} else
{
this.partner = partner;
}
if (userTempEdit.ContainsKey(partner.ObjectId))
chatField.GetComponent<InputField>().text = userTempEdit[partner.ObjectId];
else
chatField.GetComponent<InputField>().text = "";
foreach(ParseUser user in newMessagesFromPartners)
{
if (user.ObjectId.Equals(partner.ObjectId))
{
newMessagesFromPartners.Remove(user);
break;
}
}
ParseUser.CurrentUser[UserValues.NEW_MESSAGE_FROM] = newMessagesFromPartners;
ParseUser.CurrentUser.SaveAsync();
removeMarkerNewMessageReceived(partner.ObjectId);
Debug.Log("enter conversation");
}
示例4: getUserList
private static List<ParseUser> getUserList(ParseUser user, string userValue)
{
List<ParseUser> partners = null;
if (user[userValue].GetType() == typeof(List<object>))
partners = user.Get<List<object>>(userValue).Select(u => (ParseUser)u).ToList();
else
partners = user.Get<List<ParseUser>>(userValue).Select(u => (ParseUser)u).ToList();
return partners;
}