예제 #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();
                }
        }
예제 #2
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();
         }
 }
예제 #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();
                }
        }
예제 #4
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();
         }
 }