private void RateIcon_Click(object sender, EventArgs e) { int.TryParse(((EpisodeControl)((PictureBox)sender).Parent).Text.ToLower().Replace("episode", "").Trim(), out int EpisodeNumber); RateAnimeControl RateAnimeCtrl = new RateAnimeControl(EpisodeNumber); Point CtrlLocation = ((PictureBox)sender).Parent.PointToScreen(Point.Empty); RateAnimeCtrl.Location = new Point(CtrlLocation.X, 50); this.Controls.Add(RateAnimeCtrl); RateAnimeCtrl.BringToFront(); RateAnimeCtrl.SaveRecord += RateAnimeCtrl_SaveRecord; }
private async void RateAnimeCtrl_SaveRecord(RateAnimeControl RateControl, MyAnimeListAnimeValuesClass MalValues) { await StaticsClass.MyAnimeListObject.AddAnime(_AnimeObject.Id, MalValues); RateControl.Dispose(); }