当前位置: 首页>>代码示例>>C#>>正文


C# ParseUser.ContainsKey方法代码示例

本文整理汇总了C#中Parse.ParseUser.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# ParseUser.ContainsKey方法的具体用法?C# ParseUser.ContainsKey怎么用?C# ParseUser.ContainsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parse.ParseUser的用法示例。


在下文中一共展示了ParseUser.ContainsKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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);
        }
开发者ID:qtstc,项目名称:weassist,代码行数:27,代码来源:Utilities.cs

示例2: ReadParseUser

 public static bool ReadParseUser(ParseUser user)
 {
     if (user.ContainsKey("Created"))
     {
         if (user.ContainsKey("MaxScore"))
         {
             var maxscore = (long)user["MaxScore"];
             _maxScore = (int)maxscore;
         }
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:arahis,项目名称:Swiper,代码行数:16,代码来源:PlayerManager.cs


注:本文中的Parse.ParseUser.ContainsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。