Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data / System / Data / SqlClient / SqlInfoMessageEvent.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="SqlInfoMessageEvent.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
8
9 namespace System.Data.SqlClient {
10     using System;
11
12     public sealed class SqlInfoMessageEventArgs : System.EventArgs {
13         private SqlException exception;
14
15         internal SqlInfoMessageEventArgs(SqlException exception) {
16             this.exception = exception;
17         }
18
19         public SqlErrorCollection Errors {
20             get { return exception.Errors;}
21         }
22
23         /*virtual protected*/private bool ShouldSerializeErrors() { // MDAC 65548
24             return (null != exception) && (0 < exception.Errors.Count);
25         }
26
27         public string Message { // MDAC 68482
28             get { return exception.Message; }
29         }
30
31         public string Source { // MDAC 68482
32             get { return exception.Source;}
33         }
34
35         override public string ToString() { // MDAC 68482
36             return Message;
37         }
38     }
39 }