public static ObjectLocation Parse(string str) { int strCnt = 0; ObjectLocation objectLocation = null; string[] strSplit = null; strSplit = str.Split(new char[] { ';' }); strCnt = Parse(objectLocation, strSplit, strCnt); return(objectLocation); }
public static int Parse(ObjectLocation objectLocation, string[] strSplit, int strCnt) { objectLocation.UniqueID = Convert.ToUInt64(strSplit[0] == null ? "0" : strSplit[strCnt++]); objectLocation.Address1 = strSplit[1] == null ? "" : strSplit[strCnt++]; objectLocation.Address2 = strSplit[2] == null ? "" : strSplit[strCnt++]; objectLocation.Address3 = strSplit[3] == null ? "" : strSplit[strCnt++]; objectLocation.City = strSplit[4] == null ? "" : strSplit[strCnt++]; objectLocation.State = strSplit[5] == null ? "" : strSplit[strCnt++]; objectLocation.Zip = strSplit[6] == null ? "" : strSplit[strCnt++]; objectLocation.Country = (ECountry)Convert.ToUInt32(strSplit[7] == null ? "" : strSplit[strCnt++]); objectLocation.Coordinate = new Coordinate( Convert.ToDecimal(strSplit[8] == null ? "0" : strSplit[strCnt++]), Convert.ToDecimal(strSplit[9] == null ? "0" : strSplit[strCnt++])); return(strCnt); }
// Exceptions: // System.ArgumentException: // Other object is null // The argument to compare is not a UserBase // Refering object (this) is null public override int CompareTo(object other) { if (other == null) { throw new System.ArgumentException("Other object is null", "other"); } ObjectLocation objectLocation = other as ObjectLocation; if (objectLocation == null) { throw new System.ArgumentException("The argument to compare is not a objectLocation", "other"); } if (IsNull)// || (!IsLoaded())) { throw new System.ArgumentException("Refering object (this) is null", "this"); } return(this.ToString().CompareTo(objectLocation.ToString())); }