Catel.ObjectToStringHelper.ToTypeString C# (CSharp) 메소드

ToTypeString() 공개 정적인 메소드

Returns a string that represents the type name of the instance. If the instance is null, this method will return "null". This method is great when the value of a property must be logged.
public static ToTypeString ( object instance ) : string
instance object The instance.
리턴 string
        public static string ToTypeString(object instance)
        {
            if (instance == null)
            {
                return "null";
            }

            var instanceAsType = instance as Type;
            if (instanceAsType != null)
            {
                return instanceAsType.Name;
            }

            return instance.GetType().Name;
        }