public Movie() { // Initialize ViewModels filterViewModel = new FilterViewModel(); settingViewModel = new SettingViewModel(); movieViewModels = new ObservableCollection <MovieViewModel>(); // Initialize services settingService = new SettingService(Constants.LocalDBPath); movieService = new MovieService(Constants.LocalDBPath); filterService = new FilterService(Constants.LocalDBPath); fileSizeService = new FileSizeService(Constants.LocalDBPath); fileTypeService = new FileTypeService(Constants.LocalDBPath); socketServer = new SocketServerService(); InitializeComponent(); // Set MovieViewModel and Show Loading startTaskSetMovieViewModel(); }
private async void setViewModel() { // Upload SQLite database through FTP await FTPServer.UploadDB(); // We use just one Setting (Get and Update this Setting) settingViewModel = SettingMap.MapToSettingViewModel(await settingService.GetSettingByIdAsync(1)); // Get movies and Start Socket Server if movies count more than 0 and not null await movieService.GetMoviesAsync().ContinueWith(async moviesResult => { movies = await moviesResult; if (movies != null && movies.Count > 0) { SocketServerService socketServer = new SocketServerService(); // Start Socket Server listen socketServer.StartServer(settingViewModel); } }); }
public ClientManager() { _socketServerService = new SocketServerService(); }