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
- PropertyChangeTracker.cs
- MenuEventArgs.cs
- ApplicationException.cs
- controlskin.cs
- XmlElementAttribute.cs
- safelinkcollection.cs
- ControlBuilder.cs
- AttributeUsageAttribute.cs
- XmlWrappingReader.cs
- Int64AnimationBase.cs
- LinqDataSourceContextEventArgs.cs
- BuildTopDownAttribute.cs
- MailDefinition.cs
- ClientEventManager.cs
- PrimarySelectionGlyph.cs
- GiveFeedbackEvent.cs
- RenderTargetBitmap.cs
- EventLogSession.cs
- HttpModuleCollection.cs
- HttpCacheVary.cs
- RoutedEventConverter.cs
- DoubleLinkListEnumerator.cs
- ToolboxDataAttribute.cs
- ImageConverter.cs
- Stack.cs
- ProjectionPruner.cs
- MediaPlayer.cs
- ReadContentAsBinaryHelper.cs
- DeadLetterQueue.cs
- ImageKeyConverter.cs
- XmlElementAttributes.cs
- Serializer.cs
- InteropBitmapSource.cs
- ActivityTrace.cs
- HttpContext.cs
- DashStyle.cs
- WebControlsSection.cs
- HtmlTitle.cs
- SpellerError.cs
- DataGridViewColumnTypePicker.cs
- NumberFunctions.cs
- ValidationHelpers.cs
- SequenceNumber.cs
- Unit.cs
- ContextDataSourceContextData.cs
- TextBreakpoint.cs
- ByteAnimationUsingKeyFrames.cs
- RSAOAEPKeyExchangeDeformatter.cs
- GetParentChain.cs
- WorkBatch.cs
- LoadMessageLogger.cs
- PointCollection.cs
- ComNativeDescriptor.cs
- RectAnimationClockResource.cs
- PolicyManager.cs
- TrackingMemoryStreamFactory.cs
- UnwrappedTypesXmlSerializerManager.cs
- AccessorTable.cs
- TaskHelper.cs
- DataGridViewRowsRemovedEventArgs.cs
- TypeDelegator.cs
- SignatureDescription.cs
- ProjectionCamera.cs
- TraceFilter.cs
- SessionStateSection.cs
- metadatamappinghashervisitor.cs
- CharacterBufferReference.cs
- BindingMemberInfo.cs
- SHA512.cs
- InternalBase.cs
- CustomWebEventKey.cs
- CommandHelper.cs
- GuidConverter.cs
- AdapterDictionary.cs
- ManagementOperationWatcher.cs
- StopRoutingHandler.cs
- RequestQueue.cs
- EntityViewGenerator.cs
- CollectionAdapters.cs
- BuildResultCache.cs
- XmlSerializationReader.cs
- COM2PropertyDescriptor.cs
- EmptyStringExpandableObjectConverter.cs
- DragAssistanceManager.cs
- PageAction.cs
- StandardCommands.cs
- ApplicationDirectoryMembershipCondition.cs
- ProofTokenCryptoHandle.cs
- DataSourceProvider.cs
- FeatureManager.cs
- HtmlForm.cs
- Exceptions.cs
- XmlDataProvider.cs
- SubclassTypeValidator.cs
- NamedPermissionSet.cs
- VirtualizingPanel.cs
- OneOfScalarConst.cs
- PartDesigner.cs
- NavigateEvent.cs
- SpecialNameAttribute.cs