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
- WinFormsSpinner.cs
- MarkupCompilePass1.cs
- HttpCacheParams.cs
- TypeDependencyAttribute.cs
- ColorDialog.cs
- DuplexSecurityProtocolFactory.cs
- ToolBar.cs
- RegexCharClass.cs
- WindowsIdentity.cs
- QilExpression.cs
- HttpHandlerAction.cs
- JobPageOrder.cs
- ZipArchive.cs
- ItemCheckedEvent.cs
- ListBindingHelper.cs
- Misc.cs
- StorageFunctionMapping.cs
- TableRowCollection.cs
- DateTimeValueSerializerContext.cs
- IDispatchConstantAttribute.cs
- Logging.cs
- AttachmentService.cs
- CompilerGeneratedAttribute.cs
- XmlTextReaderImplHelpers.cs
- Container.cs
- CollectionConverter.cs
- CodeTypeParameter.cs
- MarkupWriter.cs
- SignatureHelper.cs
- PagedDataSource.cs
- _HTTPDateParse.cs
- EventHandlersDesigner.cs
- DocumentReference.cs
- DataGridViewCellPaintingEventArgs.cs
- NameValueFileSectionHandler.cs
- EdmConstants.cs
- AuthenticationService.cs
- SpeechAudioFormatInfo.cs
- _SslSessionsCache.cs
- CodeChecksumPragma.cs
- RecommendedAsConfigurableAttribute.cs
- PointF.cs
- HiddenFieldPageStatePersister.cs
- SR.cs
- ProxyWebPartConnectionCollection.cs
- SchemaNames.cs
- LineBreakRecord.cs
- DataError.cs
- ConfigPathUtility.cs
- processwaithandle.cs
- WebAdminConfigurationHelper.cs
- SqlDataSourceAdvancedOptionsForm.cs
- SettingsAttributes.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XmlJsonWriter.cs
- BinaryObjectReader.cs
- QilUnary.cs
- SymbolDocumentInfo.cs
- DbgCompiler.cs
- WebPartConnection.cs
- LambdaCompiler.Expressions.cs
- PageSettings.cs
- PinnedBufferMemoryStream.cs
- XMLUtil.cs
- TypeContext.cs
- ExpressionSelection.cs
- DataGridViewComboBoxColumn.cs
- DataGridViewCell.cs
- RepeatButtonAutomationPeer.cs
- WCFServiceClientProxyGenerator.cs
- VerificationAttribute.cs
- SoapSchemaMember.cs
- DiagnosticTrace.cs
- Endpoint.cs
- StatusBarPanelClickEvent.cs
- OrderedDictionary.cs
- AsyncCompletedEventArgs.cs
- handlecollector.cs
- SoapSchemaImporter.cs
- SQLDecimalStorage.cs
- SqlGatherConsumedAliases.cs
- PageParser.cs
- DomNameTable.cs
- BrowserCapabilitiesFactoryBase.cs
- HttpCookieCollection.cs
- SessionPageStateSection.cs
- ResourceDictionaryCollection.cs
- NominalTypeEliminator.cs
- ReachFixedDocumentSerializerAsync.cs
- Light.cs
- MetaForeignKeyColumn.cs
- Property.cs
- GeometryModel3D.cs
- ZipIOBlockManager.cs
- PointAnimationUsingPath.cs
- AccessibilityHelperForVista.cs
- SqlBooleanMismatchVisitor.cs
- LoadGrammarCompletedEventArgs.cs
- odbcmetadatafactory.cs
- TextServicesContext.cs