public override void Cleanup()
 {
     StopDownloadingMovie();
     CancellationDownloadingMovieToken?.Dispose();
     MovieSettings?.Cleanup();
     base.Cleanup();
 }
Beispiel #2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method
            var             client = new StorageClient();
            ImageDownloader down   = new ImageDownloader(client);

            this.Window = new UIWindow(UIScreen.MainScreen.Bounds);
            MovieSettings ApiConnection                  = new MovieSettings();
            DownloadImage download                       = new DownloadImage(down);
            MovieService  ApiService                     = new MovieService(download);
            var           MovieSearchController          = new MovieController(ApiConnection, ApiService);
            var           MovieSearchNavigationControler = new UINavigationController(MovieSearchController);
            var           MovieRatedController           = new RatedController(ApiConnection, ApiService);
            var           MovieRatedNavigationController = new UINavigationController(MovieRatedController);


            var movieTabController = new MovieTabController()
            {
                ViewControllers = new UIViewController[] { MovieSearchNavigationControler, MovieRatedNavigationController }
            };

            this.Window.RootViewController = movieTabController;

            this.Window.MakeKeyAndVisible();
            return(true);
        }
Beispiel #3
0
 public void ConfigureServices(IServiceCollection services)
 {
     #region snippet_BindToObjectGraph
     var moviesConfig = new MovieSettings();
     Configuration.GetSection("Movies").Bind(moviesConfig);
     _moviesApiKey = moviesConfig.ServiceApiKey;
     #endregion
 }
Beispiel #4
0
 public MovieClient(HttpClient httpClient,
                    IStorage <Movie> movieMemoryStorage,
                    MovieSettings movieSettings)
 {
     _httpClient         = httpClient;
     _movieSettings      = movieSettings;
     _movieMemoryStorage = movieMemoryStorage;
 }
Beispiel #5
0
 public AuthService(HttpClient httpClient, MovieSettings movieSettings)
 {
     _httpClient    = httpClient;
     _movieSettings = movieSettings;
 }
 public TopRatedViewController(MovieSettings ApiConnection, MovieService ApiService)
 {
     _apiConnection = ApiConnection;
     _apiService    = ApiService;
 }
Beispiel #7
0
        public void Post([FromBody] Movie value)
        {
            MovieSettings moviepost = new MovieSettings();

            moviepost.Add(value);
        }
Beispiel #8
0
        public List <Movie> Get()
        {
            MovieSettings set = new MovieSettings();

            return(set.library());
        }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Startup"/> class.
 /// </summary>
 ///
 /// <param name="configuration">The configuration.</param>
 public Startup(IConfiguration configuration)
 {
     this.Configuration = configuration;
     this.MovieSettings = configuration.Get <MovieSettings>();
 }
Beispiel #10
0
 public MovieController(MovieSettings ApiConnection, MovieService ApiService)
 {
     _apiConnection  = ApiConnection;
     _apiService     = ApiService;
     this.TabBarItem = new UITabBarItem(UITabBarSystemItem.Search, 0);
 }
Beispiel #11
0
 public RatedController(MovieSettings ApiConnection, MovieService ApiService)
 {
     _apiConnection  = ApiConnection;
     _apiService     = ApiService;
     this.TabBarItem = new UITabBarItem(UITabBarSystemItem.TopRated, 0);
 }