Пример #1
0
        /// <summary>
        /// The OpenLoadedPortfolioTiles opens all portfolio tiles which were stored in the app data,
        /// subscribes to it's events and adds it to the active portfolio tiles.
        /// </summary>
        private void OpenLoadedPortfolioTiles()
        {
            this.appData.PortfolioTileDataSet.ForEach(portfoliotiledata =>
            {
                WpfPortfolioTile portfolioTile  = new WpfPortfolioTile(portfoliotiledata, this.appData);
                portfolioTile.OnAppDataChanged += this.Tile_OnAppDataChanged;
                portfolioTile.OnTileClosed     += this.PortfolioTile_OnTileClosed;
                portfolioTile.OnPortfolioSettingsWindowOpened += this.PortfolioTile_OnPortfolioSettingsWindowOpened;
                portfolioTile.OnPortfolioSettingsWindowClosed += this.PortfolioTile_OnPortfolioSettingsWindowClosed;
                this.activePortfolioTiles.Add(portfolioTile);

                if (!this.appData.TileHandlerData.GlobalTileStyle.Hidden)
                {
                    portfolioTile.Show();
                }
            });
        }
Пример #2
0
        /// <summary>
        /// The OpenNewPortfolioTile opens a new portfolio tile, subscribes to it's events,
        /// adds it to the active portfolio tiles and to the app data.
        /// Finally it calls the FireOnAppDataChanged method.
        /// </summary>
        public void OpenNewPortfolioTile()
        {
            if (this.portfolioTileSettingsWindowActive)
            {
                return;
            }

            IPortfolioTile portfolioTile = new WpfPortfolioTile(new PortfolioTileData(), this.appData);

            portfolioTile.OnAppDataChanged += this.Tile_OnAppDataChanged;
            portfolioTile.OnTileClosed     += this.PortfolioTile_OnTileClosed;
            portfolioTile.OnPortfolioSettingsWindowOpened += this.PortfolioTile_OnPortfolioSettingsWindowOpened;
            portfolioTile.OnPortfolioSettingsWindowClosed += this.PortfolioTile_OnPortfolioSettingsWindowClosed;
            this.activePortfolioTiles.Add(portfolioTile);
            this.appData.PortfolioTileDataSet.Add(portfolioTile.PortfolioTileData);
            this.FireOnAppDataChanged();
            portfolioTile.Show();
        }