// Copyright (c) Microsoft Corporation.// Licensed under the MIT License.using System.Runtime.Serialization;namespace System.Management.Automation{/// <summary>/// Defines the exception that is thrown if a native command fails./// </summary>[Serializable]public class ApplicationFailedException : RuntimeException{#region privateprivate const string errorIdString = "NativeCommandFailed";#endregion#region ctor#region Serialization/// <summary>/// Initializes a new instance of the ApplicationFailedException class and defines the serialization information,/// and streaming context./// </summary>/// <param name="info">The serialization information to use when initializing this object.</param>/// <param name="context">The streaming context to use when initializing this object.</param>/// <returns>Constructed object.</returns>protected ApplicationFailedException(SerializationInfo info,StreamingContext context): base(info, context){}#endregion Serialization/// <summary>/// Initializes a new instance of the class ApplicationFailedException./// </summary>/// <returns>Constructed object.</returns>public ApplicationFailedException() : base(){base.SetErrorId(errorIdString);base.SetErrorCategory(ErrorCategory.ResourceUnavailable);}/// <summary>/// Initializes a new instance of the ApplicationFailedException class and defines the error message./// </summary>/// <param name="message">The error message to use when initializing this object.</param>/// <returns>Constructed object.</returns>public ApplicationFailedException(string message) : base(message){base.SetErrorId(errorIdString);base.SetErrorCategory(ErrorCategory.ResourceUnavailable);}/// <summary>/// Initializes a new instance of the ApplicationFailedException class and defines the error message and/// errorID./// </summary>/// <param name="message">The error message to use when initializing this object.</param>/// <param name="errorId">The errorId to use when initializing this object.</param>/// <returns>Constructed object.</returns>internal ApplicationFailedException(string message, string errorId) : base(message){base.SetErrorId(errorId);base.SetErrorCategory(ErrorCategory.ResourceUnavailable);}/// <summary>/// Initializes a new instance of the ApplicationFailedException class and defines the error message,/// error ID and inner exception./// </summary>/// <param name="message">The error message to use when initializing this object.</param>/// <param name="errorId">The errorId to use when initializing this object.</param>/// <param name="innerException">The inner exception to use when initializing this object.</param>/// <returns>Constructed object.</returns>internal ApplicationFailedException(string message, string errorId, Exception innerException): base(message, innerException){base.SetErrorId(errorId);base.SetErrorCategory(ErrorCategory.ResourceUnavailable);}/// <summary>/// Initializes a new instance of the ApplicationFailedException class and defines the error message and/// inner exception./// </summary>/// <param name="message">The error message to use when initializing this object.</param>/// <param name="innerException">The inner exception to use when initializing this object.</param>/// <returns>Constructed object.</returns>public ApplicationFailedException(string message,Exception innerException): base(message, innerException){base.SetErrorId(errorIdString);base.SetErrorCategory(ErrorCategory.ResourceUnavailable);}#endregion ctor}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。