Пример #1
0
 public void CreateMappings(IMapperConfigurationExpression configuration)
 {
     configuration.CreateMap <Image, ImageViewModel>()
     .ForMember(m => m.Info, opt => opt.MapFrom(src => MappingFunctions.MapInfo(src)))
     .ForMember(m => m.GpsCoordinates, opt => opt.MapFrom(src => MappingFunctions.MapGpsCoordinates(src)))
     .ForMember(m => m.GpsName, opt => opt.MapFrom(src => MappingFunctions.MapGpsName(src)))
     .ForMember(
         m => m.OriginalDownloadPath,
         opt =>
         opt.MapFrom(
             c =>
             Constants.MainContentFolder + "/" + c.AlbumId + "/" + Constants.ImageFolderOriginal
             + "/" + c.FileName))
     .ForMember(
         m => m.MiddleImageSource,
         opt =>
         opt.MapFrom(
             c =>
             Constants.MainContentFolder + "/" + c.AlbumId + "/" + Constants.ImageFolderMiddle
             + "/" + c.FileName))
     .ForMember(
         m => m.LowImageSource,
         opt =>
         opt.MapFrom(
             c =>
             Constants.MainContentFolder + "/" + c.AlbumId + "/" + Constants.ImageFolderLow + "/"
             + c.FileName));
 }
Пример #2
0
 public LatestAddedAlbumsViewComponent(
     IAlbumService albumService,
     IStringLocalizer <ViewComponentResources> localizer)
 {
     this.albumService = albumService;
     this.localizer    = localizer;
     MappingFunctions.LoadResource(this.localizer);
 }
Пример #3
0
 public LatestAddedImagesViewComponent(
     IImageService imageService,
     IStringLocalizer <ViewComponentResources> localizer)
 {
     this.imageService = imageService;
     this.localizer    = localizer;
     MappingFunctions.LoadResource(this.localizer);
 }
Пример #4
0
 public void CreateMappings(IMapperConfigurationExpression configuration)
 {
     configuration.CreateMap <Album, LatestAddedAlbumsViewModel>()
     .ForMember(m => m.Title, opt => opt.MapFrom(c => MappingFunctions.MapTitle(c))).ForMember(
         m => m.ImagesCountCover,
         opt => opt.MapFrom(c => MappingFunctions.MapImagesCountCover(c))).ForMember(
         m => m.Date,
         opt => opt.MapFrom(c => MappingFunctions.MapDate(c)));
 }
 public ImageListViewComponent(
     IAlbumService albumService,
     IImageService imageService,
     IStringLocalizer <ViewComponentResources> localizer)
 {
     this.albumService = albumService;
     this.imageService = imageService;
     this.localizer    = localizer;
     MappingFunctions.LoadResource(this.localizer);
 }
 public void CreateMappings(IMapperConfigurationExpression configuration)
 {
     configuration.CreateMap <Album, AlbumListViewModel>()
     .ForMember(m => m.Title, opt => opt.MapFrom(c => MappingFunctions.MapTitle(c)))
     .ForMember(m => m.Width, opt => opt.MapFrom(c => MappingFunctions.MapWidth(c)))
     .ForMember(m => m.Height, opt => opt.MapFrom(c => MappingFunctions.MapHeight(c)))
     .ForMember(m => m.ImagesCountCover, opt => opt.MapFrom(c => MappingFunctions.MapImagesCountCover(c)))
     .ForMember(m => m.CoverImage, opt => opt.MapFrom(c => MappingFunctions.MapCoverImage(c)))
     .ForMember(m => m.Date, opt => opt.MapFrom(c => MappingFunctions.MapDate(c)));
 }
Пример #7
0
 // Start is called before the first frame update
 void Start()
 {
     _light    = GetComponent <Light>();
     player    = GameObject.Find("CenterEyeAnchor");
     lightname = gameObject.name;
     SetIntensity(defaultIntensity[lightname]);
     _light.enabled  = false;
     direct_speed    = (maxIntensity[lightname] - minIntensity[lightname]) / speed_in_frames;
     triggered_frame = THRESH;
     MappingFunctions.init_discount_factors();
 }
Пример #8
0
 public void CreateMappings(IMapperConfigurationExpression configuration)
 {
     configuration.CreateMap <Album, AlbumViewModel>()
     .ForMember(m => m.Title, opt => opt.MapFrom(c => MappingFunctions.MapTitle(c)))
     .ForMember(m => m.Description, opt => opt.MapFrom(c => MappingFunctions.MapDescription(c)))
     .ForMember(m => m.ImagesCountCover, opt => opt.MapFrom(c => MappingFunctions.MapImagesCountCover(c)))
     .ForMember(m => m.CoverImage, opt => opt.MapFrom(c => MappingFunctions.MapCoverImage(c)))
     .ForMember(m => m.FbImage, opt => opt.MapFrom(c => MappingFunctions.MapFbImage(c)))
     .ForMember(m => m.ImageCoordinates, opt => opt.MapFrom(c => MappingFunctions.MapImageCoordinates(c)))
     .ForMember(m => m.Date, opt => opt.MapFrom(c => MappingFunctions.MapDate(c)));
 }
Пример #9
0
 public StatisticsViewComponent(
     IFileService fileService,
     IAlbumService albumService,
     IImageService imageService,
     IStringLocalizer <ViewComponentResources> localizer)
 {
     this.fileService  = fileService;
     this.albumService = albumService;
     this.imageService = imageService;
     this.localizer    = localizer;
     MappingFunctions.LoadResource(this.localizer);
 }
Пример #10
0
 public void CreateMappings(IMapperConfigurationExpression configuration)
 {
     configuration.CreateMap <User, UsersViewModel>()
     .ForMember(m => m.Role, opt => opt.MapFrom(src => MappingFunctions.MapUserRole(src)));
 }