Esempio n. 1
0
        private void 添加到收藏夹ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShellUIHelper ui    = new ShellUIHelper();
            object        title = WebBrowserProperty.frontProperty.siteTitle;

            ui.AddFavorite(WebBrowserProperty.frontProperty.webBrowser.LocationURL, ref title);
        }
Esempio n. 2
0
        /// <summary>
        /// Execute the command
        /// </summary>
        public override void Execute()
        {
            // determine the current URL and Title
            string url   = Browser.LocationURL;
            object title = Browser.LocationName;

            // add to favorites
            ShellUIHelper.AddFavorite(url, ref title);
        }
Esempio n. 3
0
        /// <summary>
        /// 调用系统的“添加到收藏夹”
        /// </summary>
        public static void AddFavorite(string url, string title)
        {
            ShellUIHelper helper = new ShellUIHelper();

            if (string.IsNullOrEmpty(title))
            {
                title = ABOUT_BLANK;
            }

            object o = title;

            helper.AddFavorite(url, ref o); //调用添加到收藏夹对话框
        }