Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceClientException.cs / 1305376 / DataServiceClientException.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Exception class for server errors. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Security.Permissions; ////// The exception that is thrown when the server returns an error. /// #if !ASTORIA_LIGHT [Serializable] #endif [System.Diagnostics.DebuggerDisplay("{Message}")] public sealed class DataServiceClientException : InvalidOperationException { ///status code as returned by the server. private readonly int statusCode; #region Constructors. ////// Creates a new instance of DataServiceQueryException. /// public DataServiceClientException() : this(Strings.DataServiceException_GeneralError) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. public DataServiceClientException(string message) : this(message, null) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// Exception that caused this exception to be thrown. public DataServiceClientException(string message, Exception innerException) : this(message, innerException, 500) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// status code as returned by the server. public DataServiceClientException(string message, int statusCode) : this(message, null, statusCode) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// Exception that caused this exception to be thrown. /// status code as returned by the server. public DataServiceClientException(string message, Exception innerException, int statusCode) : base(message, innerException) { this.statusCode = statusCode; } #if !ASTORIA_LIGHT #pragma warning disable 0628 ////// Initializes a new instance of the DataServiceQueryException class from the /// specified SerializationInfo and StreamingContext instances. /// /// /// A SerializationInfo containing the information required to serialize /// the new DataServiceQueryException. /// /// A StreamingContext containing the source of the serialized stream /// associated with the new DataServiceQueryException. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1047", Justification = "Follows serialization info pattern.")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032", Justification = "Follows serialization info pattern.")] protected DataServiceClientException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) { if (serializationInfo != null) { this.statusCode = serializationInfo.GetInt32("statusCode"); } } #pragma warning restore 0628 #endif #endregion Constructors. #region Public properties. ///Error code to be used in payloads. public int StatusCode { get { return this.statusCode; } } #endregion Public properties. #region Methods. #if !ASTORIA_LIGHT ////// Sets the SerializationInfo with information about the exception. /// /// The SerializationInfo that holds the serialized object data about the exception being thrown. /// The StreamingContext that contains contextual information about the source or destination. [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] [System.Security.SecurityCritical] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { if (info != null) { info.AddValue("statusCode", this.statusCode); } base.GetObjectData(info, context); } #endif #endregion Methods. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Exception class for server errors. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Security.Permissions; ////// The exception that is thrown when the server returns an error. /// #if !ASTORIA_LIGHT [Serializable] #endif [System.Diagnostics.DebuggerDisplay("{Message}")] public sealed class DataServiceClientException : InvalidOperationException { ///status code as returned by the server. private readonly int statusCode; #region Constructors. ////// Creates a new instance of DataServiceQueryException. /// public DataServiceClientException() : this(Strings.DataServiceException_GeneralError) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. public DataServiceClientException(string message) : this(message, null) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// Exception that caused this exception to be thrown. public DataServiceClientException(string message, Exception innerException) : this(message, innerException, 500) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// status code as returned by the server. public DataServiceClientException(string message, int statusCode) : this(message, null, statusCode) { } ////// Creates a new instance of DataServiceQueryException. /// /// error message for this exception. /// Exception that caused this exception to be thrown. /// status code as returned by the server. public DataServiceClientException(string message, Exception innerException, int statusCode) : base(message, innerException) { this.statusCode = statusCode; } #if !ASTORIA_LIGHT #pragma warning disable 0628 ////// Initializes a new instance of the DataServiceQueryException class from the /// specified SerializationInfo and StreamingContext instances. /// /// /// A SerializationInfo containing the information required to serialize /// the new DataServiceQueryException. /// /// A StreamingContext containing the source of the serialized stream /// associated with the new DataServiceQueryException. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1047", Justification = "Follows serialization info pattern.")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032", Justification = "Follows serialization info pattern.")] protected DataServiceClientException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) { if (serializationInfo != null) { this.statusCode = serializationInfo.GetInt32("statusCode"); } } #pragma warning restore 0628 #endif #endregion Constructors. #region Public properties. ///Error code to be used in payloads. public int StatusCode { get { return this.statusCode; } } #endregion Public properties. #region Methods. #if !ASTORIA_LIGHT ////// Sets the SerializationInfo with information about the exception. /// /// The SerializationInfo that holds the serialized object data about the exception being thrown. /// The StreamingContext that contains contextual information about the source or destination. [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] [System.Security.SecurityCritical] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { if (info != null) { info.AddValue("statusCode", this.statusCode); } base.GetObjectData(info, context); } #endif #endregion Methods. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FrameworkContextData.cs
- ResourcesBuildProvider.cs
- QuadraticBezierSegment.cs
- Bidi.cs
- CodeLinePragma.cs
- ForeignKeyConstraint.cs
- SqlFacetAttribute.cs
- ConnectionPoolManager.cs
- LinqDataSourceStatusEventArgs.cs
- DataAdapter.cs
- _ShellExpression.cs
- XPathException.cs
- SplitContainer.cs
- SQLUtility.cs
- FloaterBaseParagraph.cs
- EventRoute.cs
- LinearQuaternionKeyFrame.cs
- BrowserCapabilitiesFactory35.cs
- StatusBarAutomationPeer.cs
- LongValidator.cs
- ViewStateModeByIdAttribute.cs
- SafeFileHandle.cs
- TypeContext.cs
- EmbeddedObject.cs
- LocationReference.cs
- DictionaryEntry.cs
- SQLInt16Storage.cs
- RewritingValidator.cs
- TimeEnumHelper.cs
- DataGridViewButtonCell.cs
- StructuredType.cs
- AdjustableArrowCap.cs
- ConvertEvent.cs
- FrameworkReadOnlyPropertyMetadata.cs
- InputLangChangeRequestEvent.cs
- RMEnrollmentPage2.cs
- HtmlWindow.cs
- ClusterRegistryConfigurationProvider.cs
- UserControlBuildProvider.cs
- ZoneButton.cs
- FilteredXmlReader.cs
- XmlArrayItemAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- ResourcePool.cs
- WebPartZone.cs
- BasicExpandProvider.cs
- DefaultBindingPropertyAttribute.cs
- BinHexDecoder.cs
- MultiSelectRootGridEntry.cs
- CultureTableRecord.cs
- FontNameConverter.cs
- QilName.cs
- URLMembershipCondition.cs
- XsltLibrary.cs
- Focus.cs
- EmptyReadOnlyDictionaryInternal.cs
- CancelEventArgs.cs
- SelectionList.cs
- BoundConstants.cs
- CustomValidator.cs
- WindowsContainer.cs
- OperationPickerDialog.designer.cs
- Comparer.cs
- TableColumn.cs
- HtmlEmptyTagControlBuilder.cs
- Size.cs
- Application.cs
- ZoneMembershipCondition.cs
- DateTimeOffset.cs
- HttpResponseHeader.cs
- SafeSecurityHelper.cs
- WCFServiceClientProxyGenerator.cs
- JsonObjectDataContract.cs
- FullTextLine.cs
- SecuritySessionFilter.cs
- RequiredFieldValidator.cs
- PerformanceCounterManager.cs
- UInt64.cs
- ArgumentReference.cs
- TextSchema.cs
- DragDropManager.cs
- TypeConverter.cs
- BindingList.cs
- ModelTypeConverter.cs
- MenuBase.cs
- DataError.cs
- ErrorReporting.cs
- HttpConfigurationContext.cs
- DriveNotFoundException.cs
- UriSection.cs
- MultiTrigger.cs
- TagPrefixCollection.cs
- MultilineStringConverter.cs
- TextBox.cs
- PageContentCollection.cs
- CheckBoxBaseAdapter.cs
- wgx_sdk_version.cs
- Pair.cs
- RelationshipEndMember.cs
- Command.cs