Exemple #1
0
        public override string ToString()
        {
            if (_cachedToString != null)
            {
                return(_cachedToString);
            }

            StringBuilder sb = new StringBuilder();

            if (!_genericTypeDefinition.IsNull())
            {
                sb.Append(_genericTypeDefinition.LowLevelToString());
            }
            else if (!RuntimeTypeHandle.IsNull())
            {
                sb.Append(RuntimeTypeHandle.LowLevelToString());
            }

            if (!Instantiation.IsNull)
            {
                for (int i = 0; i < Instantiation.Length; i++)
                {
                    sb.Append(i == 0 ? "[" : ", ");
                    sb.Append(Instantiation[i].ToString());
                }
                if (Instantiation.Length > 0)
                {
                    sb.Append("]");
                }
            }

            _cachedToString = sb.ToString();

            return(_cachedToString);
        }