Exemplo n.º 1
0
		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);
 }
Exemplo n.º 3
0
 public FavoriteRenameCommand(IPersistence persistence, IRenameService service)
 {
     this.persistence = persistence;
     this.service     = service;
     this.favorites   = persistence.Favorites;
     this.validator   = new FavoriteNameValidator(this.persistence);
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 6
0
        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 ...");
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        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 ...");
            }
        }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
        /// <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();
        }
Exemplo n.º 12
0
		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: а сортировку по индексу забыла
			}
		}
Exemplo n.º 13
0
 public FavoritesPresenter(IFavorites favorites, IFavoriteRepository favoriteRepository)
 {
     Favorites          = favorites;
     FavoriteRepository = favoriteRepository;
     Favorites.UpdateFavorites(FavoriteRepository.GetFavorites());
 }
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
 public RenameService(IFavorites favorites)
 {
     this.favorites = favorites;
 }
 public TestRenameService(IFavorites favorites, Func<string, bool> askToOverWrite)
     : base(favorites)
 {
     this.askToOverWrite = askToOverWrite;
 }
Exemplo n.º 17
0
 private void UpdateFavorite(DbFavorite toUpdate, IFavorites targetPersistence)
 {
     toUpdate.Name += " Changed";
     targetPersistence.Update(toUpdate);
 }
 public RenameCopyService(IFavorites favorites)
     : base(favorites)
 {
 }
Exemplo n.º 19
0
 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);
 }
Exemplo n.º 21
0
 public void Setup()
 {
     this._favorites = this.CreateFavorites();
 }
Exemplo n.º 22
0
 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);
 }
Exemplo n.º 24
0
 private ModelConverterV1ToV2(IPersistence persistence, ConnectionManager connectionManager)
     : base(persistence, connectionManager)
 {
     this.favorites = persistence.Favorites;
 }
Exemplo n.º 25
0
 /// Constructor
 public UserApiController(IRoadwayCameras roadwaysCameras
                          , IFavorites favorites)
 {
     _roadwaysCameras = roadwaysCameras;
     _favorates       = favorites;
 }
Exemplo n.º 26
0
 public RenameCopyService(IFavorites favorites)
     : base(favorites)
 {
 }
Exemplo n.º 27
0
 public RenameService(IFavorites favorites)
 {
     this.favorites = favorites;
 }
Exemplo n.º 28
0
 public FavoritesSearch(IFavorites favoritesSource, CancellationToken token, string searchText)
 {
     this.Token           = token;
     this.favoritesSource = favoritesSource;
     this.criteria        = this.ParseSearchText(searchText);
 }
Exemplo n.º 29
0
 public FavoriteController(IFavorites context)
 {
     _context = context;
 }