Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- X509Utils.cs
- RepeatButton.cs
- ListViewGroupConverter.cs
- Bidi.cs
- XmlSignatureManifest.cs
- LabelDesigner.cs
- SQLByte.cs
- OletxResourceManager.cs
- XmlSerializerVersionAttribute.cs
- DataRecordInfo.cs
- DeadCharTextComposition.cs
- VariableQuery.cs
- NetworkCredential.cs
- UserControlParser.cs
- XmlBuffer.cs
- ArrayList.cs
- SignatureToken.cs
- _SingleItemRequestCache.cs
- PerformanceCounterPermissionEntry.cs
- DataGridViewLinkColumn.cs
- UnsafeNativeMethods.cs
- QilTypeChecker.cs
- SafeProcessHandle.cs
- FlowLayoutSettings.cs
- JsonByteArrayDataContract.cs
- FtpWebRequest.cs
- DnsEndpointIdentity.cs
- StreamingContext.cs
- GenericsInstances.cs
- ReachDocumentReferenceSerializer.cs
- StaticSiteMapProvider.cs
- DriveInfo.cs
- SettingsAttributeDictionary.cs
- LicenseException.cs
- VerticalAlignConverter.cs
- SrgsItemList.cs
- SynchronizedDispatch.cs
- XmlWriter.cs
- DictionaryItemsCollection.cs
- LicenseContext.cs
- InputLanguageCollection.cs
- LinqDataSource.cs
- TextMetrics.cs
- XmlSchemaSimpleContentRestriction.cs
- PrePostDescendentsWalker.cs
- SemanticResolver.cs
- WebResourceAttribute.cs
- EmptyStringExpandableObjectConverter.cs
- SessionStateItemCollection.cs
- RSAOAEPKeyExchangeFormatter.cs
- DataPagerCommandEventArgs.cs
- WebBrowserSiteBase.cs
- BaseInfoTable.cs
- ReaderWriterLockWrapper.cs
- TextCompositionManager.cs
- XmlSchemaSimpleContent.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- WebScriptMetadataInstanceContextProvider.cs
- thaishape.cs
- ManagedWndProcTracker.cs
- IBuiltInEvidence.cs
- xml.cs
- OracleCommandBuilder.cs
- Monitor.cs
- MediaEntryAttribute.cs
- storepermissionattribute.cs
- UiaCoreTypesApi.cs
- ImageClickEventArgs.cs
- AddingNewEventArgs.cs
- PenThreadWorker.cs
- activationcontext.cs
- ProviderSettingsCollection.cs
- ActivityBuilder.cs
- QuaternionAnimationUsingKeyFrames.cs
- SmiMetaData.cs
- EnlistmentTraceIdentifier.cs
- CellParagraph.cs
- XmlCharCheckingWriter.cs
- StrongNameKeyPair.cs
- XmlReaderSettings.cs
- PlainXmlWriter.cs
- BindingContext.cs
- ListenerElementsCollection.cs
- CodePrimitiveExpression.cs
- ChildrenQuery.cs
- ReliableOutputConnection.cs
- ImmComposition.cs
- SkinBuilder.cs
- BinaryUtilClasses.cs
- DesigntimeLicenseContextSerializer.cs
- MostlySingletonList.cs
- GcSettings.cs
- unitconverter.cs
- DataGridSortCommandEventArgs.cs
- MasterPageCodeDomTreeGenerator.cs
- Utils.cs
- WindowsRebar.cs
- GridProviderWrapper.cs
- PerformanceCounterManager.cs
- SessionEndingEventArgs.cs