本文整理汇总了C#中Category.OrderBy方法的典型用法代码示例。如果您正苦于以下问题:C# Category.OrderBy方法的具体用法?C# Category.OrderBy怎么用?C# Category.OrderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Category
的用法示例。
在下文中一共展示了Category.OrderBy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildTiles
private Widget BuildTiles ()
{
var vbox = new VBox () { Spacing = 12, BorderWidth = 4 };
var categories = new Category [] {
new Category ("audio_bookspoetry", Catalog.GetString ("Audiobooks"), 4300, "audio-x-generic"),
new Category ("movies", Catalog.GetString ("Movies"), 200000, "video-x-generic"),
new Category (null, Catalog.GetString ("Lectures"), "subject:ocw OR creator:university OR mediatype:education OR publisher:University", 1290, "x-office-presentation"),
new Category ("etree", Catalog.GetString ("Concerts"), 69000, "audio-x-generic"),
new Category ("texts", Catalog.GetString ("Books"), 1600000, "x-office-document")
};
foreach (var cat in categories.OrderBy (c => c.Name)) {
var this_cat = cat;
var tile = new ImageButton (cat.Name, cat.IconName) {
InnerPadding = 4
};
tile.LabelWidget.Xalign = 0;
tile.Clicked += (o, a) => source.SetSearch (this_cat);
vbox.PackStart (tile, false, false, 0);
}
return vbox;
}