當前位置: 首頁>>代碼示例>>C#>>正文


C# ParseObject.ContainsKey方法代碼示例

本文整理匯總了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;
            });
        }
開發者ID:uvbdatawp,項目名稱:https-github.com-uvbdata-iExcellenceNACMS,代碼行數:24,代碼來源:MagicList.cs

示例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;
        }
開發者ID:arctouch-douglaskazumi,項目名稱:ArcTouchPark,代碼行數:16,代碼來源:Parseable.cs

示例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;
    }
開發者ID:Kenseco,項目名稱:Melo,代碼行數:66,代碼來源:PlayMakerParseProxy.cs

示例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;
    }
開發者ID:Kenseco,項目名稱:Melo,代碼行數:56,代碼來源:PlayMakerParseProxy.cs

示例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;
                });
            }
開發者ID:uvbdatawp,項目名稱:https-github.com-uvbdata-iExcellenceNACMS,代碼行數:37,代碼來源:MagicList.cs

示例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;
                });
            }
開發者ID:cmsni,項目名稱:curouap,代碼行數:62,代碼來源:curoLists.cs

示例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);
    }
開發者ID:dragouf,項目名稱:Parse-SDK-dotNET,代碼行數:18,代碼來源:ObjectTests.cs

示例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,
開發者ID:jonathandao0,項目名稱:OfficialVitruvianApp,代碼行數:67,代碼來源:AddPitTeam.cs

示例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;
            });
        }
開發者ID:cmsni,項目名稱:findaPhysio,代碼行數:74,代碼來源:Clinics.cs


注:本文中的Parse.ParseObject.ContainsKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。