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


C# ParseObject.Get方法代碼示例

本文整理匯總了C#中Parse.ParseObject.Get方法的典型用法代碼示例。如果您正苦於以下問題:C# ParseObject.Get方法的具體用法?C# ParseObject.Get怎麽用?C# ParseObject.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Parse.ParseObject的用法示例。


在下文中一共展示了ParseObject.Get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Map

 /// <summary>
 /// Returns a Expedition instance
 /// </summary>
 /// <param name="parse"></param>
 /// <returns></returns>
 public static SystemPointer Map(ParseObject parseObject)
 {
     SystemPointer sp = new SystemPointer();
     sp.ObjectId = parseObject.ObjectId;
     sp.CreatedAt = parseObject.CreatedAt.Value;
     sp.UpdatedAt = parseObject.UpdatedAt.Value;
     sp.CurrentObjectId = parseObject.Get<string>("currentObjectId");
     sp.LastObjectId = parseObject.Get<string>("lastObjectId");
     return sp;
 }
開發者ID:jgoode,項目名稱:EliteLog,代碼行數:15,代碼來源:SystemPointerMapper.cs

示例2: GetMeasurement

        private async Task<Measurement> GetMeasurement(ParseObject parseMeasurement)
        {
            var panAngle = parseMeasurement.Get<double>("panAngle");
            var tiltAngle = parseMeasurement.Get<double>("tiltAngle");
            var distanceCm = parseMeasurement.Get<double>("distanceCm");

            var imageParseFile = parseMeasurement.Get<ParseFile>("image");

            return new Measurement(panAngle, tiltAngle, distanceCm, imageParseFile.Url.AbsoluteUri);
        }
開發者ID:mariusmuntean,項目名稱:DepthView,代碼行數:10,代碼來源:ParseDataService.cs

示例3: parseToPresentation

		private Presentation parseToPresentation (ParseObject obj) {
			ParseGeoPoint geoPoint = obj.Get<ParseGeoPoint> ("location");
			ParseFile image = obj.Get<ParseFile> ("image");
			return new Presentation (
				obj.ObjectId,
				obj.Get<string> ("name"),
				obj.Get<string> ("description"),
				obj.Get<DateTime> ("start"),
				obj.Get<DateTime> ("end"),
				geoPoint.Latitude,
				geoPoint.Longitude,
				image.Url
			);
		}
開發者ID:gautierdelorme,項目名稱:JPOINSAXamarin,代碼行數:14,代碼來源:ParseManager.cs

示例4: loadImage

 IEnumerator loadImage(Image imageComponent, ParseObject news)
 {
     Sprite image = template;
     ParseFile imageObject = news.Get<ParseFile>("image");
     string path = Application.persistentDataPath + "/" + news.ObjectId + FILENAME_NEWS_PIC;
     bool updateExistingPic = false;
     if (File.Exists(path))
     {
         updateExistingPic = DateTime.Compare(File.GetLastWriteTime(path), news.UpdatedAt.Value.AddHours(1)) < 0;
     }
     if (imageObject != null)
     {
         if ((File.Exists(path))&&!updateExistingPic)
         {
             var fileData = File.ReadAllBytes(path);
             var tex = new Texture2D(2, 2);
             tex.LoadImage(fileData);
             image = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
         }
         else
         {
             var pictureRequest = new WWW(imageObject.Url.AbsoluteUri);
             yield return pictureRequest;
             byte[] fileBytes = pictureRequest.texture.EncodeToJPG(25);
             File.WriteAllBytes(path, fileBytes);
             image = Sprite.Create(pictureRequest.texture, new Rect(0, 0, pictureRequest.texture.width, pictureRequest.texture.height), new Vector2(0.5f, 0.5f));
         }
     }
     imageComponent.overrideSprite = image;
 }
開發者ID:LudusExtremus,項目名稱:Trainingspartner-Kraftwerk,代碼行數:30,代碼來源:NewsManagement.cs

示例5: ProductViewModel

 public ProductViewModel(ParseObject po)
 {
     productId = po.ObjectId;
     name = po.Get<string>("name");
     price = po.Get<decimal>("price");
     quantity = po.Get<int>("quantity");
     manufacture = po.Get<string>("manufacture");
     salePrice = po.Get<decimal>("salePrice");
     oldPrice = po.Get<decimal>("oldPrice");
     thumbnailImage = po.Get<string>("thumbnailImage");
     smallSlideImage = po.Get<IList<string>>("smallSlideImage");
     largeSlideImage = po.Get<IList<string>>("largeSlideImage");
 }
開發者ID:kduytoan1994,項目名稱:Mobile,代碼行數:13,代碼來源:ProductViewModel.cs

示例6: InterfacePage

		public InterfacePage (ParseObject dataObj)
		{
			Title = "Match Data for #" + dataObj.Get<int>("matchNumber").ToString();
			data = dataObj;
			infoLabel = new Label ();
			StackLayout stack = new StackLayout ();

			Grid masterGrid = new Grid 
			{
				VerticalOptions = LayoutOptions.FillAndExpand,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				RowDefinitions = 
				{
					new RowDefinition { Height = GridLength.Auto },
					new RowDefinition { Height = GridLength.Auto },
					new RowDefinition { Height = GridLength.Auto },
					new RowDefinition { Height = GridLength.Auto }
				},
				ColumnDefinitions = 
				{
					//new ColumnDefinition { Width = new GridLength(120, GridUnitType.Absolute) },
					new ColumnDefinition { Width = GridLength.Auto },
					new ColumnDefinition { Width = GridLength.Auto },
					new ColumnDefinition { Width = GridLength.Auto }
				}
			};

			Button robotShot = new Button ();
			robotShot.Text = "Robot Shot";
			robotShot.TextColor = Color.White;
			robotShot.BackgroundColor = Color.Green;
			robotShot.WidthRequest = 120;
			robotShot.HeightRequest = 50;
			robotShot.Clicked += (object sender, EventArgs e) => {
				PostRobotShot();
			};
			masterGrid.Children.Add (robotShot, 0, 0);

			Button robotShot2 = new Button ();
			robotShot2.Text = "Robot Shot";
			robotShot2.TextColor = Color.White;
			robotShot2.BackgroundColor = Color.Red;
			robotShot2.WidthRequest = 120;
			robotShot2.HeightRequest = 50;
			robotShot2.Clicked += (object sender, EventArgs e) => {
				PostRobotShot();
			};
			masterGrid.Children.Add (robotShot2, 2, 3);

			stack.Children.Add (infoLabel);
			stack.Children.Add (masterGrid);

			UpdateDisplay ();

			Content = stack;
		}
開發者ID:jonathandao0,項目名稱:OfficialVitruvianApp,代碼行數:56,代碼來源:InterfacePage.cs

示例7: ProductViewModel

        public ProductViewModel(ParseObject po)
        {
            productId = po.ObjectId;
            name = po.Get<string>("name");
            price = po.Get<float>("price");
            quantity = po.Get<int>("quantity");
            manufacture = po.Get<string>("manufacture");
            salePrice = po.Get<float>("salePrice");
            oldPrice = po.Get<float>("oldPrice");
            thumbnailImage = po.Get<string>("thumbnailImage");
            var smallSlideImage = po.Get<IList<object>>("smallSlideImage");
            this.smallSlideImage = smallSlideImage.Cast<string>();

            var largeSlideImage = po.Get<IList<object>>("largeSlideImage");
            this.largeSlideImage = largeSlideImage.Cast<string>();
        }
開發者ID:Ginkhust,項目名稱:Mobile,代碼行數:16,代碼來源:ProductViewModel.cs

示例8: Map

 /// <summary>
 /// Returns a Expedition instance
 /// </summary>
 /// <param name="parse"></param>
 /// <returns></returns>
 public static Expedition Map(ParseObject parseObject)
 {
     Expedition exp = new Expedition();
     exp.ObjectId = parseObject.ObjectId;
     exp.CreatedAt = parseObject.CreatedAt.Value;
     exp.UpdatedAt = parseObject.UpdatedAt.Value;
     exp.Name = parseObject.Get<string>("name");
     exp.Description = parseObject.Get<string>("description");
     exp.Current = parseObject.Get<int>("current") == 1;
     exp.EndSystem = parseObject.Get<string>("endSystem");
     exp.StartSystem = parseObject.Get<string>("startSystem");
     exp.StartDate = parseObject.Get<DateTime?>("beginDate");
     exp.EndDate = parseObject.Get<DateTime?>("endDate");
     exp.Profit = parseObject.Get<double>("profit");
     exp.TotalDistance = parseObject.Get<double>("totalDistance");
     return exp;
 }
開發者ID:jgoode,項目名稱:EliteLog,代碼行數:22,代碼來源:ExpeditionMapper.cs

示例9: managePost

    private void managePost(ParseObject post)
    {
        int left = -1;
        try {
            left = post.Get<int>("option1Count");
        } catch (Exception e) {
            left = 0;
        }

        int all_votes = -1;
        try {
            all_votes = post.Get<int>("numberOfVotes");
        } catch (Exception e) {
            all_votes = 0;
        }

        int percL = 50;
        if (all_votes > 0)
            percL = (left * 100) / all_votes;

        if (percL > 100) percL = 100;
        if (percL < 0) percL = 0;

        int left_voteNb = (percL * users.Count) / 100;
        int right_voteNb = users.Count - left_voteNb;

        List<ParseUser> left_voters = new List<ParseUser>();
        List<ParseUser> all_users = users.ToList<ParseUser>();

        System.Random r = new System.Random();
        for (int i = 0; i < left_voteNb; i++)
        {
            int rnd = r.Next(all_users.Count);
            ParseUser user = all_users[rnd];

            left_voters.Add(user);
            all_users.Remove(user);
        }
        StartCoroutine(vote(post, left_voters, all_users));
    }
開發者ID:the-only-ahmed,項目名稱:CunhBot,代碼行數:40,代碼來源:Robot.cs

示例10: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            planitem = e.Parameter as PlanItem;
            plan = planitem.obj;

            VerNombre.Text = plan.Get<string>("nombre");
            VerFecha.Text = plan.Get<string>("fecha");
            VerDireccion.Text = plan.Get<string>("direccion");
            VerDescripcion.Text = plan.Get<string>("descripcion");

            Uri ur = plan.Get<ParseFile>("imagen").Url;

            BitmapImage img = new BitmapImage(ur);
            VerImage.Source = img;

            //Para lo de asistentes
            mostrarCreadorAsistentes();

            //Configurar Mapa
            AddMap();


        }
開發者ID:simonbedoya,項目名稱:PlansPop-W10,代碼行數:23,代碼來源:VerPlan.xaml.cs

示例11: makeVote

    private void makeVote(ParseObject obj, string col, string lk, ParseUser user)
    {
        int v = 0;
        try {
            v = obj.Get<int>(col) + 1;
        } catch (Exception e) {
            v++;
        }

        int all = 0;
        try {
            v = obj.Get<int>("numberOfVotes") + 1;
        } catch (Exception e) {
            all++;
        }

        obj.Increment(col);
        obj.Increment("numberOfVotes");
        obj.SaveAsync().ContinueWith(t => {
            ParseObject Like = new ParseObject("Participant");
            Like.SaveAsync().ContinueWith(tt => {
                Like["choozy"] = obj;
                Like["user"] = user;
                Like["choice"] = lk;
                Like["status"] = "Voted";
                Like.ACL = new ParseACL(user)
                {
                    PublicReadAccess = true,
                    PublicWriteAccess = false
                };

                Like.SaveAsync().ContinueWith(ttt => {
                    g.decrementVote(obj);
                });
            });
        });
    }
開發者ID:the-only-ahmed,項目名稱:CunhBot,代碼行數:37,代碼來源:Robot.cs

示例12: 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

示例13: reset

 public void reset(ParseObject account)
 {
     username = account.Get<string>("username");
     password = account.Get<string>("password");
     LocalName = account.Get<string>("localname");
     type = account.Get<string>("type");
     description = account.Get<string>("description");
     address = account.Get<string>("address");
     Lat = account.Get<double>("lat");
     Lng = account.Get<double>("lng");
     replaceDictionary(account.Get<IDictionary<string, string>>("dictionary"));
 }
開發者ID:MaryCooperGD,項目名稱:WindowsPhoneApp,代碼行數:12,代碼來源:RegistrationManager.cs

示例14: ParseObjectToGeoPosition

            /// <summary>
            /// Convert a ParseObject to its GeoPosition counterpart
            /// </summary>
            /// <param name="p">the ParseObject instance</param>
            /// <returns>the GeoPosition object</returns>
            public static GeoPosition<GeoCoordinate> ParseObjectToGeoPosition(ParseObject p)
            {
                GeoPosition<GeoCoordinate> g = new GeoPosition<GeoCoordinate>();

                g.Timestamp = new DateTimeOffset(p.Get<DateTime>(TIME_STAMP));
                ParseGeoPoint pGeoPoint = p.Get<ParseGeoPoint>(LOCATION);

                g.Location = new GeoCoordinate();
                if (pGeoPoint.Latitude != NaNforParse)
                    g.Location.Latitude = pGeoPoint.Latitude;
                if (pGeoPoint.Longitude != NaNforParse)
                    g.Location.Longitude = pGeoPoint.Longitude;

                Double pAltitude = p.Get<Double>(ALTITUDE);
                if (pAltitude != NaNforParse)
                    g.Location.Altitude = pAltitude;

                Double pHAccuracy = p.Get<Double>(HORIZONTAL_ACCURACY);
                if (pHAccuracy != NaNforParse)
                    g.Location.HorizontalAccuracy = pHAccuracy;

                Double pVAccuracy = p.Get<Double>(VERTICAL_ACCURACY);
                if (pVAccuracy != NaNforParse)
                    g.Location.VerticalAccuracy = pVAccuracy;

                Double pSpeed = p.Get<Double>(SPEED);
                if (pSpeed != NaNforParse)
                    g.Location.Speed = pSpeed;

                Double pCourse = p.Get<Double>(COURSE);
                if (pCourse != NaNforParse)
                    g.Location.Course = pCourse;

                return g;
            }
開發者ID:qtstc,項目名稱:weassist,代碼行數:40,代碼來源:ParseContract.cs

示例15: Initialize

            internal AnnounceControls Initialize(ParseObject po) {
                greet = po.Get<bool>("greet");
                greetText = po.Get<string>("greetText");
                greetChannel = po.Get<ulong>("greetChannel");

                bye = po.Get<bool>("bye");
                byeText = po.Get<string>("byeText");
                byeChannel = po.Get<ulong>("byeChannel");

                this.ParseObj = po;
                return this;
            }
開發者ID:ZR2,項目名稱:NadekoBot-Admin,代碼行數:12,代碼來源:ServerGreetCommand.cs


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