本文整理汇总了C#中Parse.ParseObject.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ParseObject.Select方法的具体用法?C# ParseObject.Select怎么用?C# ParseObject.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseObject
的用法示例。
在下文中一共展示了ParseObject.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FoundResults
private void FoundResults(ParseObject[] array, NSError error)
{
//If there was an error or no High scores found, create an emtpy list.
if (array == null || error != null) {
Root = new RootElement("High Scores"){
new Section(){
new StringElement("No Scores Found"),
}
};
return;
}
var easySection = new Section("Easy");
var mediumSection = new Section("Medium");
var hardSection = new Section("Hard");
var objects = array.Select(x=> x.ToObject<GameScore>()).OrderByDescending(x=> x.Score).ToList();
foreach(var score in objects)
{
var element = new StringElement(score.Player,score.Score.ToString("#,###"));
switch(score.Dificulty)
{
case GameDificulty.Easy:
easySection.Add(element);
break;
case GameDificulty.Medium:
mediumSection.Add(element);
break;
case GameDificulty.Hard:
hardSection.Add (element);
break;
}
}
Root = new RootElement("High Scores")
{
easySection,
mediumSection,
hardSection,
};
}