本文整理汇总了C#中Parse.ParseObject.SaveAsync方法的典型用法代码示例。如果您正苦于以下问题:C# ParseObject.SaveAsync方法的具体用法?C# ParseObject.SaveAsync怎么用?C# ParseObject.SaveAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseObject
的用法示例。
在下文中一共展示了ParseObject.SaveAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.alta_contacto);
btnGuardar = FindViewById<Button> (Resource.Id.btnGuardar);
txtNombre = FindViewById<EditText> (Resource.Id.txtNombre);
txtTelefono = FindViewById<EditText> (Resource.Id.txtTelefono);
btnGuardar.Click += delegate {
ParseObject contactos = new ParseObject("MisContactos");
contactos["nombre"] =txtNombre.Text;
contactos["telefono"] = txtTelefono.Text;
contactos.SaveAsync ();
txtNombre.Text="";
txtTelefono.Text="";
Toast.MakeText (this, "Se registro nuevo contacto", ToastLength.Long).Show();
};
}
示例2: Start
// Use this for initialization
void Start()
{
ParseObject testObj = new ParseObject("TestObject");
testObj["foo"] = "bar";
Debug.Log(testObj.ToString());
testObj.SaveAsync();
}
示例3: SaveEvent
public async void SaveEvent(object sender, RoutedEventArgs e)
{
try {
if(Activity.Text=="")
{
InvalidInput();
return;
}
Info data = new Info()
{
UserId = (++App.i).ToString(),
Activity = Activity.Text.Trim(),
Lat = pin.Location.Position.Latitude,
Long = pin.Location.Position.Longitude,
Interested = 1
};
var DataBase = new ParseObject("Activities");
DataBase["UserID"] = data.UserId.ToString();
DataBase["Interested"] = data.Interested;
DataBase["Activity"] = data.Activity;
DataBase["Location"] = new ParseGeoPoint(data.Lat, data.Long);
await DataBase.SaveAsync();
Frame.Navigate(typeof(Nearby));
}
catch(Exception ex)
{
Message.Text = ex.Message;
}
}
示例4: attemptSignUp
public void attemptSignUp()
{
username = nameField.GetComponent<InputField> ().text;
password = passField.GetComponent<InputField> ().text;
if (username.Equals ("")) {
setMessage("No empty usernames!");
return;
}
if (username.Length > maxUsernameLength || username.Length < minUsernameLength) {
setMessage("Names must be " + minUsernameLength + "-" + maxUsernameLength + " letters!" );
return;
}
ParseObject account = new ParseObject("Account");
account ["username"] = username;
account ["password"] = password;
account.SaveAsync ();
setMessage ("Success!");
//K so once signed in, want to let them login.
//should make signup disappear
Vector3 sscale1 = signup.GetComponent<RectTransform> ().localScale;
sscale1.x = 0;
signup.GetComponent<RectTransform> ().localScale = sscale1;
displayLogin ();
}
示例5: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Login);
// Create your application here
ParseClient.Initialize ("Da2XGAo55e6dqM0IayIY6WWwf4TcP9TWaWG9j3yg", "KJeICBYidEkTHOXeiR9gIC15hYm2hP04YomzJarv");
editText1 = FindViewById<EditText> (Resource.Id.editText1);
editText2 = FindViewById<EditText> (Resource.Id.editText2);
button1 = FindViewById<Button> (Resource.Id.button1);
ss = Convert.ToString(editText1.Text);
button1.Click += async delegate {
int i = 1;
string sname = string.Concat("shop", i.ToString());
ParseObject s1 = new ParseObject(sname);
s1["product_id"] = null;
s1["product_name"] = null;
s1["product_mrp"] = null;
s1["product_availability"] = null;
await s1.SaveAsync();
StartActivity(typeof(addProductsActivity));
i = i + 1;
Toast toast = Toast.MakeText(this, "Logged In", ToastLength.Long);
toast.Show();
StartActivity(typeof(addProductsActivity));
};
}
示例6: Start
//public CNj
//public BotControlScript botControllScript;
// Use this for initialization
void Start () {
//init
commandList = new ArrayList ();
this.tcpListener = new TcpListener(IPAddress.Any, serverPort);
this.listenThread = new Thread(new ThreadStart(ListenForClients));
this.listenThread.Start();
string localIP = LocalIPAddress ();
Debug.Log ("Server Start on:"+localIP);
ParseObject testObject = new ParseObject("GlassGame");
testObject["ip"] = localIP;
testObject.SaveAsync().ContinueWith(temp=>
{
var query = ParseObject.GetQuery("GlassGame").OrderByDescending("createdAt").Limit(1);
query.FirstAsync().ContinueWith(t =>
{
ParseObject obj = t.Result;
Debug.Log("Insert Parse ip:"+obj["ip"]);
Debug.Log("Parse Date:"+obj.CreatedAt);
});
});
}
示例7: SaveHighScore
void SaveHighScore(string score)
{
ParseObject gameScore = new ParseObject("GameScore");
gameScore["score"] = score;
gameScore["playerName"] = ParseUser.CurrentUser.Username;
gameScore.SaveAsync();
}
示例8: UploadtoParse
public async void UploadtoParse()
{
ParseClient.Initialize("oVFGM355Btjc1oETUvhz7AjvNbVJZXFD523abVig", "4FpFCQyO7YVmo2kMgrlymgDsshAvTnGAtQcy9NHl");
var filePicker = new FileOpenPicker();
filePicker.FileTypeFilter.Add(".png");
var pickedfile = await filePicker.PickSingleFileAsync();
using (var randomStream = (await pickedfile.OpenReadAsync()))
{
using (var stream = randomStream.AsStream())
{
//byte[] data = System.Text.Encoding.UTF8.GetBytes("Working at Parse is great!");
ParseFile file = new ParseFile("resume1.png", stream);
await file.SaveAsync();
var jobApplication = new ParseObject("JobApplication");
jobApplication["applicantName"] = "jambor";
jobApplication["applicantResumeFile"] = file;
await jobApplication.SaveAsync();
}
}
}
示例9: StoreNetworkAsync
public async Task StoreNetworkAsync(INeuralNetwork network, double eval)
{
var networkParseFormat = new ParseObject(_networkVersion);
networkParseFormat["jsonNetwork"] = JsonConvert.SerializeObject(network.GetGenes());
networkParseFormat["eval"] = eval;
await networkParseFormat.SaveAsync();
}
示例10: FixRunSet
static async Task FixRunSet (ParseObject runSet)
{
var runs = await ParseInterface.PageQueryWithRetry (() => {
return ParseObject.GetQuery ("Run")
.Include ("benchmark")
.WhereEqualTo ("runSet", runSet);
});
var benchmarkNames = runs.Select (r => (string) (((ParseObject)r ["benchmark"]) ["name"])).Distinct ();
Console.WriteLine ("run set {0} has {1} runs {2} benchmarks", runSet.ObjectId, runs.Count (), benchmarkNames.Count ());
var averages = new Dictionary <string, double> ();
var variances = new Dictionary <string, double> ();
foreach (var name in benchmarkNames) {
var numbers = runs.Where (r => (string)(((ParseObject)r ["benchmark"]) ["name"]) == name).Select (r => ParseInterface.NumberAsDouble (r ["elapsedMilliseconds"])).ToArray ();
var avg = numbers.Average ();
averages [name] = avg;
var sum = 0.0;
foreach (var v in numbers) {
var diff = v - avg;
sum += diff * diff;
}
var variance = sum / numbers.Length;
variances [name] = variance;
Console.WriteLine ("benchmark {0} average {1} variance {2}", name, avg, variance);
}
runSet ["elapsedTimeAverages"] = averages;
runSet ["elapsedTimeVariances"] = variances;
await runSet.SaveAsync ();
}
示例11: ClaimCurrentScore
public void ClaimCurrentScore(string name)
{
ParseObject playerScore = new ParseObject("playerScore");
playerScore ["playerName"] = name;
playerScore ["score"] = currentTopScore;
playerScore.SaveAsync ();
}
示例12: cambiarMiInfo
private async void cambiarMiInfo(object sender, RoutedEventArgs e)
{
Esperar1.Visibility = Visibility.Visible;
try
{
var trata = new ParseObject("User");
trata.ObjectId = usu.Id;
trata["Nombre"] = nombre.Text;
trata["Apellido"] = apellido.Text;
trata["email"] = correo.Text;
trata["telefono"] = int.Parse(telefono.Text);
trata["cedula"] = cedula.Text;
trata["username"] = username.Text;
trata["password"] = password.Password;
usu.Nombre = nombre.Text;
usu.Apellido = apellido.Text;
usu.Correo = correo.Text;
usu.Telefono = uint.Parse(telefono.Text);
usu.Cedula = cedula.Text;
usu.Username = username.Text;
usu.Password = password.Password;
await trata.SaveAsync();
Esperar1.Visibility = Visibility.Collapsed;
}
catch (Exception ex)
{
Esperar1.Visibility = Visibility.Collapsed;
var dialog = new Windows.UI.Popups.MessageDialog("Tu información no ha podido ser editada");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("OK") { });
var result = await dialog.ShowAsync();
}
}
示例13: SaveAsync
protected async void SaveAsync()
{
ParseObject gameScore = new ParseObject("GameScore");
gameScore["score"] = 1337;
gameScore["playerName"] = "Sean Plott";
await gameScore.SaveAsync();
}
示例14: pp
public async void pp(){
ParseObject products = new ParseObject("products");
products ["product_id"] = product_id;
products ["product_name"] = product_name;
products ["product_mrp"] = product_mrp;
await products.SaveAsync();
}
示例15: Cadastrar
public void Cadastrar()
{
DateTime? _datetime = time_abre.Value;
string hr_abre = _datetime.Value.Hour + ":" + _datetime.Value.Minute;
_datetime = time_fecha.Value;
string hr_fecha = _datetime.Value.Hour + ":" + _datetime.Value.Minute;
ListPickerItem selectedItem = (ListPickerItem)lst_segmento.SelectedItem;
string segmento_lst = (string)selectedItem.Content;
if((txt_foodtruck_nome.Text != "")||(segmento_lst != "")||(hr_abre != "")||(hr_fecha != "")||(txt_preco.Text != "")||(txt_telefone.Text != ""))
{
ParseObject cadastro = new ParseObject("Foodtruck");
cadastro["idUser"] = Id;
cadastro["Foodtruck_nome"] = txt_foodtruck_nome.Text;
cadastro["Segmento"] = segmento_lst;
cadastro["Hr_Abre"] = hr_abre;
cadastro["Hr_Fecha"] = hr_fecha;
cadastro["Preco"] = txt_preco.Text;
cadastro["Telefone"] = txt_telefone.Text;
cadastro["latitude"] = "0.0";
cadastro["longitude"] = "0.0";
cadastro.SaveAsync();
MessageBoxResult cadastro_ok = MessageBox.Show("Dados cadastrado com sucesso!", "FoodTruck Show", MessageBoxButton.OK);
if (cadastro_ok == MessageBoxResult.OK)
NavigationService.GoBack();
}
else
{
MessageBoxResult msn_erro = MessageBox.Show("Todos os campos devem ser preenchidos obrigatoriamente.", "Preencha todos os dados!", MessageBoxButton.OK);
}
}