Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / Windows Forms

BookStore

Rate me:
Please Sign up or sign in to vote.
4.61/5 (25 votes)
24 Apr 2012CPOL5 min read 134.6K   17.8K   98  
A project for managing the digital books (HTML, DOCX, ODF, PDF, EPUB, TXT, etc.) of the user using db4o
using System;


namespace BookEntities
{

    public class Tag : IBookMetaData, IComparable<Tag>
    {

        private Guid guid;
        private string name;


        public Tag(string name)
        {
            this.guid = Guid.NewGuid();
            this.name = name;
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }


        public override int GetHashCode()
        {
            return guid.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (!(obj is Tag))
                return false;
            else
                return (this.guid == ((Tag)obj).guid);
        }

        public int CompareTo(Tag other)
        {
            return name.CompareTo(other.name);
        }

        public override string ToString()
        {
            return name;
        }
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions