Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceClientException.cs / 1 / 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)] 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)] 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
- ArithmeticException.cs
- FloaterBaseParaClient.cs
- SmiXetterAccessMap.cs
- SqlMethods.cs
- EventLogPermissionAttribute.cs
- ControlParser.cs
- RouteUrlExpressionBuilder.cs
- EventPropertyMap.cs
- HttpWriter.cs
- DatePickerDateValidationErrorEventArgs.cs
- PropertyCondition.cs
- cookie.cs
- LoadGrammarCompletedEventArgs.cs
- WorkflowApplicationCompletedEventArgs.cs
- WinInet.cs
- BaseAsyncResult.cs
- TimeIntervalCollection.cs
- AttributeQuery.cs
- UTF32Encoding.cs
- DrawingDrawingContext.cs
- ProjectionCamera.cs
- WebZone.cs
- SizeLimitedCache.cs
- HwndMouseInputProvider.cs
- XslException.cs
- ListComponentEditor.cs
- Line.cs
- ResourceDescriptionAttribute.cs
- WorkflowMessageEventArgs.cs
- PluralizationServiceUtil.cs
- DateTimePicker.cs
- DoubleIndependentAnimationStorage.cs
- LoadRetryHandler.cs
- SoapIgnoreAttribute.cs
- XmlSchemaCompilationSettings.cs
- Attributes.cs
- SchemaTypeEmitter.cs
- InstanceDataCollection.cs
- ButtonFieldBase.cs
- BaseCodeDomTreeGenerator.cs
- LicenseManager.cs
- PropertyDescriptorCollection.cs
- X509SecurityTokenParameters.cs
- PaginationProgressEventArgs.cs
- CompiledQuery.cs
- DesignBindingEditor.cs
- StylusPlugInCollection.cs
- ShapeTypeface.cs
- RoleGroupCollection.cs
- AttributeCollection.cs
- PrintControllerWithStatusDialog.cs
- StateManagedCollection.cs
- WorkflowDebuggerSteppingAttribute.cs
- ByteConverter.cs
- GraphicsContext.cs
- EventMappingSettingsCollection.cs
- TextUtf8RawTextWriter.cs
- Visual3D.cs
- Behavior.cs
- ControlPaint.cs
- HtmlInputImage.cs
- X509CertificateStore.cs
- DbgUtil.cs
- XmlMembersMapping.cs
- StringFreezingAttribute.cs
- DirectionalLight.cs
- WebZone.cs
- Icon.cs
- DispatcherExceptionFilterEventArgs.cs
- PermissionListSet.cs
- counter.cs
- ObjectList.cs
- FontFamilyIdentifier.cs
- SchemaObjectWriter.cs
- CultureMapper.cs
- XmlEntityReference.cs
- BufferedStream.cs
- AssociationEndMember.cs
- DataGridViewAutoSizeModeEventArgs.cs
- UnsafeNativeMethodsPenimc.cs
- ConfigurationSettings.cs
- StandardCommands.cs
- PcmConverter.cs
- CompilerWrapper.cs
- LinkLabel.cs
- FileUtil.cs
- IRCollection.cs
- Types.cs
- InfoCardKeyedHashAlgorithm.cs
- prompt.cs
- TextCharacters.cs
- ReflectionHelper.cs
- DataContract.cs
- DateTimeStorage.cs
- DbDataSourceEnumerator.cs
- CodeDelegateInvokeExpression.cs
- MenuItemBindingCollection.cs
- MessageQueueEnumerator.cs
- AlternateViewCollection.cs
- WebZone.cs