Beispiel #1
0
        public static async Task <EBook> CreateEBook(IStorageItem item)
        {
            EBook returnValue = new EBook();
            await returnValue.Load(item);

            return(returnValue);
        }
Beispiel #2
0
 public Entry(EBook book)
 {
     _author = book.Author;
     // TODO: copy the relevant data here.
     //_cover = bookMetaData.Cover.SomeStuff;
     _identifier      = book.Identifier;
     _language        = (CultureInfo)(book.Language == null ? null : book.Language.Clone());
     _legal           = book.Legal;
     _publicationDate = book.PublicationDate;
     _publisher       = book.Publisher;
     _title           = book.Title;
     book.Entry       = this;
 }
Beispiel #3
0
        public Entry this[EBook index]
        {
            get
            {
                return _entriesByPath[index.Path];
            }
            set
            {
                if (null == index)
                {
                    // Ignore.
                    return;
                }

                if (!Contains(index))
                {
                    _entriesByPath.Add(index.Path, value);
                    EntryAdded(value);
                    return;
                }

                Entry current = _entriesByPath[index.Path];
                if (null == value)
                {
                    // Remove the entry.
                    _entriesByPath.Remove(index.Path);
                    EntryRemoved(current);
                }
                else
                {
                    if (!current.Equals(value))
                    {
                        // Update the entry.
                        _entriesByPath[index.Path] = value;
                        EntryChanged(value);
                    }
                }
            }
        }
Beispiel #4
0
        public Entry this[EBook index]
        {
            get
            {
                return _entriesByPath[index.Path];
            }
            set
            {
                if (null == index)
                {
                    // Ignore.
                    return;
                }

                if (!Contains(index))
                {
                    _entriesByPath.Add(index.Path, value);
                    EntryAdded(value);
                    return;
                }

                Entry current = _entriesByPath[index.Path];
                if (null == value)
                {
                    // Remove the entry.
                    _entriesByPath.Remove(index.Path);
                    EntryRemoved(current);
                }
                else
                {
                    if (!current.Equals(value))
                    {
                        // Update the entry.
                        _entriesByPath[index.Path] = value;
                        EntryChanged(value);
                    }
                }
            }
        }
Beispiel #5
0
 public bool Contains(EBook book)
 {
     return _entriesByPath.ContainsKey(book.Path);
 }
Beispiel #6
0
 public static async Task<EBook> CreateEBook(IStorageItem item)
 {
     EBook returnValue = new EBook();
     await returnValue.Load(item);
     return returnValue;
 }
Beispiel #7
0
 public bool Contains(EBook book)
 {
     return _entriesByPath.ContainsKey(book.Path);
 }