Example #1
0
        public void ExecuteEditLink(ICommandContext context)
        {
            var favFrmSvc  = context.GetRequiredService <IFavoritesDummyFormService>();
            var activeLink = (FavoritesLink)favFrmSvc.SelectedEntries.Single();

            using (var fi = new FavoritesLinkForm(activeLink.Link, activeLink.Comment))
                if (fi.ShowDialog(
                        context.
                        GetRequiredService <IUIShell>().
                        GetMainWindowParent()) == DialogResult.OK)
                {
                    activeLink.Link    = fi.Url;
                    activeLink.Comment = fi.Comment;
                    activeLink.Update();
                    favFrmSvc.Refresh();
                }
        }
 public void ExecuteAddLink(ICommandContext context)
 {
     var favFormSvc = context.GetRequiredService<IFavoritesDummyFormService>();
     using (var fi = new FavoritesLinkForm())
         if (fi.ShowDialog(
                 context
                     .GetRequiredService<IUIShell>()
                     .GetMainWindowParent()) == DialogResult.OK)
         {
             _favManager.AddUrlLink(
                 fi.Url,
                 fi.Comment,
                 favFormSvc.SelectedEntries.Any()
                     ? (FavoritesFolder)favFormSvc.SelectedEntries.Single()
                     : _favManager.RootFolder);
             favFormSvc.Refresh();
         }
 }
Example #3
0
        public void ExecuteAddLink(ICommandContext context)
        {
            var favFormSvc = context.GetRequiredService <IFavoritesDummyFormService>();

            using (var fi = new FavoritesLinkForm())
                if (fi.ShowDialog(
                        context
                        .GetRequiredService <IUIShell>()
                        .GetMainWindowParent()) == DialogResult.OK)
                {
                    _favManager.AddUrlLink(
                        fi.Url,
                        fi.Comment,
                        favFormSvc.SelectedEntries.Any()
                                                        ? (FavoritesFolder)favFormSvc.SelectedEntries.Single()
                                                        : _favManager.RootFolder);
                    favFormSvc.Refresh();
                }
        }
 public void ExecuteEditLink(ICommandContext context)
 {
     var favFrmSvc = context.GetRequiredService<IFavoritesDummyFormService>();
     var activeLink = (FavoritesLink)favFrmSvc.SelectedEntries.Single();
     using (var fi = new FavoritesLinkForm(activeLink.Link, activeLink.Comment))
         if (fi.ShowDialog(
                 context.
                     GetRequiredService<IUIShell>().
                     GetMainWindowParent()) == DialogResult.OK)
         {
             activeLink.Link = fi.Url;
             activeLink.Comment = fi.Comment;
             activeLink.Update();
             favFrmSvc.Refresh();
         }
 }