Exemple #1
0
        int IComparable.CompareTo(object Obj)
        {
            LinkRecord temp = (LinkRecord)Obj;

            if (this._name.CompareTo(temp._name) == 1 && this._url.CompareTo(temp._url) == 1)
            {
                return(1);
            }
            if (this._name.CompareTo(temp._name) == -1 || this._url.CompareTo(temp._url) == -1)
            {
                return(-1);
            }
            else
            {
                return(0);
            }
        }
 //exception
 //Adds new link to the collection
 //Parent = theme name
 //Name = link name (shows in tree View)
 //URL = url
 //Thrown exception in case Link with the same name already exists or OutOfMemoryException
 public void AddNew(String Parent, String Name, String URL)
 {
     if (IsUnique(Name) == true)
     {
         try
         {
             LinkRecord item = new LinkRecord(Parent, Name, URL);
             Collection.Add(item);
         }
         catch (OutOfMemoryException)
         {
             throw new ItemException(AYarkov.LinksSaver.Properties.Resources.MemoryError);
         }
     }
     else
     {
         throw new ItemException(AYarkov.LinksSaver.Properties.Resources.SameName);
     }
 }
Exemple #3
0
 //Adds new link to the collection
 //Parent = theme name
 //Name = link name (shows in tree View)
 //URL = url
 //Thrown exception in case Link with the same name already exists or OutOfMemoryException
 public void AddNew(String Parent, String Name, String URL)  //exception
 {
     if (IsUnique(Name) == true)
     {
         try
         {
             LinkRecord item = new LinkRecord(Parent, Name, URL);
             Collection.Add(item);
         }
         catch (OutOfMemoryException)
         {
             throw new ItemException(AYarkov.LinksSaver.Properties.Resources.MemoryError);
         }
     }
     else
     {
         throw new ItemException(AYarkov.LinksSaver.Properties.Resources.SameName);
     }
 }