示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagesService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="imageService">The image service.</param>
 public ImagesService(IRepository repository, IMediaFileUrlResolver fileUrlResolver, IImageService imageService, IUploadImageService uploadImageService)
 {
     this.repository      = repository;
     this.fileUrlResolver = fileUrlResolver;
     this.imageService    = imageService;
     Upload = uploadImageService;
 }
 protected GenericImageUploadController(IRepository<Immagine> repository, IImageBlobManager blobManager,
     IUploadImageService service)
 {
     _repository = repository;
     _blobManager = blobManager;
     _service = service;
 }
 public ApplicationPricesService(IMapper mapper, IEmailService emailService, IUsersService usersService, ICookieService cookieService, IUploadImageService uploadImageService)
 {
     _usersService       = usersService;
     _mapper             = mapper;
     _emailService       = emailService;
     _cookieService      = cookieService;
     _uploadImageService = uploadImageService;
 }
 public ImportBillService(
     DataContext context,
     IUploadImageService uploadImageService
     )
 {
     _context            = context;
     _uploadImageService = uploadImageService;
 }
示例#5
0
 public ProjectsController(
     IUnitOfWork unitOfWork,
     IUploadImageService uploadImageService
     )
 {
     _unitOfWork         = unitOfWork;
     _uploadImageService = uploadImageService;
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagesService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="imageService">The image service.</param>
 public ImagesService(IRepository repository, IMediaFileUrlResolver fileUrlResolver, IImageService imageService, IUploadImageService uploadImageService, ICategoryService categoryService)
 {
     this.repository = repository;
     this.fileUrlResolver = fileUrlResolver;
     this.imageService = imageService;
     this.categoryService = categoryService;
     Upload = uploadImageService;
 }
示例#7
0
 public PaymentService(IMapper mapper, IEmailService emailService, IUsersService usersService, ICookieService cookieService, IUploadImageService uploadImageService, IApplicationPricesService applicationPricesService, IBasketService basketService, IDefaultValuesService defaultValuesService, ICountersService countersService, HttpContext httpContext, IAgreementService agreementService)
 {
     _usersService             = usersService;
     _mapper                   = mapper;
     _emailService             = emailService;
     _cookieService            = cookieService;
     _uploadImageService       = uploadImageService;
     _applicationPricesService = applicationPricesService;
     _basketService            = basketService;
     _defaultValuesService     = defaultValuesService;
     _countersService          = countersService;
     _httpContext              = httpContext;
     _agreementService         = agreementService;
 }
示例#8
0
        public TagAdminController(
            IHostingEnvironment env,
            IConfiguration configuration,
            ITagRepository tagRepository,
            IUploadImageService uploadImage)
        {
            _env                = env;
            _configuration      = configuration;
            _tagRepository      = tagRepository;
            _uploadImageService = uploadImage;

            _uploadTo  = Path.Combine("blog", "tags");
            _maxWidth  = 450;
            _maxHeight = 250;
        }
 public CreateChatViewModel(
     IChatsListManager chatsListManager,
     IChatService chatService,
     IPageNavigationService pageNavigationService,
     IChatLocalizedStrings localizedStrings,
     IFormatService formatService,
     IUploadImageService uploadImageService,
     IDialogsService dialogsService)
 {
     _chatsListManager      = chatsListManager;
     _chatService           = chatService;
     _pageNavigationService = pageNavigationService;
     _formatService         = formatService;
     _uploadImageService    = uploadImageService;
     _dialogsService        = dialogsService;
     LocalizedStrings       = localizedStrings;
 }
        public ChatDetailsHeaderViewModel(
            ChatSummaryModel chatModel,
            IUploadImageService uploadImageService,
            IChatsListManager chatsListManager)
        {
            _chatModel          = chatModel;
            _uploadImageService = uploadImageService;
            _chatsListManager   = chatsListManager;

            ChatName  = chatModel.Name;
            AvatarUrl = chatModel.PhotoUrl;
            IsMuted   = chatModel.IsMuted;

            StartEditingCommand            = new RelayCommand(StartEditing);
            ChangeMuteNotificationsCommand = new RelayCommand(() => ChangeMuteNotificationsAsync().FireAndForget());
            SaveCommand = new RelayCommand <Func <(Task <Stream>, string)> >(x => SaveAsync(x).FireAndForget());
        }
示例#11
0
        public ArticleAdminController(
            UserManager <AppUser> userManager,
            IConfiguration configuration,
            IHostingEnvironment env,
            ITagRepository tagRepository,
            IUploadImageService uploadImageService,
            IArticleRepository articleRepository)
        {
            _userManager        = userManager;
            _configuration      = configuration;
            _env                = env;
            _tagRepository      = tagRepository;
            _uploadImageService = uploadImageService;
            _articleRepository  = articleRepository;

            _uploadTo  = Path.Combine("blog", "articles", "headers");
            _maxWidth  = 800;
            _maxHeight = 450;
        }
示例#12
0
        public ChatManager(
            IChatService chatService,
            IMessagesCache messagesCache,
            IViewModelFactoryService viewModelFactoryService,
            ILogManager logManager,
            IUploadImageService uploadImageService,
            ICache localCache)
        {
            _chatService             = chatService;
            _messagesCache           = messagesCache;
            _viewModelFactoryService = viewModelFactoryService;
            _uploadImageService      = uploadImageService;
            _localCache = localCache;
            _logger     = logManager.GetLogger <ChatManager>();

            _messagesCache.Init(new TaskReference <MessagesQuery, IList <ChatMessageModel> >(query =>
            {
                return(_chatService.GetMessagesFromAsync(query));
            }));

            _messagesCache.CacheUpdated       += OnCacheUpdated;
            ChatsCollection.CollectionChanged += OnChatsCollectionCollectionChanged;

            _subscriptions.Add(_chatService.MessageReceived.Subscribe(AddLatestMessage));
            _subscriptions.Add(_chatService.MessageEdited.Subscribe(OnMessageEdited));
            _subscriptions.Add(_chatService.MessageDeleted.Subscribe(OnMessageDeleted));
            _subscriptions.Add(_chatService.ChatAdded.Subscribe(x => TryAddChat(x)));
            _subscriptions.Add(_chatService.ChatRemoved.Subscribe(OnChatRemoved));
            _subscriptions.Add(_chatService.ChatUpdated.Subscribe(OnChatUpdated));
            _subscriptions.Add(_chatService.ChatRead.Subscribe(OnChatRead));

            _subscriptions.Add(_chatService.ConnectionStatusChanged.Subscribe(OnConnectionStatusChanged));
            OnConnectionStatusChanged(_chatService.ConnectionStatus);

            Messenger.Default.Register <ChatInForegroundMessage>(this, x => _chatService.ForceReconnect());
            Messenger.Default.Register <ChatInBackgroundMessage>(this, x => _chatService.ForceDisconnect());
        }
示例#13
0
 public AdController(IUploadImageService uploadImageadService, Cloudinary cloudinary, IAdService adService)
 {
     this.adService            = adService;
     this.uploadImageadService = uploadImageadService;
     this.cloudinary           = cloudinary;
 }
示例#14
0
 public MobileUploadImageController(IUploadImageService uploadImageService)
 {
     this._uploadImageService = uploadImageService;
 }
示例#15
0
        public static Immagine UpdateSingleImage(IRepository<Immagine> immagineRepository,
            IUploadImageService uploadImageService, string oldId, ImmagineRawViewModel img, string idPadre,
            string tipoPadre)
        {
            if (img == null) return null;

            if (img.File == null)
            {   //aggiorno i POIPerc dell'immagine precedente
                if (string.IsNullOrEmpty(oldId)) return null;
                var oldImg = immagineRepository.GetById(oldId);

                if (oldImg == null) return null;

                oldImg.PoiPercX = img.PoiPercX;
                oldImg.PoiPercY = img.PoiPercY;
                return oldImg;
            }

            if (!string.IsNullOrEmpty(oldId))
                CleanImageData(immagineRepository, oldId);

            //inserisco la nuova immagine
            var images = uploadImageService.UploadImages(new List<HttpPostedFileBase>{img.File}, idPadre,
                tipoPadre, true);

            var result = images != null && images.Any() ? images.First() : null;
            if (result == null) return null;

            result.PoiPercX = img.PoiPercX;
            result.PoiPercY = img.PoiPercY;

            return result;
        }
示例#16
0
        public async Task <IActionResult> UploadImage([FromServices] IUploadImageService uploadImageService, IFormFile file)
        {
            var imageResult = await uploadImageService.UploadAndResizeAsync(file, "blog/articles/posts", 960, 960);

            return(new ObjectResult(imageResult));
        }
示例#17
0
 public UploadImageController(IUploadImageService service)
 {
     _uploadImageService = service;
 }
示例#18
0
 public ImagesController(IUploadImageService imageService)
 {
     _imageService = imageService;
 }
示例#19
0
 public UpdateProductCommandHandler(IShopDbContext dbContext,
                                    IUploadImageService imageService)
 {
     _dbContext    = dbContext;
     _imageService = imageService;
 }
示例#20
0
 public ProcessorController(IUploadImageService imageService, IMainProcessor processor)
 {
     _processor    = processor;
     _imageService = imageService;
 }