[System.Security.SecurityCritical] // auto-generated
        #endif
        private String ToString(bool needFileLineInfo, bool needMessage)
        {
            String message = (needMessage ? Message : null);
            String s;

            if (message == null || message.Length <= 0)
            {
                s = GetClassName();
            }
            else
            {
                s = GetClassName() + ": " + message;
            }

            if (_innerException != null)
            {
                s = s + " ---> " + _innerException.ToString(needFileLineInfo, needMessage) + Environment.NewLine +
                    "   " + Environment.GetRuntimeResourceString("Exception_EndOfInnerExceptionStack");
            }

            string stackTrace = GetStackTrace(needFileLineInfo);

            if (stackTrace != null)
            {
                s += Environment.NewLine + stackTrace;
            }

            return(s);
        }
Exemple #2
0
        private string ToString(bool needFileLineInfo)
        {
            string className;
            string message = this.Message;

            if ((message == null) || (message.Length <= 0))
            {
                className = this.GetClassName();
            }
            else
            {
                className = this.GetClassName() + ": " + message;
            }
            if (this._innerException != null)
            {
                className = className + " ---> " + this._innerException.ToString(needFileLineInfo) + Environment.NewLine + "   " + Environment.GetRuntimeResourceString("Exception_EndOfInnerExceptionStack");
            }
            string stackTrace = this.GetStackTrace(needFileLineInfo);

            if (stackTrace != null)
            {
                className = className + Environment.NewLine + stackTrace;
            }
            return(className);
        }