本文整理汇总了C#中Parse.ParseObject.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# ParseObject.ContainsKey方法的具体用法?C# ParseObject.ContainsKey怎么用?C# ParseObject.ContainsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseObject
的用法示例。
在下文中一共展示了ParseObject.ContainsKey方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFromParseObject
public static async Task<MagicList> CreateFromParseObject(ParseObject parseObject)
{
return await Task.Run<MagicList>(() =>
{
var mlist = new MagicList();
mlist.CountryName = parseObject.ObjectId;
mlist.CountryObjectId = parseObject.ObjectId;
if (parseObject.ContainsKey("languageID"))
{
mlist.CountryName = (string)parseObject["languageID"];
}
if (parseObject.ContainsKey("objectId"))
{
mlist.CountryObjectId = (string) parseObject["objectId"];
}
if (parseObject.ContainsKey("name"))
{
mlist.CountryDescription = (string)parseObject["name"];
}
return mlist;
});
}
示例2: LoadFromParse
public void LoadFromParse(ParseObject parseObj)
{
var thisType = this.GetType ();
foreach (PropertyInfo prop in thisType.GetRuntimeProperties ()) {
if (!prop.Name.Equals (Const.OBJECT_ID, StringComparison.OrdinalIgnoreCase)) {
object value = null;
if (parseObj.ContainsKey (prop.Name)) {
value = parseObj.Get<object> (prop.Name);
}
prop.SetValue (this, value);
}
}
this.objectId = parseObj.ObjectId;
}
示例3: SetParsePropertyFromFsmVar
public static bool SetParsePropertyFromFsmVar(ParseObject _object,string property,Fsm fsm,FsmVar fsmVar)
{
if (_object==null )
{
Debug.Log("Parse Object null");
return false;
}
if (string.IsNullOrEmpty(property) )
{
Debug.Log("property null");
return false;
}
if (! _object.ContainsKey(property))
{
// return false;
}
PlayMakerUtils.RefreshValueFromFsmVar(fsm,fsmVar);
if (fsmVar.Type == VariableType.Bool)
{
_object[property] = fsmVar.boolValue;
}else if (fsmVar.Type == VariableType.Float)
{
_object[property] = fsmVar.floatValue;
}else if (fsmVar.Type == VariableType.Int)
{
_object[property] = fsmVar.intValue;
}else if (fsmVar.Type == VariableType.String)
{
_object[property] = fsmVar.stringValue;
}else if (fsmVar.Type == VariableType.Color)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.colorValue);
}else if (fsmVar.Type == VariableType.GameObject)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.gameObjectValue);
}else if (fsmVar.Type == VariableType.Material)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.materialValue);
}else if (fsmVar.Type == VariableType.Quaternion)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.quaternionValue);
}else if (fsmVar.Type == VariableType.Rect)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.rectValue);
}else if (fsmVar.Type == VariableType.Texture)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.textureValue);
}else if (fsmVar.Type == VariableType.Vector2)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.vector2Value);
}
else if (fsmVar.Type == VariableType.Vector3)
{
_object[property] = PlayMakerUtils.ParseValueToString(fsmVar.vector3Value);
}
return true;
}
示例4: GetParsePropertyToFsmVar
public static bool GetParsePropertyToFsmVar(ParseObject _object,string property,Fsm fsm,FsmVar fsmVar)
{
if (_object==null || string.IsNullOrEmpty(property) )
{
return false;
}
if (! _object.ContainsKey(property))
{
return false;
}
if (fsmVar.Type == VariableType.Bool)
{
PlayMakerUtils.ApplyValueToFsmVar(fsm,fsmVar,_object[property]);
}else if (fsmVar.Type == VariableType.Float)
{
PlayMakerUtils.ApplyValueToFsmVar(fsm,fsmVar,_object[property]);
}else if (fsmVar.Type == VariableType.Int)
{
PlayMakerUtils.ApplyValueToFsmVar(fsm,fsmVar,_object[property]);
}else if (fsmVar.Type == VariableType.String)
{
PlayMakerUtils.ApplyValueToFsmVar(fsm,fsmVar,_object[property]);
}else if (fsmVar.Type == VariableType.Color)
{
fsmVar.colorValue = (Color) PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.GameObject)
{
fsmVar.gameObjectValue = (GameObject) PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Material)
{
fsmVar.materialValue = (Material)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Quaternion)
{
fsmVar.quaternionValue = (Quaternion)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Rect)
{
fsmVar.rectValue = (Rect)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Texture)
{
fsmVar.textureValue = (Texture2D)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Vector2)
{
fsmVar.vector2Value = (Vector2)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}else if (fsmVar.Type == VariableType.Vector3)
{
fsmVar.vector3Value = (Vector3)PlayMakerUtils.ParseValueFromString( (string)_object[property] );
}
return true;
}
示例5: CreateHotlineFromParseObject
public static async Task<MagicListHotline> CreateHotlineFromParseObject(ParseObject parseObject)
{
return await Task.Run<MagicListHotline>(async () =>
{
var mlist = new MagicListHotline();
if (parseObject.ContainsKey("languageID"))
{
var rel = parseObject.Get<ParseObject>("languageID");
String rel2 = rel.ObjectId;
var query = from language in ParseObject.GetQuery("Language")
where language.Get<string>("objectId") == rel2
select language;
ParseObject obj = await query.FirstAsync();
mlist.HotlineLanguage = (string)obj["name"];
}
if (parseObject.ContainsKey("email"))
{
mlist.HotlineEmail = (string)parseObject["email"];
}
if (parseObject.ContainsKey("fax"))
{
mlist.HotlineFax = (string)parseObject["fax"];
}
if (parseObject.ContainsKey("phone"))
{
mlist.HotlinePhone = (string)parseObject["phone"];
}
return mlist;
});
}
示例6: CreateFromParseObject
public static async Task<curoLists> CreateFromParseObject(ParseObject parseObject)
{
return await Task.Run<curoLists>(() =>
{
var mlist = new curoLists();
mlist.Title = parseObject.ObjectId;
if (parseObject.ContainsKey("title"))
{
mlist.Title = (string)parseObject["title"];
}
if (parseObject.ContainsKey("description"))
{
mlist.Description = (string)parseObject["description"];
}
if (parseObject.ContainsKey("image"))
{
mlist.ImagePath = (string)parseObject["image"];
// Image src = new Image();
// mlist.curoImage = ImagePath;
}
if (parseObject.ContainsKey("unread"))
{
Color currentAccentColorHex = (Color)Application.Current.Resources["PhoneAccentColor"];
Boolean isUnread = (bool) parseObject["unread"];
if (isUnread == true)
{
mlist.MessageColour =currentAccentColorHex;
}
else
{
mlist.MessageColour = currentAccentColorHex;
}
mlist.Unread = isUnread;
}
if (parseObject.ContainsKey("type"))
{
string mtype = (string)parseObject["type"];
if (mtype == "N")
{
mlist.Type = "Notes";
mlist.ViewToUse = "Notes.Xaml";
}
}
return mlist;
});
}
示例7: TestAddUniqueToList
public void TestAddUniqueToList() {
ParseObject obj = new ParseObject("Corgi");
obj.AddUniqueToList("emptyList", "gogo");
obj["existingList"] = new List<string>() { "gogo" };
Assert.True(obj.ContainsKey("emptyList"));
Assert.AreEqual(1, obj.Get<List<object>>("emptyList").Count);
obj.AddUniqueToList("existingList", "gogo");
Assert.True(obj.ContainsKey("existingList"));
Assert.AreEqual(1, obj.Get<List<object>>("existingList").Count);
obj.AddUniqueToList("existingList", 1);
Assert.AreEqual(2, obj.Get<List<object>>("existingList").Count);
obj.AddRangeUniqueToList("newRange", new List<string>() { "anti", "anti" });
Assert.AreEqual(1, obj.Get<List<object>>("newRange").Count);
}
示例8: AddPitTeam
//.........这里部分代码省略.........
updateBtn.Clicked += (object sender, EventArgs e) => {
//data ["robotImage"] = new ParseFile(robotImage);
//data ["teamNumber"] = int.Parse(teamNumber.Text);
data ["teamName"] = teamName.Text;
data ["robotWeight"] = Convert.ToInt32(robotWeight.Text);
if(rampPicker.Title != "[Select an Option]"){
data ["ramp"] = rampPicker.Title;
}
if(drivePicker.Title != "[Select Drive Type]"){
data ["driveType"] = drivePicker.Title;
}
if(toteOrientationPicker.Title != "[Select Tote Orientation]"){
data ["toteOrientation"] = toteOrientationPicker.Title;
}
if(canOrientationPicker.Title != "[Select Can Orientation]"){
data ["canOrientation"] = canOrientationPicker.Title;
}
if(autoStrategy.Text != "[Enter Auto Strategy]"){
data ["autoStrategy"] = autoStrategy.Text;
}
if(teleOpStrategy.Text != "[Enter TeleOp Strategy]"){
data ["teleOpStrategy"] = teleOpStrategy.Text;
}
if(autoTotePicker.Title != "[Select Option]"){
data ["autoTote"] = autoTotePicker.Title;
}
data ["coopertitionTotes"] = Convert.ToInt32(coopertitionTotes.Text);
data ["notes"] = notes.Text;
SaveData ();
if( data.ContainsKey("ramp") ==
data.ContainsKey("driveType") ==
data.ContainsKey("toteOrientation") ==
data.ContainsKey("canOrientation") ==
data.ContainsKey("autoStrategy") ==
data.ContainsKey("teleOpStrategy") ==
data.ContainsKey("autoTote") ==
true)
{
data["pitScoutStatus"]=0;
} else {
data["pitScoutStatus"]=255;
}
SaveData();
};
Label keyboardPadding = new Label ();
keyboardPadding.HeightRequest = 300;
StackLayout side = new StackLayout () {
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Children = {
teamNumberLabel,
teamNumber,
teamNameLabel,
teamName
}
};
StackLayout bottom = new StackLayout () {
HorizontalOptions = LayoutOptions.FillAndExpand,
示例9: CreateFromParseObject
public static async Task<Clinics> CreateFromParseObject(ParseObject parseObject)
{
return await Task.Run<Clinics>(() =>
{
var findaPhysioList = new Clinics();
findaPhysioList._Name = parseObject.ObjectId;
if (parseObject.ContainsKey("BookURL"))
{
findaPhysioList._Name = (string)parseObject["BookURL"];
}
if (parseObject.ContainsKey("OpeningHours"))
{
findaPhysioList._OpeningHours = (string)parseObject["OpeningHours"];
}
if (parseObject.ContainsKey("Speciality"))
{
findaPhysioList._Speciaity = (string)parseObject["Speciality"];
}
if (parseObject.ContainsKey("Town"))
{
findaPhysioList._Town = (string)parseObject["Town"];
}
if (parseObject.ContainsKey("Website"))
{
findaPhysioList._WebSite = (string)parseObject["Website"];
}
if (parseObject.ContainsKey("adress1"))
{
findaPhysioList._Address1 = (string)parseObject["adress1"];
}
if (parseObject.ContainsKey("name"))
{
findaPhysioList._Name = (string)parseObject["name"];
}
if (parseObject.ContainsKey("postcode"))
{
findaPhysioList._Postcode = (string)parseObject["postcode"];
}
if (parseObject.ContainsKey("telephone"))
{
findaPhysioList._Telephone = (string)parseObject["telephone"];
}
if (parseObject.ContainsKey("lat"))
{
findaPhysioList._Latitude = (double)parseObject["lat"];
}
if (parseObject.ContainsKey("long"))
{
findaPhysioList._Longitude = (double)parseObject["long"];
}
return findaPhysioList;
});
}