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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DBSchemaTable.cs
- StaticFileHandler.cs
- SafeArrayRankMismatchException.cs
- XmlSerializationWriter.cs
- HtmlTableRow.cs
- X509CertificateStore.cs
- parserscommon.cs
- BulletedList.cs
- NumberFunctions.cs
- TypeCollectionDesigner.xaml.cs
- ProcessHostConfigUtils.cs
- ImageSource.cs
- ColorBuilder.cs
- HttpHandlerActionCollection.cs
- HandlerFactoryWrapper.cs
- FileClassifier.cs
- hebrewshape.cs
- ConfigViewGenerator.cs
- MethodExpr.cs
- CommentEmitter.cs
- XsltLibrary.cs
- PolyBezierSegmentFigureLogic.cs
- CallTemplateAction.cs
- ForwardPositionQuery.cs
- DataIdProcessor.cs
- PasswordRecovery.cs
- ValueOfAction.cs
- WebPartConnection.cs
- InteropBitmapSource.cs
- ModelFunctionTypeElement.cs
- RegexTree.cs
- JoinElimination.cs
- FlowPosition.cs
- BindingExpressionBase.cs
- GeneralTransform3D.cs
- PresentationTraceSources.cs
- ExtensionQuery.cs
- ResponseStream.cs
- FindCriteriaElement.cs
- OperationInfoBase.cs
- SecurityState.cs
- XmlTypeAttribute.cs
- HandlerBase.cs
- SimpleHandlerBuildProvider.cs
- HtmlInputFile.cs
- NetworkInterface.cs
- SudsCommon.cs
- WebPartTransformerCollection.cs
- SqlDataReader.cs
- DataGridViewTextBoxColumn.cs
- FilterQueryOptionExpression.cs
- EventListener.cs
- StateItem.cs
- unsafenativemethodstextservices.cs
- EntityContainerAssociationSet.cs
- ValidationSummary.cs
- TreeNode.cs
- ConstraintCollection.cs
- securitycriticaldataClass.cs
- PerformanceCounterPermissionEntryCollection.cs
- InputReportEventArgs.cs
- Thread.cs
- DataGridViewComboBoxEditingControl.cs
- IProvider.cs
- ReachDocumentReferenceSerializerAsync.cs
- MailMessage.cs
- TraceUtility.cs
- MailAddressParser.cs
- StorageMappingItemCollection.cs
- safex509handles.cs
- EntityDataSourceWrapper.cs
- StrongNameMembershipCondition.cs
- PointLight.cs
- UnsafeNetInfoNativeMethods.cs
- MembershipUser.cs
- _MultipleConnectAsync.cs
- XhtmlBasicLabelAdapter.cs
- iisPickupDirectory.cs
- TraceHandlerErrorFormatter.cs
- ISO2022Encoding.cs
- CodeIndexerExpression.cs
- ListDictionaryInternal.cs
- TripleDESCryptoServiceProvider.cs
- SqlCaseSimplifier.cs
- CacheMemory.cs
- XmlSignatureManifest.cs
- InstalledFontCollection.cs
- FtpRequestCacheValidator.cs
- FontCollection.cs
- QilCloneVisitor.cs
- HandlerElement.cs
- WorkflowLayouts.cs
- PreviewPageInfo.cs
- TreeNodeCollectionEditorDialog.cs
- COM2IDispatchConverter.cs
- DocumentViewerAutomationPeer.cs
- ObjectReaderCompiler.cs
- TextDecoration.cs
- GraphicsContext.cs
- SecurityContextSecurityToken.cs