public ISBN(string isbnNumber) { int isbnLength = isbnNumber.Replace("-", "").Replace(" ", "").Length; if (isbnLength == 10) innerObject = new ISBN10(isbnNumber); else if (isbnLength == 13) innerObject = new ISBN13(isbnNumber); else throw new ArgumentException("Invalid Format", "isbnText"); }
public ISBN(string isbnNumber) { int isbnLength = isbnNumber.Replace("-", "").Replace(" ", "").Length; if (isbnLength == 10) { innerObject = new ISBN10(isbnNumber); } else if (isbnLength == 13) { innerObject = new ISBN13(isbnNumber); } else { throw new ArgumentException("Invalid Format", "isbnText"); } }
/// <summary> /// Processes the specified ISBN. /// </summary> /// <param name="isbn">The ISBN to process.</param> /// <returns>The <see cref="IISBN"/> generated.</returns> static IISBN ProcessISBN(string isbn) { IISBN ret = null; try { if (isbn.Length == 10) { ret = new ISBN10(isbn); } else if (isbn.Length == 13) { ret = new ISBN13(isbn); } } catch { } // don't care return(ret); }
public ISBN(IISBN innerObject) { this.innerObject = innerObject; }
public bool Equals(IISBN other) { return(Id.Equals(other.Id)); }
public Book(IISBN isbn) { ISBN = isbn; }