/Katmai_February2008_CTP/ServiceBrokerInterface/cs/ServiceBrokerInterface/ServiceException.cs
C# | 88 lines | 47 code | 7 blank | 34 comment | 0 complexity | 7b0a8335c8eb3d77341d4bb2fd9f47d1 MD5 | raw file
1//----------------------------------------------------------------------- 2// This file is part of the Microsoft Code Samples. 3// 4// Copyright (C) Microsoft Corporation. All rights reserved. 5// 6//This source code is intended only as a supplement to Microsoft 7//Development Tools and/or on-line documentation. See these other 8//materials for detailed information regarding Microsoft code samples. 9// 10//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY 11//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 13//PARTICULAR PURPOSE. 14//----------------------------------------------------------------------- 15 16#region Using directives 17 18using System; 19using System.Data; 20using System.Data.SqlClient; 21using System.Data.SqlTypes; 22using System.Collections.Generic; 23using System.Text; 24using System.Diagnostics; 25using System.Reflection; 26 27#endregion 28 29namespace Microsoft.Samples.SqlServer 30{ 31 /// <remarks> 32 /// This class wraps the exceptions thrown in the <c>Run</c> method of the 33 /// <c>Service</c> class. 34 /// </remarks> 35 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] 36 public class ServiceException : Exception 37 { 38 #region Fields 39 private SqlConnection m_connection; 40 /// <summary> 41 /// 42 /// </summary> 43 public SqlConnection Connection 44 { 45 get { return m_connection; } 46 } 47 48 private SqlTransaction m_transaction; 49 /// <summary> 50 /// 51 /// </summary> 52 public SqlTransaction Transaction 53 { 54 get { return m_transaction; } 55 } 56 57 private Conversation m_currentConversation; 58 /// <summary> 59 /// 60 /// </summary> 61 public Conversation CurrentConversation 62 { 63 get { return m_currentConversation; } 64 } 65 #endregion 66 67 #region Constructor 68 /// <summary> 69 /// 70 /// </summary> 71 /// <param name="currentConversation"></param> 72 /// <param name="connection"></param> 73 /// <param name="transaction"></param> 74 /// <param name="exception"></param> 75 public ServiceException( 76 Conversation currentConversation, 77 SqlConnection connection, 78 SqlTransaction transaction, 79 Exception exception) 80 : base(exception.Message, exception) 81 { 82 m_currentConversation = currentConversation; 83 m_connection = connection; 84 m_transaction = transaction; 85 } 86 #endregion 87 } 88}