本文整理汇总了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;
}
示例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);
}
示例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
);
}
示例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;
}
示例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");
}
示例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;
}
示例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>();
}
示例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;
}
示例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));
}
示例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();
}
示例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);
});
});
});
}
示例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;
}
示例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"));
}
示例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;
}
示例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;
}