public SlideshowManager (IFavorites favorites, IImageRepository imageRepository) { _favorites = favorites; _imageRepository = imageRepository; Settings = new Settings (false, false, true, 5000, AnimationType.Second); }
public FavoriteRenameCommand(IPersistence persistence, IRenameService service) { this.persistence = persistence; this.service = service; this.favorites = persistence.Favorites; this.validator = new FavoriteNameValidator(this.persistence); }
private void LoadFavorites(IPersistence persistence) { IFavorites favorites = persistence.Favorites; string[] favoriteNames = favorites.Select(f => f.Name).ToArray(); this.inputTextbox.AutoCompleteCustomSource = new AutoCompleteStringCollection(); this.inputTextbox.AutoCompleteCustomSource.AddRange(favoriteNames); }
internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence) { this.treeList = treeListToFill; this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand); this.persistedGroups = persistence.Groups; this.favorites = persistence.Favorites; this.dispatcher = persistence.Dispatcher; this.dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged); this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged); }
private ArrayList FavoritesToSharedList() { IFavorites favoritesToShare = this.persistence.Favorites; ArrayList list = new ArrayList(); foreach (IFavorite favorite in favoritesToShare) { FavoriteConfigurationElement configFavorite = ModelConverterV2ToV1.ConvertToFavorite(favorite, persistence, this.connectionManager); list.Add(SharedFavorite.ConvertFromFavorite(this.persistence, configFavorite)); } return(list); }
internal CopyFavoriteCommand(IPersistence persistence, Func<InputBoxResult> copyPrompt = null) { this.favorites = persistence.Favorites; var renameService = new RenameCopyService(persistence.Favorites); renameService.RenameAction = this.AddIfValid; // property injection this.renameCommand = new FavoriteRenameCommand(persistence, renameService); if (copyPrompt != null) this.copyPrompt = copyPrompt; else this.copyPrompt = () => InputBox.Show("Enter new name:", "Duplicate selected favorite as ..."); }
internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence, FavoriteIcons favoriteIcons) { this.treeList = treeListToFill; this.favoriteIcons = favoriteIcons; this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand); this.toolTipBuilder = new ToolTipBuilder(persistence.Security); this.persistedGroups = persistence.Groups; this.favorites = persistence.Favorites; this.dispatcher = persistence.Dispatcher; this.dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged); this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged); }
internal CopyFavoriteCommand(IPersistence persistence, Func <InputBoxResult> copyPrompt = null) { this.favorites = persistence.Favorites; var renameService = new RenameCopyService(persistence.Favorites); renameService.RenameAction = this.AddIfValid; // property injection this.renameCommand = new FavoriteRenameCommand(persistence, renameService); if (copyPrompt != null) { this.copyPrompt = copyPrompt; } else { this.copyPrompt = () => InputBox.Show("Enter new name:", "Duplicate selected favorite as ..."); } }
public OrganizeFavoritesToolbarForm(IPersistence persistence) { InitializeComponent(); IFavorites persistedFavorites = persistence.Favorites; ListViewItem[] listViewItems = settings.FavoritesToolbarButtons .Select(id => persistedFavorites[id]) .Where(candidate => candidate != null) .Select(favorite => new ListViewItem(favorite.Name) { Tag = favorite.Id }) .ToArray(); lvFavoriteButtons.Items.AddRange(listViewItems); }
/// <summary> /// Initializes a new instance of the <see cref="EditFavoritesPresenter"/> class. /// </summary> /// <param name="window"> /// The <see cref="IEditFavorites"/> window. /// </param> /// <param name="url"> /// The url. /// </param> /// <param name="favorites"> /// The favorites. /// </param> /// <remarks> /// If the Location exists in the favorites menu, it lets you edit the already /// existing one otherise it will create a new entry. /// </remarks> public EditFavoritesPresenter(IEditFavorites window, Url url, IFavorites favorites) { var location = favorites.GetOrCreate(url); // When the save button is clicked, update the entry in favorites and close the window. window.SaveButtonClicked += (s, e) => { favorites.UpdateById(location.Id, window.GetUpdate()); window.Close(); }; // When the delete button is clicked, delete the entry in favorites and close the window. window.DeleteButtonClicked += (s, e) => { favorites.DeleteById(location.Id); window.Close(); }; // When the cancel button is clicked, just close the window. window.CancelButtonClicked += (s, e) => window.Close(); window.DisplayFavoritesLocation(location.Name, location.Url.ToString()); window.Show(); }
public SlideShow (IFavorites favorites, Settings settings, IImageRepository imageRepository, ITimer timer) { _favorites = favorites; _imageRepository = imageRepository; Settings = settings; _timer = timer; _timer.Elapsed += HandleTimerElapsed; Settings = settings; _imagesIds = Settings.OnlyFavorites ? _favorites.GetFavoritesIds() : _imageRepository.GetImagesInfos ().Select (x => x.Id).ToList(); if (Settings.RandomOrder) { _imagesIds.Shuffle (); } else { // TODO: а сортировку по индексу забыла } }
public FavoritesPresenter(IFavorites favorites, IFavoriteRepository favoriteRepository) { Favorites = favorites; FavoriteRepository = favoriteRepository; Favorites.UpdateFavorites(FavoriteRepository.GetFavorites()); }
public MockTabPresenter(ITab tab, IFavorites favorites, IConfig config, IFavicon favicons, IHistory history, ITabHistory tabHistory) { this.Name = Guid.NewGuid().ToString(); tab.Name = this.Name; this._history = history; }
public RenameService(IFavorites favorites) { this.favorites = favorites; }
public TestRenameService(IFavorites favorites, Func<string, bool> askToOverWrite) : base(favorites) { this.askToOverWrite = askToOverWrite; }
private void UpdateFavorite(DbFavorite toUpdate, IFavorites targetPersistence) { toUpdate.Name += " Changed"; targetPersistence.Update(toUpdate); }
public RenameCopyService(IFavorites favorites) : base(favorites) { }
public FavoritesSearch(IFavorites favoritesSource, CancellationToken token, string searchText) { this.Token = token; this.favoritesSource = favoritesSource; this.criteria = this.ParseSearchText(searchText); }
internal void AssignServices(IPersistence persistence, ConnectionManager connectionManager) { this.favorites = persistence.Favorites; this.connectionManager = connectionManager; this.securityPanel1.AssignServices(persistence, this.settings); }
public void Setup() { this._favorites = this.CreateFavorites(); }
public TestRenameService(IFavorites favorites, Func <string, bool> askToOverWrite) : base(favorites) { this.askToOverWrite = askToOverWrite; }
private ModelConverterV1ToV2(IPersistence persistence, ConnectionManager connectionManager) : base(persistence, connectionManager) { this.favorites = persistence.Favorites; }
/// Constructor public UserApiController(IRoadwayCameras roadwaysCameras , IFavorites favorites) { _roadwaysCameras = roadwaysCameras; _favorates = favorites; }
public FavoriteController(IFavorites context) { _context = context; }