public bool Equals(ErrorType toCompare) { if (id == toCompare.id) return true; return false; }
public bool addType( List<ErrorType> errorTypes ) { if (errorType != null) return true; foreach (ErrorType aErrorType in errorTypes) { if (aErrorType.Equals(this)) { errorType = aErrorType; return true; } } return false; }
private bool getErrorTypes( List<ErrorType> toExpand ) { int maxID= 0; foreach( ErrorType errorType in toExpand ) if( errorType.getID() > maxID ) maxID = errorType.getID(); StringBuilder htmlOutput = new StringBuilder(""); DB db = new DB(); db.setOutput(htmlOutput); db.getErrors(maxID); ErrorTypesReturn jsonReturn = JsonConvert.DeserializeObject<ErrorTypesReturn>(htmlOutput.ToString()); if( jsonReturn.status.status.ToLower() != "success" ) return false; for (int i = 0; i < jsonReturn.maxI; i++){ ErrorType tempErrorType = new ErrorType(jsonReturn.errors[i]); if (!toExpand.Contains(tempErrorType)) toExpand.Add(tempErrorType); } return true; }