XamlException 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 XamlException 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| XamlException() |
初始化 XamlException 类的新实例。 该实例包含描述错误的系统提供的消息。 |
| XamlException(String) |
初始化 XamlException 类的新实例。 该实例包含描述错误的指定消息。 |
| XamlException(SerializationInfo, StreamingContext) |
使用序列化数据初始化类的新实例 XamlException 。 |
| XamlException(String, Exception) |
初始化 XamlException 类的新实例。 该实例包含指定的错误消息和对此异常原因的内部异常的引用。 |
| XamlException(String, Exception, Int32, Int32) |
初始化 XamlException 类的新实例。 该实例包含指定的错误消息、内部异常和行信息。 |
XamlException()
初始化 XamlException 类的新实例。 该实例包含描述错误的系统提供的消息。
public:
XamlException();
public XamlException();
Public Sub New ()
适用于
XamlException(String)
初始化 XamlException 类的新实例。 该实例包含描述错误的指定消息。
public:
XamlException(System::String ^ message);
public XamlException(string message);
new System.Xaml.XamlException : string -> System.Xaml.XamlException
Public Sub New (message As String)
参数
- message
- String
描述异常的消息。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。
适用于
XamlException(SerializationInfo, StreamingContext)
使用序列化数据初始化类的新实例 XamlException 。
protected:
XamlException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected XamlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Xaml.XamlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xaml.XamlException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
参数
- info
- SerializationInfo
保存序列化对象数据的对象。
- context
- StreamingContext
有关源或目标的上下文信息。
例外
info 是 null。
适用于
XamlException(String, Exception)
初始化 XamlException 类的新实例。 该实例包含指定的错误消息和对此异常原因的内部异常的引用。
public:
XamlException(System::String ^ message, Exception ^ innerException);
public XamlException(string message, Exception innerException);
new System.Xaml.XamlException : string * Exception -> System.Xaml.XamlException
Public Sub New (message As String, innerException As Exception)
参数
- message
- String
描述异常的消息。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。
- innerException
- Exception
是当前异常原因的异常。 如果未 innerExceptionnull 参数,则会在处理内部异常的 catch 块中引发当前异常。
注解
由于上一个异常应包含对属性中上一个异常的引用而引发的 InnerException 异常。 该InnerException属性返回传递给构造函数的相同值;如果该属性未向构造函数提供内部异常值,则InnerException返回null该值。
适用于
XamlException(String, Exception, Int32, Int32)
初始化 XamlException 类的新实例。 该实例包含指定的错误消息、内部异常和行信息。
public:
XamlException(System::String ^ message, Exception ^ innerException, int lineNumber, int linePosition);
public XamlException(string message, Exception innerException, int lineNumber, int linePosition);
new System.Xaml.XamlException : string * Exception * int * int -> System.Xaml.XamlException
Public Sub New (message As String, innerException As Exception, lineNumber As Integer, linePosition As Integer)
参数
- message
- String
描述异常的消息。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。
- innerException
- Exception
是当前异常原因的异常。
- lineNumber
- Int32
要向调试或行信息使用者报告的行号。
- linePosition
- Int32
要向调试或行信息使用者报告的行位置。