protected void SetUp()
 {
     Log     = new LogImpl();
     FavRepo = new TestFavoritesRepository();
     UseCase = new AddToFavoriteUseCase(Log, FavRepo);
     TestFavoritesRepository.Registry.Clear();
 }
		public SearchListXaml ()
		{
			InitializeComponent ();

			var task = Task.Run(async () => {
				favoritesRepository = await XmlFavoritesRepository.OpenFile ("XamarinFavorites.xml");
			});
			task.Wait();

			search = new Search ("test");
			viewModel = new SearchViewModel (App.Service, search);

			viewModel.SearchCompleted += (sender, e) => {
				if (viewModel.Groups == null) {
					listView.ItemsSource = new string [1];
				} else {
					listView.ItemsSource = viewModel.Groups;
				}
			};

			viewModel.Error += (sender, e) => {
				DisplayAlert ("Error", e.Exception.Message, "OK", null);
			};

			BindingContext = viewModel;
		}
示例#3
0
 public FavoritesService(
     ICategoriesRepository categoriesRepository,
     IFavoritesRepository favoritesRepository)
 {
     _categoriesRepository = categoriesRepository;
     _favoritesRepository  = favoritesRepository;
 }
        public SearchListXaml()
        {
            InitializeComponent();

            var task = Task.Run(async() => {
                favoritesRepository = await XmlFavoritesRepository.OpenFile("XamarinFavorites.xml");
            });

            task.Wait();

            search    = new Search("test");
            viewModel = new SearchViewModel(App.Service, search);

            viewModel.SearchCompleted += (sender, e) => {
                if (viewModel.Groups == null)
                {
                    listView.ItemsSource = new string [1];
                }
                else
                {
                    listView.ItemsSource = viewModel.Groups;
                }
            };

            viewModel.Error += (sender, e) => {
                DisplayAlert("Error", e.Exception.Message, "OK", null);
            };

            BindingContext = viewModel;
        }
示例#5
0
 protected void SetUp()
 {
     Config = new TestConfiguration();
     WebApi = new TestWebApi(Config);
     LibraryItemDataMapper = new LibraryItemDataMapper(Config);
     FavoritesRepo         = new TestFavoritesRepository();
     Repo = new LibraryRepositoryImpl(WebApi, LibraryItemDataMapper, FavoritesRepo);
 }
示例#6
0
 public static void RegisterFavoritesRepository(IFavoritesRepository favoritesRepository)
 {
     if (favoritesRepository == null)
     {
         throw new ArgumentNullException("favoritesRepository");
     }
     _favoritesRepository = favoritesRepository;
 }
示例#7
0
        public DocumentModule(IRepository documents, IImageRepository images, IRatingRepository ratings, IReviewRepository reviews, IFavoritesRepository favorites, IEnvironmentPathProvider pathProvider)
            : base("/documents")
        {
            Get["/{id}/thumbnail"] = args =>
            {
                var doc = documents.GetDocument(args.id, true);
                string img = images.GetDocumentImage(args.id);

                if (String.IsNullOrEmpty(img))
                {
                    return ResolvePlaceHolderImageForDocumentType(pathProvider, doc);
                }

                return Response.AsFile(Path.Combine(pathProvider.GetImageCachePath(), img));
            };

            Get["/{id}"] = args =>
            {
                Document document = documents.GetDocument(args.id, false);
                return Response.AsJson(DtoMaps.Map(document, favorites, Context.GetUserInfo()));
            };
            
            Get["/{id}/rating"] = args =>
            {
                try
                {
                    DocumentRating rating = ratings.GetDocumentRating(args.id);

                    return Response.AsJson(new DocumentRatingDto
                    {
                        MaxScore = rating.MaxScore,
                        Score = rating.Score,
                        Source = rating.Source,
                        SourceUrl = rating.SourceUrl,
                        HasRating = true
                    }).AsCacheable(DateTime.Now.AddDays(1));
                }
                catch
                {
                    return new DocumentRatingDto {Success = true, HasRating = false};
                }
            };

            Get["/{id}/review"] = args =>
            {
                string review = reviews.GetDocumentReview(args.id);
                return Response.AsJson(new DocumentReviewDto{ Review = review, Url = "" }).AsCacheable(DateTime.Now.AddDays(1));
            };

            Get["/search"] = _ =>
            {
                string query = Request.Query.query.HasValue ? Request.Query.query : null;

                if (null == query) throw new InvalidOperationException("Ingenting å søke etter.");

                return Response.AsJson(documents.Search(query).Select(doc => DtoMaps.Map(doc, favorites, Context.GetUserInfo())).ToArray()).AsCacheable(DateTime.Now.AddHours(12));
            };
        }
示例#8
0
 protected void SetUp()
 {
     Log    = new LogImpl();
     Config = new TestConfiguration();
     WebApi = new TestWebApi(Config);
     LibraryItemDataMapper = new LibraryItemDataMapper(Config);
     FavoritesRepo         = new TestFavoritesRepository();
     Repo    = new LibraryRepositoryImpl(WebApi, LibraryItemDataMapper, FavoritesRepo);
     UseCase = new SearchLibraryRequestUseCase(Log, Repo);
 }
示例#9
0
        public CurrentGasPricesViewModel(IMessageService messageService,
                                         IFavoritesRepository favoritesRepository,
                                         IEventAggregator eventAggregator)
        {
            _messageService      = messageService;
            _favoritesRepository = favoritesRepository;
            _eventAggregator     = eventAggregator;

            CreateGasPriceInfoProxy = () => new SpritpreisrechnerProxy();
        }
        public CurrentGasPricesViewModel(IMessageService messageService, 
            IFavoritesRepository favoritesRepository,
            IEventAggregator eventAggregator)
        {
            _messageService = messageService;
            _favoritesRepository = favoritesRepository;
            _eventAggregator = eventAggregator;

            CreateGasPriceInfoProxy = () => new SpritpreisrechnerProxy();
        }
        public PersonViewController(Person person, IFavoritesRepository favoritesRepository)
            : base(UITableViewStyle.Grouped)
        {
            personViewModel = new PersonViewModel (person, favoritesRepository);

            Title = person.SafeFirstName;

            TableView.DataSource = new PersonDataSource (this);
            TableView.Delegate = new PersonDelegate (this);
        }
        public PersonViewController(Person person, IFavoritesRepository favoritesRepository)
            : base(UITableViewStyle.Grouped)
        {
            personViewModel = new PersonViewModel(person, favoritesRepository);

            Title = person.SafeFirstName;

            TableView.DataSource = new PersonDataSource(this);
            TableView.Delegate   = new PersonDelegate(this);
        }
示例#13
0
        public static DocumentDto Map(Document document, IFavoritesRepository favorites, UserInfo user)
        {
            DocumentDto dto;

            if (document is Book)
            {
                dto = Map((Book)document);
            }
            else if (document is Film)
            {
                dto = Map((Film) document);
            }
            else if (document is Cd)
            {
                dto = Map((Cd) document);
            }
            else if (document is AudioBook)
            {
                dto = Map((AudioBook) document);
            }
            else if (document is SheetMusic)
            {
                dto = Map((SheetMusic) document);
            }
            else if (document is Game)
            {
                dto = Map((Game) document);
            }
            else if (document is Journal)
            {
                dto = Map((Journal) document);
            }
            else
            {
                dto = new DocumentDto(); // todo other types
            }


            dto.WebAppUrl = Bootstrapper.Container != null ? Bootstrapper.Container.Resolve<IEnvironmentPathProvider>().GetWebAppDocumentDetailsPath(document) : string.Empty;
            dto.Id = document.DocumentNumber;
            dto.Type = document.DocType;
            dto.Title = document.Title;
            if(null == dto.SubTitle) dto.SubTitle = document.CompressedSubTitle; // default only if specific type does not map it
            dto.Availability = MapAvailability(document).ToArray();
            dto.Year = document.PublishedYear;
            dto.Publisher = document.Publisher;
            dto.Language = document.Language;
            dto.Languages = null != document.Languages ? document.Languages.ToArray() : new string[0];
            if(null != user && null != favorites) dto.IsFavorite = favorites.IsFavorite(document, user);
            if (null != user) dto.IsReserved = null != user.Reservations && user.Reservations.Any(r => r.DocumentNumber == document.DocumentNumber);

            return dto;
        }
示例#14
0
        public override void OnCreate()
        {
            base.OnCreate ();

            using (var reader = new System.IO.StreamReader (Assets.Open ("XamarinDirectory.csv")))
                Service = new MemoryDirectoryService (new CsvReader<Person> (reader).ReadAll ());

            var filePath = Path.Combine (System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal), "XamarinFavorites.xml");
            using (var stream = Assets.Open ("XamarinFavorites.xml"))
                using (var filestream = File.Open (filePath, FileMode.Create))
                    stream.CopyTo (filestream);

            repo = XmlFavoritesRepository.OpenFile (filePath);
        }
		public FavoritesViewModel (IFavoritesRepository favoritesRepository, bool groupByLastName)
		{
			if (favoritesRepository == null)
				throw new ArgumentNullException ("favoritesRepository");

			this.favoritesRepository = favoritesRepository;
			this.groupByLastName = groupByLastName;

			CreateGroups ();

			favoritesRepository.Changed += delegate {
				CreateGroups ();
			};
		}
示例#16
0
        public override void OnCreate()
        {
            base.OnCreate();

            using (var reader = new System.IO.StreamReader(Assets.Open("XamarinDirectory.csv")))
                Service = new MemoryDirectoryService(new CsvReader <Person> (reader).ReadAll());

            var filePath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "XamarinFavorites.xml");

            using (var stream = Assets.Open("XamarinFavorites.xml"))
                using (var filestream = File.Open(filePath, FileMode.Create))
                    stream.CopyTo(filestream);

            repo = XmlFavoritesRepository.OpenFile(filePath);
        }
        public FavoritesViewModel(IFavoritesRepository favoritesRepository, bool groupByLastName)
        {
            if (favoritesRepository == null)
            {
                throw new ArgumentNullException("favoritesRepository");
            }

            this.favoritesRepository = favoritesRepository;
            this.groupByLastName     = groupByLastName;

            CreateGroups();

            favoritesRepository.Changed += delegate {
                CreateGroups();
            };
        }
		protected async override void OnAppearing ()
		{
			base.OnAppearing ();

			if (LoginViewModel.ShouldShowLogin (App.LastUseTime))
				await Navigation.PushModalAsync (new LoginView ());

			favoritesRepository = await XmlFavoritesRepository.OpenIsolatedStorage ("XamarinFavorites.xml");

			if (favoritesRepository.GetAll ().Count () == 0)
				favoritesRepository = await XmlFavoritesRepository.OpenFile ("XamarinFavorites.xml");

			viewModel = new FavoritesViewModel (favoritesRepository, true);
			listView.ItemsSource = viewModel.Groups;
			SetToolbarItems (true);
		}
        public FavoritesViewController(IFavoritesRepository favoritesRepository, IDirectoryService service, Search savedSearch)
        {
            this.favoritesRepository = favoritesRepository;

            Title = "Favorites";

            viewModel = new FavoritesViewModel(favoritesRepository, groupByLastName: true);
            viewModel.PropertyChanged += HandleViewModelPropertyChanged;

            searchViewModel = new SearchViewModel(service, savedSearch);

            //
            // Configure this view
            //
            var favoritesDelegate = new PeopleGroupsDelegate(TableView);

            favoritesDelegate.PersonSelected += HandlePersonSelected;

            TableView.DataSource = new PeopleGroupsDataSource(viewModel.Groups);
            TableView.Delegate   = favoritesDelegate;
            TableView.SectionIndexMinimumDisplayRowCount = 10;

            //
            // Configure the search bar
            //
            searchBar = new UISearchBar(new CGRect(0, 0, 320, 44))
            {
                ShowsScopeBar = true,
            };

            searchBar.ScopeButtonTitles        = new[] { "Name", "Title", "Dept", "All" };
            searchBar.SelectedScopeButtonIndex = (int)savedSearch.Property;
            searchController = new UISearchDisplayController(searchBar, this)
            {
                SearchResultsDataSource = new PeopleGroupsDataSource(searchViewModel.Groups),
                Delegate = new SearchDisplayDelegate(searchViewModel)
            };

            var searchDelegate = new PeopleGroupsDelegate(searchController.SearchResultsTableView);

            searchController.SearchResultsTableView.SectionIndexMinimumDisplayRowCount = 10;
            searchDelegate.PersonSelected         += HandleSearchPersonSelected;
            searchController.SearchResultsDelegate = searchDelegate;

            TableView.TableHeaderView = searchBar;
        }
		private void InitializeViewModel ()
		{
			var task = Task.Run(async () => {
				favoritesRepository = await XmlFavoritesRepository.OpenFile ("XamarinFavorites.xml");
			});
			task.Wait();

			search = new Search (string.Empty);
			viewModel = new SearchViewModel (App.Service, search);

			viewModel.SearchCompleted += OnSearchCompleted;
			viewModel.Error += (sender, e) => {
				DisplayAlert ("Help", e.Exception.Message, "OK", null);
			};

			BindingContext = viewModel;
		}
示例#21
0
        public MainViewModel(INavigationService navigationService,
                             ILocationService locationService,
                             IMessageService messageService,
                             IFavoritesRepository favoritesRepository)
        {
            _navigationService   = navigationService;
            _locationService     = locationService;
            _messageService      = messageService;
            _favoritesRepository = favoritesRepository;

            CreateGeocodeProxy = () => new NominatimProxy();

            InitializeAbout();

            SearchByLocation = true;

            RemoveFavoriteCommand = new RelayCommand <Favorite>(async(f) => await RemoveFavorite(f));
        }
        public MainViewModel(INavigationService navigationService, 
            ILocationService locationService,
            IMessageService messageService, 
            IFavoritesRepository favoritesRepository)
        {
            _navigationService = navigationService;
            _locationService = locationService;
            _messageService = messageService;
            _favoritesRepository = favoritesRepository;

            CreateGeocodeProxy = () => new NominatimProxy();

            InitializeAbout();

            SearchByLocation = true;

            RemoveFavoriteCommand = new RelayCommand<Favorite>(async (f) => await RemoveFavorite(f));
        }
        private void InitializeViewModel()
        {
            var task = Task.Run(async() => {
                favoritesRepository = await XmlFavoritesRepository.OpenFile("XamarinFavorites.xml");
            });

            task.Wait();

            search    = new Search(string.Empty);
            viewModel = new SearchViewModel(App.Service, search);

            viewModel.SearchCompleted += OnSearchCompleted;
            viewModel.Error           += (sender, e) => {
                DisplayAlert("Help", e.Exception.Message, "OK", null);
            };

            BindingContext = viewModel;
        }
示例#24
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            if (LoginViewModel.ShouldShowLogin(App.LastUseTime))
            {
                await Navigation.PushModalAsync(new LoginView());
            }

            favoritesRepository = await XmlFavoritesRepository.OpenIsolatedStorage("XamarinFavorites.xml");

            if (favoritesRepository.GetAll().Count() == 0)
            {
                favoritesRepository = await XmlFavoritesRepository.OpenFile("XamarinFavorites.xml");
            }

            viewModel            = new FavoritesViewModel(favoritesRepository, true);
            listView.ItemsSource = viewModel.Groups;
        }
        public FavoritesViewController(IFavoritesRepository favoritesRepository, IDirectoryService service, Search savedSearch)
        {
            this.favoritesRepository = favoritesRepository;

            Title = "Favorites";

            viewModel = new FavoritesViewModel (favoritesRepository, groupByLastName: true);
            viewModel.PropertyChanged += HandleViewModelPropertyChanged;

            searchViewModel = new SearchViewModel (service, savedSearch);

            //
            // Configure this view
            //
            var favoritesDelegate = new PeopleGroupsDelegate (TableView);
            favoritesDelegate.PersonSelected += HandlePersonSelected;

            TableView.DataSource = new PeopleGroupsDataSource (viewModel.Groups);
            TableView.Delegate = favoritesDelegate;
            TableView.SectionIndexMinimumDisplayRowCount = 10;

            //
            // Configure the search bar
            //
            searchBar = new UISearchBar (new CGRect (0f, 0f, 320f, 44f)) {
                ShowsScopeBar = true,
            };

            searchBar.ScopeButtonTitles = new[] { "Name", "Title", "Dept", "All" };
            searchBar.SelectedScopeButtonIndex = (int)savedSearch.Property;
            searchController = new UISearchDisplayController (searchBar, this) {
                SearchResultsDataSource = new PeopleGroupsDataSource (searchViewModel.Groups),
                Delegate = new SearchDisplayDelegate (searchViewModel)
            };

            var searchDelegate = new PeopleGroupsDelegate (searchController.SearchResultsTableView);
            searchController.SearchResultsTableView.SectionIndexMinimumDisplayRowCount = 10;
            searchDelegate.PersonSelected += HandleSearchPersonSelected;
            searchController.SearchResultsDelegate = searchDelegate;

            TableView.TableHeaderView = searchBar;
        }
		protected async override void OnAppearing ()
		{
			base.OnAppearing ();

			if (LoginViewModel.ShouldShowLogin (App.LastUseTime)) {
				Navigation.PushModalAsync (new LoginXaml ());
			}

			//
			// Load the favorites
			//
			favoritesRepository = await XmlFavoritesRepository.OpenIsolatedStorage ("XamarinFavorites.xml");

			if (favoritesRepository.GetAll ().Count () == 0) {
				favoritesRepository = await XmlFavoritesRepository.OpenFile ("XamarinFavorites.xml");
			}

			viewModel = new FavoritesViewModel (favoritesRepository, false);

			listView.ItemsSource = viewModel.Groups;
		}
示例#27
0
        public SearchListXaml(SearchProperty filter, string title)
        {
            InitializeComponent();
            On <iOS>().SetUseSafeArea(true);
            Title = title;

            var task = Task.Run(async() => {
                favoritesRepository = await XmlFavoritesRepository.OpenFile("XamarinFavorites.xml");
            });

            task.Wait();

            search = new Search("test", filter);

            /*if( filter != SearchProperty.Personen && filter != SearchProperty.Alle)
             * {
             *      listView.GroupShortNameBinding = null;
             * }*/

            viewModel = new SearchViewModel(App.Service, search);

            viewModel.SearchCompleted += (sender, e) => {
                if (viewModel.Groups == null)
                {
                    listView.ItemsSource = new string [1];
                }
                else
                {
                    listView.ItemsSource = viewModel.Groups;
                }
            };

            viewModel.Error += (sender, e) => {
                DisplayAlert("Error", e.Exception.Message, "OK", null);
            };

            BindingContext = viewModel;
        }
示例#28
0
        public FavoritesModule(IFavoritesRepository favorites, IRepository documents)
            : base("/favorites")
        {
            this.RequiresAuthentication();

            Get["/"] = _ => favorites.GetFavorites(Context.GetUserInfo()).Select(MapToDto).ToArray();

            Delete["/{documentId}"] = args =>
            {
                var document = documents.GetDocument(args.documentId, true);

                favorites.RemoveFavorite(document, Context.GetUserInfo());
                
                return new RequestReplyDto { Success = true };
            };

            Put["/{documentId}"] = args =>
            {
                var document = documents.GetDocument(args.documentId, true);
                favorites.AddFavorite(document, Context.GetUserInfo());

                return new RequestReplyDto { Success = true };
            };
        }
示例#29
0
 public FavoritesService(IFavoritesRepository repo)
 {
     _repo = repo;
 }
示例#30
0
 public HomeController(IFavoritesRepository repo)
 {
     repository = repo;
 }
 public FavoritesController(IFavoritesRepository repo, UserManager <AppUser> userMgr)
 {
     repository  = repo;
     userManager = userMgr;
 }
示例#32
0
        public FaveViewModel(
            IFavoritesRepository favoritesReposirory,
            IFactoryService factoryService)
        {
            (IsEmpty, IsLoading) = (false, true);
            var longDatePattern = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;

            Items = new ObservableCollection <ObservableGrouping <string, ArticleViewModel> >();
            Load  = new ObservableCommand(async() =>
            {
                IsLoading.Value = true;
                var articles    = await favoritesReposirory.GetAllAsync();
                Items.Clear();
                var groupings = articles
                                .Select(i => factoryService.CreateInstance <ArticleViewModel>(i))
                                .OrderByDescending(i => i.PublishedDate.Value)
                                .GroupBy(i => i.PublishedDate.Value.ToString(longDatePattern))
                                .Select(i => new ObservableGrouping <string, ArticleViewModel>(i))
                                .ToList();

                groupings.ForEach(Items.Add);
                foreach (var grouping in groupings)
                {
                    foreach (var viewModel in grouping)
                    {
                        viewModel.IsFavorite.PropertyChanged += (o, args) => RemoveOrRestore(viewModel);
                    }
                }

                IsEmpty.Value   = Items.Count == 0;
                IsLoading.Value = false;
            });
            OrderByDate = new ObservableCommand(() =>
            {
                IsLoading.Value = true;
                var groupings   = Items
                                  .SelectMany(i => i)
                                  .OrderByDescending(i => i.PublishedDate.Value)
                                  .GroupBy(i => i.PublishedDate.Value.ToString(longDatePattern))
                                  .Select(i => new ObservableGrouping <string, ArticleViewModel>(i))
                                  .ToList();

                Items.Clear();
                groupings.ForEach(Items.Add);
                IsLoading.Value = false;
            });
            OrderByFeed = new ObservableCommand(() =>
            {
                IsLoading.Value = true;
                var groupings   = Items
                                  .SelectMany(i => i)
                                  .OrderBy(i => i.Feed.Value)
                                  .GroupBy(i => i.Feed.Value.ToString())
                                  .Select(i => new ObservableGrouping <string, ArticleViewModel>(i))
                                  .ToList();

                Items.Clear();
                groupings.ForEach(Items.Add);
                IsLoading.Value = false;
            });
            void RemoveOrRestore(ArticleViewModel viewModel)
            {
                if (!viewModel.IsFavorite.Value)
                {
                    var related = Items.First(i => i.Contains(viewModel));
                    related.Remove(viewModel);
                    if (related.Count == 0)
                    {
                        Items.Remove(related);
                    }
                }
                else
                {
                    const string restored = "*Restored";
                    var          existing = Items.FirstOrDefault(i => i.Key == restored);
                    if (existing == null)
                    {
                        Items.Add(new ObservableGrouping <
                                      string, ArticleViewModel>(restored, new[] { viewModel }));
                    }
                    else
                    {
                        existing.Add(viewModel);
                    }
                }
            }
        }
示例#33
0
        public PersonViewModel(Person person, IFavoritesRepository favoritesRepository)
        {
            if (person == null)
            {
                throw new ArgumentNullException("person");
            }
            if (favoritesRepository == null)
            {
                throw new ArgumentNullException("favoritesRepository");
            }

            Person = person;
            this.favoritesRepository = favoritesRepository;

            PropertyGroups = new ObservableCollection <PropertyGroup> ();

            var general = new PropertyGroup("General");

            general.Add("Title", person.Title, PropertyType.Generic);
            general.Add("Department", person.Department, PropertyType.Generic);
            general.Add("Company", person.Company, PropertyType.Generic);
            general.Add("Manager", person.Manager, PropertyType.Generic);
            general.Add("Description", person.Description, PropertyType.Generic);
            if (general.Properties.Count > 0)
            {
                PropertyGroups.Add(general);
            }

            var phone = new PropertyGroup("Phone");

            foreach (var p in person.TelephoneNumbers)
            {
                phone.Add("Phone", p, PropertyType.Phone);
            }
            foreach (var p in person.HomeNumbers)
            {
                phone.Add("Home", p, PropertyType.Phone);
            }
            foreach (var p in person.MobileNumbers)
            {
                phone.Add("Mobile", p, PropertyType.Phone);
            }
            if (phone.Properties.Count > 0)
            {
                PropertyGroups.Add(phone);
            }

            var online = new PropertyGroup("Online");

            online.Add("Email", person.Email, PropertyType.Email);
            online.Add("WebPage", CleanUrl(person.WebPage), PropertyType.Url);
            online.Add("Twitter", CleanTwitter(person.Twitter), PropertyType.Twitter);
            if (online.Properties.Count > 0)
            {
                PropertyGroups.Add(online);
            }

            var address = new PropertyGroup("Address");

            address.Add("Office", person.Office, PropertyType.Generic);
            address.Add("Address", AddressString, PropertyType.Address);
            if (address.Properties.Count > 0)
            {
                PropertyGroups.Add(address);
            }
        }
示例#34
0
 public FavoritesController(IFavoritesRepository favoritesRepository)
 {
     _favoritesRepository = favoritesRepository;
 }
示例#35
0
 public HomeController(ITwitterClient client, IFavoritesRepository favoritesRepository)
 {
     this.client = client;
     this.favoritesRepository = favoritesRepository;
 }
示例#36
0
 public FavoritesController(IFavoritesRepository repo)
 {
     this.repo = repo;
 }
示例#37
0
 public FavoritesController(IFavoritesRepository favorites, IMapper mapper, IUsersRepository user)
 {
     _favorites = favorites;
     _mapper    = mapper;
     _user      = user;
 }
示例#38
0
 public AddToFavoriteUseCase(ILog log, IFavoritesRepository favoritesRepository)
 {
     Log = log;
     FavoritesRepository = favoritesRepository;
 }
示例#39
0
 public FavoritesService(IFavoritesRepository favoritesRepository)
 {
     this.favoritesRepository = favoritesRepository;
     baseDal = favoritesRepository;
 }
示例#40
0
        public PersonViewModel(Person person, IFavoritesRepository favoritesRepository)
        {
            if (person == null)
            {
                throw new ArgumentNullException("person");
            }

            if (favoritesRepository == null)
            {
                throw new ArgumentNullException("favoritesRepository");
            }

            Person = person;
            FavoritesRepository = favoritesRepository;

            PropertyGroups = new ObservableCollection <PropertyGroup> ();

            var general = new PropertyGroup("Allgemein");

            general.Add("Anzeigename", person.Anzeigename, PropertyType.Generic);
            general.Add("Klinik / Ort", person.KlinikOrt, PropertyType.Generic);
            general.Add("Bereich", person.Bereich, PropertyType.Generic);
            general.Add("Bezeichnung", person.Bezeichnung, PropertyType.Generic);
            general.Add("Name", person.Name, PropertyType.Generic);
            general.Add("Vorname", person.Vorname, PropertyType.Generic);
            general.Add("Funktion", person.Funktion, PropertyType.Generic);
            general.Add("Organisation", person.Organisation, PropertyType.Generic);
            general.Add("Personalbereich", person.Personalbereich, PropertyType.Generic);
            general.Add("Arbeitsort", person.Arbeitsort, PropertyType.Generic);
            general.Add("Benutzername", person.Benutzername, PropertyType.Generic);
            general.Add("Titel", person.Titel, PropertyType.Generic);

            if (general.Properties.Count > 0)
            {
                PropertyGroups.Add(general);
            }

            var phone = new PropertyGroup("Telefon");

            phone.Add("Hauptnummer", person.Hauptnummer1, PropertyType.Phone);
            phone.Add("Telefon", person.Telefon, PropertyType.Phone);
            phone.Add("Mobil", person.Mobil, PropertyType.Phone);
            phone.Add("Mobil (Direktwahl)", person.SMS, PropertyType.Phone);
            phone.Add("SMS", person.SMS, PropertyType.Sms);
            phone.Add("Alternativnummer", person.Telefon2, PropertyType.Phone);
            phone.Add("Alternativnummer", person.Hauptnummer2, PropertyType.Phone);
            phone.Add("Sucher", person.Sucher, PropertyType.Phone);
            phone.Add("Sekretariat", person.TelefonSekretariat, PropertyType.Phone);
            phone.Add("Fax", person.Fax, PropertyType.Phone);
            phone.Add("E-Mail", person.Email, PropertyType.Email);

            if (phone.Properties.Count > 0)
            {
                PropertyGroups.Add(phone);
            }

            var details = new PropertyGroup("Details");

            details.Add("Details", person.Details, PropertyType.Generic);
            details.Add("Arbeitsort", person.Arbeitsort, PropertyType.Generic);
            details.Add("Postadresse", person.Postadresse, PropertyType.Generic);
            if (details.Properties.Count > 0)
            {
                PropertyGroups.Add(details);
            }
        }
示例#41
0
 public TwitterClient(IConfigurationReader configuration, IFavoritesRepository favoritesRepository)
 {
     _configuration       = configuration;
     _favoritesRepository = favoritesRepository;
 }
示例#42
0
 public LibraryRepositoryImpl(IWebApi webApi, LibraryItemDataMapper mapper, IFavoritesRepository favoritesRepository)
 {
     WebApi = webApi;
     FavoritesRepository = favoritesRepository;
     DataMapper          = mapper;
 }
 public FavoriteService(IFavoritesRepository favRepo, ICategoryServices categoryService, ICoordinateService coordinateService)
 {
     _favRepo           = favRepo;
     _categoryService   = categoryService;
     _coordinateService = coordinateService;
 }