ToString() public abstract method

Returns a string representation of this object.
public abstract ToString ( ) : string
return string
Example #1
0
        /// <summary>
        /// Adds a listener to the Listeners list.
        /// </summary>
        /// <param name="newItem">The new Listener to add.</param>
        public void AddListener(Listener newItem)
        {
            if (newItem == null)
            {
                throw new ArgumentNullException();
            }
            ListenEntry le = new ListenEntry();

            le.listener = newItem;
            le.guid     = Guid.NewGuid();
            while (Listeners.Contains(le))
            {
                le.guid = Guid.NewGuid();
            }
            Listeners.Add(le);
            Console.WriteLine(newItem.ToString() + " started.");
        }
Example #2
0
 /// <summary>
 /// Adds a listener to the Listeners list.
 /// </summary>
 /// <param name="newItem">The new Listener to add.</param>
 public void AddListener(Listener newItem)
 {
     if (newItem == null)
         throw new ArgumentNullException();
     ListenEntry le = new ListenEntry();
     le.listener = newItem;
     le.guid = Guid.NewGuid();
     while (Listeners.Contains(le))
     {
         le.guid = Guid.NewGuid();
     }
     Listeners.Add(le);
     Console.WriteLine(newItem.ToString() + " started.");
 }