using System;

namespace InheritanceComponentCS
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	public class Class1
	{
		public Class1()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		public string GetTime(bool ShowSeconds) 
		{
			// The formatting of dates, and the returning of values of functions,
			// changed somewhat in VB.NET

			if (ShowSeconds == true)
			{
				return System.DateTime.Now.ToLongTimeString() ;
			}
			else
			{
				return System.DateTime.Now.ToShortTimeString() ;
			}
		}
																					  
		// This method overrides the ToString method of the
		// universal base class System.Object

		public override string ToString()
		{
			// Call the base class's ToString method and get the result.
			// You don't have to do this if you don't want to. I did,
			// for demo purposes. 

			string BaseResult = base.ToString() ;

			// Construct response string with base class's string plus
			// my own added information. The net result here is that
			// I'm pigybacking on the base class, not completely
			// replacing it. 

			return "You have reached the overriding class. The base class says: " + BaseResult ;
		}
	}
}
