Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PropertyReferenceSerializer.cs
- ActiveXSite.cs
- SafeReadContext.cs
- SoapDocumentServiceAttribute.cs
- SystemSounds.cs
- DesignerForm.cs
- Camera.cs
- _SslSessionsCache.cs
- ExternalCalls.cs
- MemberRelationshipService.cs
- Propagator.cs
- VisualBasic.cs
- FixedPageProcessor.cs
- Marshal.cs
- MethodCallTranslator.cs
- CreatingCookieEventArgs.cs
- TextParaClient.cs
- GeometryValueSerializer.cs
- TypeDescriptorFilterService.cs
- ImageSource.cs
- SectionInformation.cs
- DataGridViewTextBoxEditingControl.cs
- DefaultTextStoreTextComposition.cs
- EncryptedKeyIdentifierClause.cs
- CompilerCollection.cs
- CmsInterop.cs
- PropertyRecord.cs
- ManagedFilter.cs
- DescendantOverDescendantQuery.cs
- HandlerWithFactory.cs
- SplitterCancelEvent.cs
- ApplicationActivator.cs
- CodeSnippetStatement.cs
- RouteItem.cs
- CircleHotSpot.cs
- HitTestDrawingContextWalker.cs
- FixedSOMGroup.cs
- ReadWriteSpinLock.cs
- SafeFileHandle.cs
- Effect.cs
- DrawingAttributeSerializer.cs
- PointConverter.cs
- DataGridHeaderBorder.cs
- ProtectedConfiguration.cs
- ViewManager.cs
- brushes.cs
- PointAnimationUsingPath.cs
- ManifestSignedXml.cs
- SQLDouble.cs
- OLEDB_Enum.cs
- TableParagraph.cs
- DSASignatureDeformatter.cs
- CodeStatement.cs
- SiteMapPath.cs
- IdnMapping.cs
- ResourceSet.cs
- ViewPort3D.cs
- FormParameter.cs
- XmlSchemaAny.cs
- SecureStringHasher.cs
- Selection.cs
- ScrollViewerAutomationPeer.cs
- CalendarDateRange.cs
- Model3DGroup.cs
- PhysicalFontFamily.cs
- Composition.cs
- KeyValueConfigurationElement.cs
- SqlConnectionPoolProviderInfo.cs
- ColorMap.cs
- FlowDocumentReader.cs
- ValueUnavailableException.cs
- HttpPostedFileBase.cs
- ipaddressinformationcollection.cs
- ViewSimplifier.cs
- Attributes.cs
- EventHandlerList.cs
- DependencyObjectProvider.cs
- DynamicArgumentDialog.cs
- LayoutEvent.cs
- Propagator.ExtentPlaceholderCreator.cs
- DialogResultConverter.cs
- HttpWebRequestElement.cs
- OracleBoolean.cs
- UrlMappingCollection.cs
- StateMachineWorkflow.cs
- GeometryModel3D.cs
- FtpCachePolicyElement.cs
- Set.cs
- ImageMapEventArgs.cs
- Int32.cs
- DownloadProgressEventArgs.cs
- RealizedColumnsBlock.cs
- SecurityHeaderTokenResolver.cs
- CellConstantDomain.cs
- PageCopyCount.cs
- XmlSerializerAssemblyAttribute.cs
- ApplicationTrust.cs
- WSDualHttpBindingElement.cs
- ContextQuery.cs
- AutomationElementCollection.cs