Alsing.Design.CollectionEditorGui.GetDisplayText C# (CSharp) Method

GetDisplayText() private static method

private static GetDisplayText ( object Item ) : string
Item object
return string
        private static string GetDisplayText(object Item)
        {
            string ObjectName = null;

            if (Item == null)
            {
                return string.Empty;
            }
            PropertyDescriptor descriptor1 = TypeDescriptor.GetProperties(Item)["Name"];
            if (descriptor1 != null)
            {
                ObjectName = ((string) descriptor1.GetValue(Item));
                if (!string.IsNullOrEmpty(ObjectName))
                {
                    return ObjectName;
                }
            }

            if (string.IsNullOrEmpty(ObjectName))
            {
                ObjectName = Item.GetType().Name;
            }
            return ObjectName;
        }