本文整理汇总了C#中Book.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Book.Any方法的具体用法?C# Book.Any怎么用?C# Book.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book.Any方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildInternal
void BuildInternal()
{
// Set explicitly to prevent the flaky designer from creating a huge label
this.grpboxLabel.HeightRequest = 17;
// Setup the grid to display icon, and other columns of data returned
// from the webservice where the quotes are retrieved.
gridQuotes.AppendColumn(" ", new CellRendererPixbuf(), "pixbuf", 0);
gridQuotes.AppendColumn("Name", new CellRendererText(), "text", 1);
gridQuotes.AppendColumn("Symbol", new CellRendererText(), "text", 2);
gridQuotes.AppendColumn("Last", new CellRendererText(), "text", 3);
gridQuotes.AppendColumn("Change", new CellRendererText(), "text", 4);
gridQuotes.ShowAll();
// Loads pre-existing file called book.json
// from /home/{user} if not otherwise specified.
book = Book.Load();
if (book.Any())
{
// Add new menu items under Portfolios menu for each portfolio
// read in from the file above e.g. Book.Load(file);
UIManager.AddPortfolios(book, this.OnPortfolioActivated);
}
// Select the first Portfolio in list and retrieve quote(s)
LoadStartupQuoteOrDefaut();
}
示例2: Initialize
void Initialize(Book b, Portfolio current = null)
{
// Initialize member variables
book = b;
CurrentPortfolio = current;
newportfolioCounter = 1;
state = WindowStateBehavior.Default;
// Initialize widgets to the starting state
WindowState = WindowStateBehavior.Default;
// Images to make the gui pop...pop...pop
lockedIcon = (Gtk.Image)btnRename.Image;
unlockedIcon = new Gtk.Image();
unlockedIcon.Pixbuf = Gdk.Pixbuf.LoadFromResource("QuoteView.Resources.rename-locked.png");
portfolioIcon = Gdk.Pixbuf.LoadFromResource("QuoteView.Resources.portfolio.png");
// Load combobox with Portfolios model
var portfolios = new Gtk.ListStore(typeof(string), typeof(Gdk.Pixbuf));
foreach (var pfolio in book)
portfolios.AppendValues(pfolio.Name, portfolioIcon);
// Configure combobox
var imgRndr = new CellRendererPixbuf();
comboPortfolios.PackEnd(imgRndr, false);
comboPortfolios.AddAttribute(imgRndr, "pixbuf", 1);
comboPortfolios.Model = portfolios;
if (book.Any())
comboPortfolios.Active = 0;
comboPortfolios.ShowAll();
// Setup change event on listbox
IsDirty = (object sender, EventArgs e) => book.IsDirty = true;
listSymbols.ListBoxChanged += IsDirty;
WindowStateChanged(WindowStateBehavior.Default);
}