Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceClientException.cs / 2 / 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
- SHA1CryptoServiceProvider.cs
- WmlListAdapter.cs
- PrinterUnitConvert.cs
- Queue.cs
- DemultiplexingClientMessageFormatter.cs
- WsatTransactionInfo.cs
- Point3DAnimationBase.cs
- VerificationAttribute.cs
- ReflectPropertyDescriptor.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- WindowsFormsSectionHandler.cs
- LineServices.cs
- ProxyManager.cs
- KeyToListMap.cs
- MatrixKeyFrameCollection.cs
- EdmItemError.cs
- SqlRemoveConstantOrderBy.cs
- XmlReflectionMember.cs
- AjaxFrameworkAssemblyAttribute.cs
- DataTablePropertyDescriptor.cs
- DbConnectionHelper.cs
- ViewLoader.cs
- SafeRightsManagementEnvironmentHandle.cs
- HtmlImage.cs
- FreezableOperations.cs
- CodeGroup.cs
- AuthenticationModuleElementCollection.cs
- Internal.cs
- remotingproxy.cs
- NetPeerTcpBindingCollectionElement.cs
- ComponentSerializationService.cs
- ClientSession.cs
- NodeFunctions.cs
- CallbackValidator.cs
- TreeViewItem.cs
- DbCommandDefinition.cs
- KeyEventArgs.cs
- UIElementParaClient.cs
- Keyboard.cs
- CodeExpressionStatement.cs
- HtmlTitle.cs
- RectIndependentAnimationStorage.cs
- XmlSerializationWriter.cs
- SizeValueSerializer.cs
- AspProxy.cs
- HttpMethodAttribute.cs
- GB18030Encoding.cs
- ServiceModelConfiguration.cs
- ResourcesBuildProvider.cs
- EntityClientCacheEntry.cs
- OleDbParameterCollection.cs
- x509utils.cs
- ConfigXmlWhitespace.cs
- ReachDocumentPageSerializer.cs
- smtpconnection.cs
- XmlDocumentFragment.cs
- SymmetricKeyWrap.cs
- MDIClient.cs
- ImageKeyConverter.cs
- GcHandle.cs
- CategoryNameCollection.cs
- DataGridRelationshipRow.cs
- QueryContinueDragEvent.cs
- WindowsListViewItemStartMenu.cs
- compensatingcollection.cs
- RouteParametersHelper.cs
- HandlerFactoryWrapper.cs
- DataGridColumnCollection.cs
- CaseInsensitiveHashCodeProvider.cs
- StrongBox.cs
- ObjectCloneHelper.cs
- RightsManagementInformation.cs
- VisualStyleInformation.cs
- AuthenticatingEventArgs.cs
- _BufferOffsetSize.cs
- CodePageUtils.cs
- DefaultShape.cs
- BaseCodePageEncoding.cs
- FormsAuthenticationModule.cs
- AsynchronousChannelMergeEnumerator.cs
- FactorySettingsElement.cs
- AutomationTextAttribute.cs
- ConcurrentBag.cs
- TrustManagerPromptUI.cs
- ActivationArguments.cs
- WebFaultClientMessageInspector.cs
- ZipIOBlockManager.cs
- MobileSysDescriptionAttribute.cs
- FactoryGenerator.cs
- HitTestFilterBehavior.cs
- AuthenticationSection.cs
- ToolStripRendererSwitcher.cs
- InsufficientExecutionStackException.cs
- MenuCommands.cs
- DocumentPageHost.cs
- DataContractSerializerOperationFormatter.cs
- Tablet.cs
- _SafeNetHandles.cs
- Win32Exception.cs
- OptimizedTemplateContent.cs