예제 #1
0
파일: Isbn.cs 프로젝트: mriedmann/oom
 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");
 }
예제 #2
0
        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");
            }
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
 public ISBN(IISBN innerObject)
 {
     this.innerObject = innerObject;
 }
예제 #5
0
파일: Isbn.cs 프로젝트: mriedmann/oom
 public ISBN(IISBN innerObject)
 {
     this.innerObject = innerObject;
 }
예제 #6
0
 public bool Equals(IISBN other)
 {
     return(Id.Equals(other.Id));
 }
예제 #7
0
 public Book(IISBN isbn)
 {
     ISBN = isbn;
 }