コード例 #1
0
ファイル: PSTraceSource.cs プロジェクト: mmoenfly/GitCook2021
        internal PSNotImplementedException NewNotImplementedException()
        {
            PSNotImplementedException implementedException = new PSNotImplementedException(ResourceManagerCache.FormatResourceString(Assembly.GetAssembly(typeof(PSObject)), "AutomationExceptions", "NotImplemented", (object)new StackTrace().GetFrame(0).ToString()));

            this.TraceException((Exception)implementedException);
            return(implementedException);
        }
コード例 #2
0
        /// <summary>
        /// Traces the Message and StackTrace properties of the exception
        /// and returns the new exception. This is not allowed to call other
        /// Throw*Exception variants, since they call this.
        /// </summary>
        /// <returns>Exception instance ready to throw.</returns>
        internal static PSNotImplementedException NewNotImplementedException()
        {
            string message = StringUtil.Format(AutomationExceptions.NotImplemented,
                                               new System.Diagnostics.StackTrace().GetFrame(0).ToString());
            var e = new PSNotImplementedException(message);

            return(e);
        }
コード例 #3
0
ファイル: MshTraceSource.cs プロジェクト: x1m0/PowerShell
        /// <summary>
        /// Traces the Message and StackTrace properties of the exception
        /// and returns the new exception. This is not allowed to call other
        /// Throw*Exception variants, since they call this.
        /// </summary>
        /// <returns>Exception instance ready to throw</returns>
        internal static PSNotImplementedException NewNotImplementedException()
        {
#if CORECLR //TODO:CORECLR StackTrace is not in CoreCLR
            string message = string.Empty;
#else
            string message = StringUtil.Format(AutomationExceptions.NotImplemented,
                                               new System.Diagnostics.StackTrace().GetFrame(0).ToString());
#endif
            var e = new PSNotImplementedException(message);

            return(e);
        }
コード例 #4
0
ファイル: MshTraceSource.cs プロジェクト: dfinke/powershell
        /// <summary>
        /// Traces the Message and StackTrace properties of the exception
        /// and returns the new exception. This is not allowed to call other
        /// Throw*Exception variants, since they call this.
        /// </summary>
        /// <returns>Exception instance ready to throw</returns>
        internal static PSNotImplementedException NewNotImplementedException()
        {
#if CORECLR //TODO:CORECLR StackTrace is not in CoreCLR
            string message = string.Empty;
#else
            string message = StringUtil.Format(AutomationExceptions.NotImplemented,
                new System.Diagnostics.StackTrace().GetFrame(0).ToString());
#endif
            var e = new PSNotImplementedException(message);

            return e;
        }