예제 #1
0
파일: Plugin.cs 프로젝트: sidiandi/hagen
        private void LinksFromInternetExplorerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var links = ActionExtensions.GetAllIeLinks().ToList();

            try
            {
                var tagsPrefix = GetTagsPrefix();

                var selected = Prompt.ChooseMany(links.ListFormat().DefaultColumns(), "Add Links")
                               .Select(_ => new Action {
                    Command = _.Command, Name = new[] { tagsPrefix, _.Name }.Join(" ")
                })
                               .ToList();

                context.AddJob(new Job(
                                   String.Format("Add {0} links from Internet Explorer", selected.Count),
                                   () =>
                {
                    foreach (var a in selected)
                    {
                        actions.Add(a);
                    }
                }));
            }
            catch
            {
            }
        }