Ejemplo n.º 1
0
 public LogsModel()
 {
     ClientAdapter = new ImageWebClient();
     if (!ClientAdapter.Client.IsConnected)
     {
         ClientAdapter.Connect();
     }
     this.logs = new List <LogMessage>();
     ClientAdapter.NotifyOnMessage += this.OnMessage;
     this.ClientAdapter.GetLogs();
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
        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));
        }