SIL.FieldWorks.FdoUi.CmObjectUi.ToStatusBar C# (CSharp) Method

ToStatusBar() public method

Get a string suitable for use in the left panel of the LexText status bar. It will show the created and modified dates, if the object has them.
public ToStatusBar ( ) : string
return string
		public string ToStatusBar()
		{
			CheckDisposed();

			if (!Object.IsValidObject)
				return FdoUiStrings.ksDeletedObject;
			DateTime dt;
			string created = "";
			string modified = "";
			System.Reflection.PropertyInfo pi = Object.GetType().GetProperty("DateCreated");
			if (pi != null)
			{
				dt = (DateTime)pi.GetValue(Object, null);
				created = dt.ToString("dd/MMM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
			}
			pi = Object.GetType().GetProperty("DateModified");
			if (pi != null)
			{
				dt = (DateTime)pi.GetValue(Object, null);
				modified = dt.ToString("dd/MMM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
			}
			return String.Format("{0} {1}", created, modified);
		}