void ReleaseDesignerOutlets()
        {
            if (ActivityDescription != null)
            {
                ActivityDescription.Dispose();
                ActivityDescription = null;
            }

            if (ActivityImage != null)
            {
                ActivityImage.Dispose();
                ActivityImage = null;
            }

            if (ActivityName != null)
            {
                ActivityName.Dispose();
                ActivityName = null;
            }

            if (EditMetaButton != null)
            {
                EditMetaButton.Dispose();
                EditMetaButton = null;
            }

            if (FooterButton != null)
            {
                FooterButton.Dispose();
                FooterButton = null;
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> AddImage(ActivityImageViewModel model)
        {
            if (ModelState.IsValid)
            {
                var path = string.Empty;

                //se valida lo que envio IFormFile
                if (model.ImageFile != null)
                {
                    path = await _imageHelper.UploadImageAsync(model.ImageFile);
                }

                var activityImage = new ActivityImage
                {
                    ImageUrl = path,
                    Activity = await _dataContext.Activities.FindAsync(model.Id)
                };

                _dataContext.ActivityImages.Add(activityImage);
                await _dataContext.SaveChangesAsync();

                return(RedirectToAction($"{nameof(DetailsActivity)}/{model.Id}"));
            }

            return(View(model));
        }
        private static async Task <string> ScreenCapture(IDurableOrchestrationContext context, Week week)
        {
            var imageData = await context.CallActivityAsync <byte[]>("CaptureActivityImage", week);

            var activityImage = new ActivityImage
            {
                Week      = week,
                ImageData = imageData
            };

            return(await context.CallActivityAsync <string>("WriteActivityImage", activityImage));
        }