Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Server / System / Data / Services / HandleExceptionArgs.cs / 1 / HandleExceptionArgs.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to provide data to the exception handling // process. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; ///Use this class to customize how exceptions are handled. public class HandleExceptionArgs { #region Private fields. ///Whether the response has already been written out. private readonly bool responseWritten; ///The MIME type used to write the response. private readonly string responseContentType; ///The private Exception exception; ///being handled. Whether a verbose response is appropriate. private bool useVerboseErrors; #endregion Private fields. #region Constructors. ///Initalizes a new /// Theinstance. being handled. /// Whether the response has already been written out. /// The MIME type used to write the response. /// Whether a verbose response is appropriate. internal HandleExceptionArgs(Exception exception, bool responseWritten, string contentType, bool verboseResponse) { this.exception = WebUtil.CheckArgumentNull(exception, "exception"); this.responseWritten = responseWritten; this.responseContentType = contentType; this.useVerboseErrors = verboseResponse; } #endregion Constructors. #region Public properties. /// Gets or sets the ///being handled. This property may be null. public Exception Exception { get { return this.exception; } set { this.exception = value; } } ///Gets the content type for response. public string ResponseContentType { get { return this.responseContentType; } } ///Gets the HTTP status code for the response. public int ResponseStatusCode { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).StatusCode; } else { return 500; // Internal Server Error. } } } ///Gets a value indicating whether the response has already been written out. public bool ResponseWritten { get { return this.responseWritten; } } ///Gets or sets whether a verbose response is appropriate. public bool UseVerboseErrors { get { return this.useVerboseErrors; } set { this.useVerboseErrors = value; } } #endregion Public properties. #region Internal properties. ///The value for the 'Allow' response header. internal string ResponseAllowHeader { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).ResponseAllowHeader; } else { return null; } } } #endregion Internal properties. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to provide data to the exception handling // process. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; ///Use this class to customize how exceptions are handled. public class HandleExceptionArgs { #region Private fields. ///Whether the response has already been written out. private readonly bool responseWritten; ///The MIME type used to write the response. private readonly string responseContentType; ///The private Exception exception; ///being handled. Whether a verbose response is appropriate. private bool useVerboseErrors; #endregion Private fields. #region Constructors. ///Initalizes a new /// Theinstance. being handled. /// Whether the response has already been written out. /// The MIME type used to write the response. /// Whether a verbose response is appropriate. internal HandleExceptionArgs(Exception exception, bool responseWritten, string contentType, bool verboseResponse) { this.exception = WebUtil.CheckArgumentNull(exception, "exception"); this.responseWritten = responseWritten; this.responseContentType = contentType; this.useVerboseErrors = verboseResponse; } #endregion Constructors. #region Public properties. /// Gets or sets the ///being handled. This property may be null. public Exception Exception { get { return this.exception; } set { this.exception = value; } } ///Gets the content type for response. public string ResponseContentType { get { return this.responseContentType; } } ///Gets the HTTP status code for the response. public int ResponseStatusCode { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).StatusCode; } else { return 500; // Internal Server Error. } } } ///Gets a value indicating whether the response has already been written out. public bool ResponseWritten { get { return this.responseWritten; } } ///Gets or sets whether a verbose response is appropriate. public bool UseVerboseErrors { get { return this.useVerboseErrors; } set { this.useVerboseErrors = value; } } #endregion Public properties. #region Internal properties. ///The value for the 'Allow' response header. internal string ResponseAllowHeader { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).ResponseAllowHeader; } else { return null; } } } #endregion Internal properties. } } // 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
- TypeBuilder.cs
- AutomationPeer.cs
- ColumnTypeConverter.cs
- CompositeActivityMarkupSerializer.cs
- NeedSkipTokenVisitor.cs
- VirtualPath.cs
- WebPartTracker.cs
- WCFServiceClientProxyGenerator.cs
- DockProviderWrapper.cs
- PathTooLongException.cs
- CommandLibraryHelper.cs
- TextElementEnumerator.cs
- RuntimeHelpers.cs
- base64Transforms.cs
- CacheChildrenQuery.cs
- ToolboxItemFilterAttribute.cs
- UpdateManifestForBrowserApplication.cs
- FrameworkElement.cs
- BoolExpr.cs
- SchemaCollectionPreprocessor.cs
- XmlSerializerFactory.cs
- DropTarget.cs
- infer.cs
- RemotingServices.cs
- ChannelBinding.cs
- DynamicEndpointElement.cs
- VirtualDirectoryMapping.cs
- NavigateEvent.cs
- SqlLiftIndependentRowExpressions.cs
- InternalCompensate.cs
- UnsafeNetInfoNativeMethods.cs
- SystemFonts.cs
- ColorTransform.cs
- GPRECTF.cs
- GridViewSortEventArgs.cs
- RightsManagementInformation.cs
- SystemColors.cs
- CustomLineCap.cs
- BuildManagerHost.cs
- Html32TextWriter.cs
- localization.cs
- InfoCardClaim.cs
- NameNode.cs
- StoreItemCollection.Loader.cs
- hwndwrapper.cs
- ExecutedRoutedEventArgs.cs
- AuthenticateEventArgs.cs
- ReferencedAssembly.cs
- MorphHelper.cs
- InvalidateEvent.cs
- MeasureData.cs
- ErrorTableItemStyle.cs
- AssociationTypeEmitter.cs
- LookupNode.cs
- RequiredAttributeAttribute.cs
- PeerNameResolver.cs
- XmlTextReader.cs
- ItemMap.cs
- DataSourceView.cs
- CodeDelegateCreateExpression.cs
- HelpInfo.cs
- AlignmentXValidation.cs
- Vector3DCollectionConverter.cs
- XPathScanner.cs
- SqlClientPermission.cs
- TextFindEngine.cs
- OdbcRowUpdatingEvent.cs
- PartEditor.cs
- TypeDependencyAttribute.cs
- DockPanel.cs
- RuntimeArgument.cs
- DbException.cs
- CompilerGeneratedAttribute.cs
- NameValuePair.cs
- RenderData.cs
- ToolStripContentPanel.cs
- MenuBase.cs
- PieceNameHelper.cs
- MarkupProperty.cs
- HtmlInputReset.cs
- SerializationInfoEnumerator.cs
- Invariant.cs
- DisposableCollectionWrapper.cs
- ControlPaint.cs
- FlowLayoutPanel.cs
- DynamicHyperLink.cs
- ParagraphVisual.cs
- SocketInformation.cs
- ParserOptions.cs
- Matrix3DValueSerializer.cs
- UnsafeNativeMethods.cs
- ExtendedProtectionPolicy.cs
- XslAst.cs
- DefaultAsyncDataDispatcher.cs
- ApplicationInterop.cs
- DebugView.cs
- ShapeTypeface.cs
- DataPointer.cs
- LogWriteRestartAreaState.cs
- CodeNamespace.cs