void AddResults(JSON_Result json_result, int maxResults) { // give an arbitrarily high assignment if there's no limit placed on the max number of results if (maxResults == 0) { maxResults = 50; } // Checks for results before iterating through results, and invoking AddResult for each result // in the JSON result up to assigned maxResults if (json_result.results != null) { int currentResult = 0; foreach (Result result in json_result.results) { if (currentResult < maxResults) { AddResult(result); currentResult++; } else { return; } } } }
public WriteableResult( JSON_Result json_result, string fileName, bool queryArtwork, int maxResults = 0 ) { try { SetValues( fileName, queryArtwork ); AddResults( json_result, maxResults ); WriteableResultOptions.Sort( ); string years = ""; foreach(var item in WriteableResultOptions) { years += item.Year + ", "; } // System.Windows.MessageBox.Show( years ); var waka = "HARD IN THE DATA PAINT"; } catch(Exception ex) { System.Windows.MessageBox.Show( ex.Message ); } }
public WriteableResult(JSON_Result json_result, string fileName, bool queryArtwork, int maxResults = 0) { try { SetValues(fileName, queryArtwork); AddResults(json_result, maxResults); WriteableResultOptions.Sort( ); string years = ""; foreach (var item in WriteableResultOptions) { years += item.Year + ", "; } // System.Windows.MessageBox.Show( years ); var waka = "HARD IN THE DATA PAINT"; } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message); } }
void AddResults( JSON_Result json_result, int maxResults) { // give an arbitrarily high assignment if there's no limit placed on the max number of results if(maxResults == 0) { maxResults = 50; } // Checks for results before iterating through results, and invoking AddResult for each result // in the JSON result up to assigned maxResults if (json_result.results != null) { int currentResult = 0; foreach( Result result in json_result.results) { if(currentResult < maxResults) { AddResult( result ); currentResult++; } else { return; } } } }