Esempio n. 1
0
        public override CEntry CreateEntry()
        {
            if ((base.Parent as CPhonebook).ReadOnly)
            {
                return(null);
            }
            if (this.EmptyList.Count != 0)
            {
                CPhonebookEntry cPhonebookEntry = new CPhonebookEntry(this, this.EmptyList.Last.Value);
                this.EmptyList.RemoveLast();
                base.AddLast(cPhonebookEntry);
                return(cPhonebookEntry);
            }
            if (this.EmptyListToPush.Count != 0)
            {
                CPhonebookEntry cPhonebookEntry2 = new CPhonebookEntry(this, this.EmptyListToPush.Last.Value);
                this.EmptyListToPush.RemoveLast();
                base.AddLast(cPhonebookEntry2);
                return(cPhonebookEntry2);
            }
            if (this.MedPhonebook.Growable == 0)
            {
                return(null);
            }
            IPhonebookItem medPhonebookItem;

            try
            {
                medPhonebookItem = (this.MedPhonebook.AddStream() as IPhonebookItem);
            }
            catch (Exception)
            {
                return(null);
            }
            CPhonebookEntry cPhonebookEntry3 = new CPhonebookEntry(this, medPhonebookItem);

            base.AddLast(cPhonebookEntry3);
            return(cPhonebookEntry3);
        }
Esempio n. 2
0
 internal void DeleteEntry(CPhonebookEntry entry)
 {
     entry.MedPhonebookItem.Delete();
     this.EmptyListToPush.AddLast(entry.MedPhonebookItem);
     this.Remove(entry);
 }