public CallForPapersController(IConferenceService conferenceService, IImageUploader imageUploader, ApplicationDbContext dbContext)
 {
     _conferenceService            = conferenceService;
     _imageUploader                = imageUploader;
     _dbContext                    = dbContext;
     _cfpSpeakerImageContainerName = ConfigurationManager.AppSettings["Storage.Container.CallForPaper.SpeakerImages"];
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PostTranslator"/> class.
 /// </summary>
 /// <param name="authData"></param>
 public PostTranslator(ICatiAuthDataLayer authData, IContentTransformer contentTransformer, ICatiImageDataLayer imageDataLayer, IImageUploader uploader)
 {
     this.authDataLayer      = authData;
     this.contentTransformer = contentTransformer;
     this.imageDataLayer     = imageDataLayer;
     this.uploader           = uploader;
 }
        public EditProductPresenter(IEditProductView view,
                                    IProductsService productsService,
                                    ICategoriesService categoriesService,
                                    IRoomsService roomsService,
                                    IImageUploader imageUploader) : base(view)
        {
            if (productsService == null)
            {
                throw new ArgumentNullException("Products service cannot be null.");
            }

            if (categoriesService == null)
            {
                throw new ArgumentNullException("Categories service cannot be null.");
            }

            if (roomsService == null)
            {
                throw new ArgumentNullException("Rooms service cannot be null.");
            }

            if (imageUploader == null)
            {
                throw new ArgumentNullException("Image uploader cannot be null.");
            }

            this.productsServices      = productsService;
            this.categoriesServices    = categoriesService;
            this.roomsServices         = roomsService;
            this.imageUploader         = imageUploader;
            this.View.Initial         += OnInitial;
            this.View.EdittingProduct += OnEdittingProduct;
            this.View.UploadingImage  += OnUploadingImage;
        }
Пример #4
0
        public AddCategoryPresenter(IAddCategoryView view,
                                    ICategoryFactory categoryFactory,
                                    ICategoriesService categoriesServices,
                                    IImageUploader imageUploader) : base(view)
        {
            if (categoriesServices == null)
            {
                throw new ArgumentNullException("Categories service cannot be null.");
            }

            if (categoryFactory == null)
            {
                throw new ArgumentNullException("Category factory cannot be null.");
            }

            if (imageUploader == null)
            {
                throw new ArgumentNullException("Image uploader cannot be null.");
            }

            this.categoriesServices   = categoriesServices;
            this.categoryFactory      = categoryFactory;
            this.imageUploader        = imageUploader;
            this.View.AddingCategory += OnAddingCategory;
            this.View.UploadingImage += OnUploadingImage;
        }
Пример #5
0
 public void AddProduct(Product product, int amount, string categoryName, IImageUploader uploader, PriceCalculator calculator)
 {
     if (Entries.ContainsKey(product.SkuCode))
     {
         // TODO: check if this is actually the same product
         var entry = Entries[product.SkuCode];
         entry.Amount     += amount;
         entry.FinalPrice += calculator.CalculateFinalPrice(product, amount);
     }
     else
     {
         Entries[product.SkuCode] = new CartEntry()
         {
             Id          = product.Id,
             SkuCode     = product.SkuCode,
             Title       = product.Title,
             NormalPrice = product.Price,
             Discount    = product.Discount,
             ImageUrl    = uploader.GetImageUrl(product.MainImageId),
             Amount      = amount,
             FinalPrice  = calculator.CalculateFinalPrice(product, amount),
             Category    = categoryName,
         };
     }
 }
 public CreatePostCommandHandler(IUnitOfWork unitOfWork, IImageUploader imageUploader, IPostRepository postRepository, IAccountRepository accountRepository)
 {
     this.unitOfWork        = unitOfWork;
     this.imageUploader     = imageUploader;
     this.postRepository    = postRepository;
     this.accountRepository = accountRepository;
 }
Пример #7
0
 public CallForPapersController(IConferenceService conferenceService, IImageUploader imageUploader, ApplicationDbContext dbContext)
 {
     _conferenceService = conferenceService;
     _imageUploader = imageUploader;
     _dbContext = dbContext;
     _cfpSpeakerImageContainerName = ConfigurationManager.AppSettings["Storage.Container.CallForPaper.SpeakerImages"];
 }
 public ProfileController(ProfileService profileService, IImageUploader imageUploader, UserManager <MyIdentityServiceUser> userManager, APIService apiService)
 {
     _profileService = profileService;
     _imageUploader  = imageUploader;
     _userManager    = userManager;
     _apiService     = apiService;
 }
Пример #9
0
        public AddRoomPresenter(IAddRoomView view,
                                IRoomFactory roomFactory,
                                IRoomsService roomsService,
                                IImageUploader imageUploader) : base(view)
        {
            if (roomsService == null)
            {
                throw new ArgumentNullException("Rooms service cannot be null.");
            }

            if (roomFactory == null)
            {
                throw new ArgumentNullException("Room factory cannot be null.");
            }

            if (imageUploader == null)
            {
                throw new ArgumentNullException("Image uploader cannot be null.");
            }

            this.roomsService         = roomsService;
            this.roomFactory          = roomFactory;
            this.imageUploader        = imageUploader;
            this.View.AddingRoom     += OnAddingRoom;
            this.View.UploadingImage += OnUploadingImage;
        }
Пример #10
0
 public ProductPreviewModel(Product product, IImageUploader uploader)
 {
     Id           = product.Id;
     Title        = product.Title;
     Price        = product.Price;
     Discount     = product.Discount;
     MainImageUrl = uploader.GetImageUrl(product.MainImageId);
 }
Пример #11
0
 public ProductController(ApplicationDbContext db, PriceCalculator priceCalculator, UserManager <ApplicationUser> userManager, IImageUploader uploader, Paging paging)
 {
     this.db = db;
     this.priceCalculator = priceCalculator;
     this.userManager     = userManager;
     this.uploader        = uploader;
     this.paging          = paging;
 }
Пример #12
0
 public ListingController(IImageUploader imageUploader, IUnitOfWork unitOfWork, IMapper mapper,
                          UserManager <ApplicationUser> userManager)
 {
     _imageUploader = imageUploader;
     _unitOfWork    = unitOfWork;
     _mapper        = mapper;
     _userManager   = userManager;
 }
Пример #13
0
        private async void ProcessScreenshot(Bitmap screenshot)
        {
            if (Settings.Default.EnableSoundEffect)
            {
                PlaySound(Resources.ShutterSound);
            }

            if (Settings.Default.UploadImage)
            {
                try
                {
                    byte[]         screenshotBinary = SerializeScreenshot(screenshot, Settings.Default.UploadFormat);
                    IImageUploader uploader         = extensionBootstrap.ResolveExtension(Settings.Default.Host);
                    string         imageLink        = await uploader.UploadImageAsync(screenshotBinary);

                    if (Settings.Default.OnUploadCopyLinkToClipboard)
                    {
                        Clipboard.SetText(imageLink);
                    }
                    else if (Settings.Default.OnUploadOpenImageInBrowser)
                    {
                        Process.Start(imageLink);
                    }
                }
                catch (HttpRequestException)
                {
                    ShowBalloonTip(
                        string.Format(
                            "Ember failed to upload your image to {0}. It could be that {0} is temporarily offline. You should try again in a few moments.",
                            Settings.Default.Host),
                        "Whops",
                        ToolTipIcon.Error);
                }
            }

            if (Settings.Default.SaveImage)
            {
                if (!Directory.Exists(Settings.Default.SaveDirectory))
                {
                    Directory.CreateDirectory(Settings.Default.SaveDirectory);
                }

                for (int number = 0; ; number++)
                {
                    string name = string.Concat("screenshot ", number, ".png");
                    string path = Path.Combine(Settings.Default.SaveDirectory, name);

                    if (File.Exists(path) == false)
                    {
                        screenshot.Save(path, Settings.Default.SaveFormat);
                        break;
                    }
                }
            }
        }
Пример #14
0
 public BookingController(IUnitOfWork unitOfWork, IMapper mapper,
                          UserManager <ApplicationUser> userManager, IStripeService stripe,
                          IEmailSender emailSender, IImageUploader imageUploader)
 {
     _unitOfWork    = unitOfWork;
     _mapper        = mapper;
     _userManager   = userManager;
     _stripe        = stripe;
     _emailSender   = emailSender;
     _imageUploader = imageUploader;
 }
Пример #15
0
 public CreateRecipeCommandHandler(
     IEnumerable <ICommandValidator <CreateRecipeCommand> > validators,
     IEventPublisher eventPublisher,
     IRecipeFactory recipeFactory,
     IRecipeIngredientFactory recipeIngredientFactory,
     IImageUploader imageUploader)
 {
     _validators              = validators;
     _eventPublisher          = eventPublisher;
     _recipeFactory           = recipeFactory;
     _recipeIngredientFactory = recipeIngredientFactory;
     _imageUploader           = imageUploader;
 }
Пример #16
0
 public UserService(IdeContext context,
                    IEmailService emailService,
                    IMapper mapper,
                    ILogger <UserService> logger,
                    IImageUploader imageUploader,
                    IEditorSettingService editorSettingService)
 {
     _mapper               = mapper;
     _context              = context;
     _emailService         = emailService;
     _imageUploader        = imageUploader;
     _logger               = logger;
     _editorSettingService = editorSettingService;
 }
Пример #17
0
 public PhotosService(
     IUnitOfWork unitOfWork,
     IUsersService usersService,
     IImageUploader imageUploader,
     IClassMapper mapper,
     IConfiguration configuration,
     ISlackService slackService
     )
 {
     _unitOfWork    = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _usersService  = usersService ?? throw new ArgumentNullException(nameof(usersService));
     _imageUploader = imageUploader ?? throw new ArgumentNullException(nameof(imageUploader));
     _mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _slackService  = slackService ?? throw new ArgumentNullException(nameof(slackService));
 }
Пример #18
0
        public FlightLogic(ILogger <FlightLogic> logger,
                           FlightsAPIClient flightsAPIClient,
                           IFlightSimInterface flightSimInterface,
                           IImageUploader imageUploader)
        {
            this.logger           = logger;
            this.flightsAPIClient = flightsAPIClient;
            this.imageUploader    = imageUploader;
            flightSimInterface.EnvironmentDataUpdated += FlightSimInterface_EnvironmentDataUpdated;
            flightSimInterface.AirportListUpdated     += FlightSimInterface_AirportListUpdated;
            flightSimInterface.AircraftDataUpdated    += FlightSimInterface_AircraftDataUpdated;
            flightSimInterface.FlightPlanUpdated      += FlightSimInterface_FlightPlanUpdated;

            flightSimInterface.FlightStatusUpdated += FlightSimInterface_FlightStatusUpdated;
            flightSimInterface.Crashed             += FlightSimInterface_CrashedAsync;
            flightSimInterface.CrashReset          += FlightSimInterface_CrashReset;
            flightSimInterface.Closed += FlightSimInterface_Closed;
        }
Пример #19
0
        public ImageUploadWriter(DiskWriter diskWriter,
                                 ISystemTray systemTray,
                                 IMessageProvider messageProvider,
                                 Settings.Settings settings,
                                 LanguageManager languageManager,
                                 IRecentList recentList,
                                 IImageUploader imgUploader)
        {
            _imgUploader = imgUploader;

            _diskWriter      = diskWriter;
            _systemTray      = systemTray;
            _messageProvider = messageProvider;
            _settings        = settings;
            _loc             = languageManager;
            _recentList      = recentList;

            languageManager.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display));
        }
Пример #20
0
        public ImageUploadWriter(DiskWriter DiskWriter,
                                 ISystemTray SystemTray,
                                 IMessageProvider MessageProvider,
                                 Settings Settings,
                                 ILocalizationProvider Loc,
                                 IRecentList RecentList,
                                 IImageUploader ImgUploader)
        {
            _imgUploader = ImgUploader;

            _diskWriter      = DiskWriter;
            _systemTray      = SystemTray;
            _messageProvider = MessageProvider;
            _settings        = Settings;
            _loc             = Loc;
            _recentList      = RecentList;

            Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display));
        }
Пример #21
0
        public UploadRecentItem(string Link, string DeleteHash, IImageUploader UploaderService)
        {
            this.DeleteHash      = DeleteHash;
            this.UploaderService = UploaderService;

            ClickCommand = new DelegateCommand(() => ServiceProvider.LaunchFile(new ProcessStartInfo(Link)));

            RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke());

            var icons = ServiceProvider.Get <IIconSet>();
            var loc   = ServiceProvider.Get <LanguageManager>();

            Display = this.Link = Link;
            Icon    = icons.Link;

            Actions = new[]
            {
                new RecentAction(loc.CopyPath, icons.Clipboard, () => this.Link.WriteToClipboard()),
                new RecentAction(loc.Delete, icons.Delete, OnDelete)
            };
        }
Пример #22
0
 public ImageService(IImageUploader imageUploader)
 {
     _imageUploader = imageUploader;
 }
 public ImageRecognitionController(IImageUploader imageUploader,
                                   IImagePredictor imagePredictor)
 {
     _imageUploader  = imageUploader;
     _imagePredictor = imagePredictor;
 }
Пример #24
0
 public Paging(IImageUploader uploader)
 {
     this.uploader = uploader;
 }
Пример #25
0
 public ImageService(IImageUploader uploader, IImageResizer resizer)
 {
     this.Uploader = uploader;
     this.Resizer = resizer;
 }
Пример #26
0
 public BackOfficeController(IShopData shopData, IImageUploader imageUploader)
     : base(shopData)
 {
     this.ImageUploader = imageUploader;
 }
Пример #27
0
 public ProfileImageService(ApplicationDbContext applicationDbContext, IImageUploader imageUploader)
 {
     this.applicationDbContext = applicationDbContext;
     this.imageUploader        = imageUploader;
 }
Пример #28
0
 public SpeakerAdminController(IImageUploader imageUploader, ApplicationDbContext dbContext) : base(dbContext)
 {
     _imageUploader = imageUploader;
     _speakerImageContainerName = ConfigurationManager.AppSettings["Storage.Container.Speakers.SpeakerImages"];
 }
Пример #29
0
 public ImagesController(IShopData shopData, IImageUploader imageUploader)
     : base(shopData, imageUploader)
 {
 }
 public PostController(ProfileService profileService, IImageUploader imageUploader, APIService apiService)
 {
     _profileService = profileService;
     _imageUploader  = imageUploader;
     _apiService     = apiService;
 }
 public ImageUploadController(IImageUploader imageUploadService, ILogger <ImageUploadController> logger)
 {
     _imageUploadService = imageUploadService;
     _logger             = logger;
 }
 public ImagesController(IImageUploader imageUploader)
 {
     _imageUploader = imageUploader;
 }
Пример #33
0
 public ImagesController(IImageUploader imageUploader)
 {
     _imageUploader = imageUploader;
 }
Пример #34
0
 public ImageWorker(IImageUploader imageUploader, IServerService serverService)
 {
     ImageUploader      = imageUploader;
     this.serverService = serverService;
 }