public LogsModel() { ClientAdapter = new ImageWebClient(); if (!ClientAdapter.Client.IsConnected) { ClientAdapter.Connect(); } this.logs = new List <LogMessage>(); ClientAdapter.NotifyOnMessage += this.OnMessage; this.ClientAdapter.GetLogs(); }
public ImageWebModel() { Client = new ImageWebClient(); if (!Client.Client.IsConnected) { Client.Connect(); } this.isConnected = Client.Client.IsConnected; this.numOfPhotos = this.countNumOfPhotosInDir(); this.students = new List <StudentDetails>(); this.readStudentsDetails(); }
public async Task <ActionResult> Index(string category = "") { log.Debug("Application starts"); ViewBag.Category = category; CategoryWebClient client = new CategoryWebClient(); List <Category> categories = await client.GetCategoriesAsync(); Search search = new Search(); search.Categories = categories; if (!string.IsNullOrEmpty(category)) { ImageWebClient imgClient = new ImageWebClient(); List <Image> images = await imgClient.GetImagesAsync(category, 12); search.Images = images; } return(View(search)); }