コード例 #1
0
        public Appearance_Information()
        {
            BackGroundImageOut = new ImageJSON("Gold", 1, 1);
            BackGroundImageIn  = new ImageJSON("Vintage", 1, 1);
            BackColorOut       = "chocolate";
            BackColorIn        = "burlywood";
            BorderColorOut     = "sienna";
            BorderColorIn      = "peru";
            Font       = "8pt Verdana";
            Font_Color = "";

            BackGroundImageOut_Hover = new ImageJSON("Gold", 1, 1);
            BackGroundImageIn_Hover  = new ImageJSON("Vintage", 1, 1);
            BackColorOut_Hover       = "darkgreen";
            BackColorIn_Hover        = "green";
            BorderColorOut_Hover     = "limegreen";
            BorderColorIn_Hover      = "lime";
            Font_Hover       = "8pt Verdana";
            Font_Color_Hover = "";

            BackGroundImageOut_Focus = new ImageJSON("Gold", 1, 1);
            BackGroundImageIn_Focus  = new ImageJSON("Vintage", 1, 1);
            BackColorOut_Focus       = "darkred";
            BackColorIn_Focus        = "red";
            BorderColorOut_Focus     = "maroon";
            BorderColorIn_Focus      = "firebrick";
            Font_Focus       = "8pt Verdana";
            Font_Color_Focus = "";
        }
コード例 #2
0
        public async Task <ActionResult <Image> > PostImage(ImageJSON imgData)
        {
            DateTime parsedDate = DateTime.Parse(imgData.DateSent);

            byte[] data;
            using (WebClient webClient = new WebClient())
            {
                data = webClient.DownloadData(imgData.ImageURL);
            }

            if (_context.Users.FirstOrDefault(x => x.UserName == imgData.Username) == null)
            {
                _context.Users.Add(new User()
                {
                    UserName = imgData.Username
                });
            }

            _context.SaveChanges();
            var image = new Image()
            {
                DateSent  = parsedDate,
                ImageData = data,
                UserId    = _context.Users.FirstOrDefault(x => x.UserName == imgData.Username).Id
            };

            _context.Images.Add(image);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetImage", new { id = image.Id }, image));
        }
コード例 #3
0
        public ImageJSON Upload()
        {
            try
            {
                MultipartFormDataParser parser = new MultipartFormDataParser(HttpContext.Current.Request.InputStream);

                ImageJSON imageJson     = new ImageJSON();
                int       uploadImageId = 0;

                // Single file access:
                FilePart file     = parser.Files.First();
                string   filename = file.FileName;
                if (file != null && file.Data != null)
                {
                    // Save the file to db
                    Application.Services.Abstract.DTO.IImage image = new Application.Services.DTO.Image();
                    image.UserImage           = parser.ReadFully(file.Data);
                    uploadImageId             = _imageService.UploadImage(image);
                    imageJson.UploadedImageId = uploadImageId;
                }
                else
                {
                    throw new WebException("The posted file was not recognised.", WebExceptionStatus.SendFailure);
                }

                return(imageJson);
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                throw ex;
            }
        }
コード例 #4
0
 public Power_Heal()
 {
     Name   = "Power_Heal";
     Image  = new ImageJSON("Mobile_Heal", 1, 1);
     Cursor = new ImageJSON("Shield_00", 1, 1);
     Target = "Cursor";
     Size   = 1;
 }
コード例 #5
0
 public Power_Jump()
 {
     Name  = "Power_Jump";
     Image = new ImageJSON("Mobile_Jump", 1, 1);
 }
コード例 #6
0
 public Power_Aggro()
 {
     Name  = "Power_Aggro";
     Image = new ImageJSON("Mobile_Aggro", 1, 1);
 }
コード例 #7
0
 public Power_Archery()
 {
     Name  = "Power_Archery";
     Image = new ImageJSON("Mobile_Archery", 1, 1);
 }
コード例 #8
0
 public Power_Melee()
 {
     Name  = "Power_Melee";
     Image = new ImageJSON("Mobile_Melee", 1, 1);
 }
コード例 #9
0
 public Power_Throw()
 {
     Name  = "Power_Throw";
     Image = new ImageJSON("Mobile_Throw", 1, 1);
 }