private bool checkHasNull(MarioMakerLevel level) { foreach (var prop in typeof(MarioMakerLevel).GetProperties()) // Foreach property { if (prop.GetValue(level) == null) // Check if null { Console.WriteLine(prop.GetValue(level)); return(true); // If null return true } } return(false); // If none found null, return false }
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGridCellInfo info = LevelGrid.SelectedCells[0]; MarioMakerLevel selected = info.Item as MarioMakerLevel; if (selected != null) { StartSetAllPicturesThread(selected.Link, "course-image", LevelImageThumbnail, "course-image-full", LevelImageFull); } //if (col > 0 && col < dataGridView1.Width && row > 0 && row < dataGridView1.Height) // If the cell is within the grid (for some reason pressing the column name caused an out of bounds error \_(ツ)_/ ) //{ // //if (col < 0) col = 0; else if (col > dataGridView1.Width) col = dataGridView1.Width; // //if (row < 0) row = 0; else if (row > dataGridView1.Height) row = dataGridView1.Height; // var cell = ((DataGridView)sender)[col, row]; // // This just grabs the data from the cell clicked, and puts it into the text objects // if (cell.Value != null) // { // DataGridViewRow rows = cell.OwningRow; // WebsiteSearch web = new WebsiteSearch(); // TextTitle.Text = "Title - " + rows.Cells["Title"].Value.ToString(); // TextAuthor.Text = "Author - " + rows.Cells["Author"].Value.ToString(); // TextDifficulty.Text = "Difficulty - " + rows.Cells["Difficulty"].Value.ToString(); // TextClearRate.Text = "Clear Rate - " + rows.Cells["ClearRate"].Value.ToString(); // TextStars.Text = "Stars - " + rows.Cells["Stars"].Value.ToString(); // var index = Array.FindIndex(web.gameStylesShort, i => i == rows.Cells["GameStyle"].Value.ToString()); // TextGameStyle.Text = "Game Style - " + web.gameStylesLong[index]; // //TextGameStyle.Text = "GameStyle - " + rows.Cells["GameStyle"].Value.ToString(); // TextPlayersPlayed.Text = "Players Played - " + rows.Cells["PlayersPlayed"].Value.ToString(); // TextRegion.Text = "Region - " + rows.Cells["Flag"].Value.ToString(); // TextTag.Text = "Tag - " + rows.Cells["Tag"].Value.ToString(); // TextID.Text = "ID - " + rows.Cells["ID"].Value.ToString(); // //StartGetPictureThread(rows.Cells["Link"].Value.ToString(), "course-image", PictureBoxLevelThumbnail); // //StartGetPictureThread(rows.Cells["Link"].Value.ToString(), "course-image-full", PictureBoxFullCourse); // // Replaced the previous two with a single one, therefore I just need to run one thread! (Also, accessing a site two times that quickly makes it a bit suspish, shhh) // StartSetAllPicturesThread(rows.Cells["Link"].Value.ToString(), "course-image", PictureBoxLevelThumbnail, "course-image-full", PictureBoxFullCourse); // } //} }