当前位置: 首页>>代码示例>>C#>>正文


C# Book.Any方法代码示例

本文整理汇总了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();
    }
开发者ID:showtroylove,项目名称:StockQuote,代码行数:27,代码来源:MainWindow.cs

示例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);
        }
开发者ID:showtroylove,项目名称:StockQuote,代码行数:39,代码来源:PortfolioMgr.cs


注:本文中的Book.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。