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
- XamlRtfConverter.cs
- KoreanLunisolarCalendar.cs
- VectorConverter.cs
- RawStylusInputCustomDataList.cs
- Parameter.cs
- QueryExpression.cs
- RequestSecurityToken.cs
- WindowShowOrOpenTracker.cs
- RedirectionProxy.cs
- ImageButton.cs
- Exceptions.cs
- Timer.cs
- ImageBrush.cs
- AssemblyCacheEntry.cs
- PageBuildProvider.cs
- MonthCalendar.cs
- IPHostEntry.cs
- AndAlso.cs
- TableRow.cs
- CollectionBase.cs
- NativeMethods.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- DbConnectionFactory.cs
- filewebresponse.cs
- RbTree.cs
- PerfCounters.cs
- MsdtcClusterUtils.cs
- StrokeNodeOperations2.cs
- StateMachine.cs
- RouteItem.cs
- ShutDownListener.cs
- DesignerContextDescriptor.cs
- ProxyWebPartManager.cs
- DocumentSequence.cs
- SqlParameterCollection.cs
- MemberAccessException.cs
- InvalidEnumArgumentException.cs
- SqlMethods.cs
- Regex.cs
- PreDigestedSignedInfo.cs
- _AuthenticationState.cs
- DataControlFieldCell.cs
- XmlDictionary.cs
- ApplicationInfo.cs
- HeaderedContentControl.cs
- ContextMenuAutomationPeer.cs
- xml.cs
- DataBindingCollectionConverter.cs
- Pair.cs
- DirectoryNotFoundException.cs
- ComponentResourceKey.cs
- ControlBuilderAttribute.cs
- NetCodeGroup.cs
- EntityDataSourceDataSelectionPanel.cs
- InputBindingCollection.cs
- FigureParaClient.cs
- ConfigUtil.cs
- PromptEventArgs.cs
- CqlBlock.cs
- WebPartVerbsEventArgs.cs
- GlobalProxySelection.cs
- PromptStyle.cs
- ResponseStream.cs
- ContainerFilterService.cs
- SqlConnectionStringBuilder.cs
- VoiceChangeEventArgs.cs
- SiteMapDataSourceDesigner.cs
- COSERVERINFO.cs
- TreeIterators.cs
- PropertyPathConverter.cs
- SectionInput.cs
- DesigntimeLicenseContextSerializer.cs
- PrintDialogException.cs
- AssemblyName.cs
- RIPEMD160Managed.cs
- LoadedOrUnloadedOperation.cs
- FusionWrap.cs
- MailBnfHelper.cs
- TypeElement.cs
- WmlValidationSummaryAdapter.cs
- glyphs.cs
- ObjectPersistData.cs
- PixelShader.cs
- SiteOfOriginPart.cs
- DataGridCommandEventArgs.cs
- DataGridViewCellStyleEditor.cs
- Evidence.cs
- ArglessEventHandlerProxy.cs
- BoolLiteral.cs
- DictionaryGlobals.cs
- ProfileGroupSettingsCollection.cs
- Aggregates.cs
- Descriptor.cs
- TemplateComponentConnector.cs
- SizeLimitedCache.cs
- _AcceptOverlappedAsyncResult.cs
- InputMethod.cs
- Duration.cs
- Token.cs
- RequestCacheValidator.cs