コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FavoriteForm favoriteForm = new FavoriteForm();

            if (favoriteForm.ShowDialog() == DialogResult.OK)
            {
                Favorite favorite = favoriteForm.Favorite;
                FavoriteManager.FavoritesManager.Favorites.Add(favorite);
                FavoriteManager.Save();
                Render();
            }
        }
コード例 #2
0
ファイル: XPBrowser.cs プロジェクト: Buddhalow/classicbrowser
        private void AddPageToFavorites()
        {
            FavoriteForm favoriteForm = new FavoriteForm()
            {
                Url   = AddressBar.Text, // TODO bind it to web browsers url
                Title = CurrentTitle     // TODO bind to text
            };

            if (favoriteForm.ShowDialog() == DialogResult.OK)
            {
                Favorite favorite = favoriteForm.Favorite;
                FavoriteManager.FavoritesManager.Favorites.Add(favorite);
                SaveFavorites();
                RenderFavoriteMenus();
            }
        }