Esempio n. 1
0
 private void UploadFamilyThumbnail()
 {
     using (OpenFileDialog ofd = new OpenFileDialog()
     {
         Multiselect = false
     })
     {
         if (ofd.ShowDialog() == DialogResult.OK)
         {
             FileInfo fi         = new FileInfo(ofd.FileName);
             var      imagebytes = File.ReadAllBytes(fi.FullName);
             _request.MediaFile.Thumbnail = imagebytes;
             this.pictureBox1.Image       = ImageWorker.ConvertFromByteArray(imagebytes);
         }
     }
 }
Esempio n. 2
0
        private void BindData(MCharacter character)
        {
            characterInitialData = new ValueHolder(ImageWorker.ConvertFromByteArray(character.CharacterMediaFile.Thumbnail),
                                                   character.FirstName,
                                                   character.LastName,
                                                   character.BirthDate.ToString("dd-MM-yyyy"),
                                                   character.Occupation,
                                                   character.Biography
                                                   );

            this.pictureBox1.Image = ImageWorker.ConvertFromByteArray(character.CharacterMediaFile.Thumbnail);
            this.textBox1.Text     = $"{character.FirstName} {character.LastName}";
            this.textBox2.Text     = character.Biography;
            this.textBox3.Text     = character.BirthDate.ToString("dd-MM-yyyy");
            this.textBox4.Text     = character.Occupation;
        }
        private async void CharacterForm_Load(object sender, EventArgs e)
        {
            var data = await _characterApiService.Get <List <MCharacter> >(null);

            foreach (var item in data)
            {
                var character = new CharacterFamilyControl
                {
                    Id             = item.Id.ToString(),
                    Icon           = ImageWorker.ConvertFromByteArray(item.CharacterMediaFile.Thumbnail),
                    CharacterLabel = $"{item.FirstName} {item.LastName}",
                    isCharacter    = true
                };

                this.flowLayoutPanel1.Controls.Add(character);
            }
        }
Esempio n. 4
0
        private void button4_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog()
            {
                Multiselect = false
            })
            {
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    FileInfo fi = new FileInfo(ofd.FileName);

                    var imageByte = File.ReadAllBytes(fi.FullName);
                    request.MediaFile.Thumbnail = imageByte;

                    this.pictureBox1.Image = ImageWorker.ConvertFromByteArray(imageByte);
                }
            }
        }
        public async Task LoadFamilies()
        {
            this.flowLayoutPanel1.Controls.Clear();
            var data = await _familyApiService.Get <List <MFamily> >(null);

            foreach (var item in data)
            {
                var family = new CharacterFamilyControl
                {
                    Id             = item.Id.ToString(),
                    Icon           = ImageWorker.ConvertFromByteArray(item.MediaFile.Thumbnail),
                    CharacterLabel = $"{item.Name}",
                    isCharacter    = false
                };

                this.flowLayoutPanel1.Controls.Add(family);
            }
        }
        private void BindData(MFamily family)
        {
            this.pictureBox1.Image = ImageWorker.ConvertFromByteArray(family.MediaFile.Thumbnail);
            this.label1.Text       = family.Name;

            foreach (var item in family.Members)
            {
                var character = new CharacterFamilyControl
                {
                    Id             = item.Id.ToString(),
                    Icon           = ImageWorker.ConvertFromByteArray(item.CharacterMediaFile.Thumbnail),
                    CharacterLabel = $"{item.FirstName} {item.LastName}",
                    isCharacter    = true
                };

                this.flowLayoutPanel1.Controls.Add(character);
            }
        }
        public async Task LoadCharacters()
        {
            this.flowLayoutPanel1.Controls.Clear();

            var data = await _characterApiService.Get <List <MCharacter> >(null);

            foreach (var item in data)
            {
                var character = new CharacterFamilyControl
                {
                    Id             = item.Id.ToString(),
                    Icon           = ImageWorker.ConvertFromByteArray(item.CharacterMediaFile.Thumbnail),
                    CharacterLabel = $"{item.FirstName} {item.LastName}",
                    isCharacter    = true
                };

                this.flowLayoutPanel1.Controls.Add(character);
            }
        }