本文整理匯總了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,
};
}