Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / HandleExceptionArgs.cs / 1305376 / 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
- DockPanel.cs
- ListViewSelectEventArgs.cs
- ListViewGroupItemCollection.cs
- WebPartZone.cs
- Splitter.cs
- VirtualizingPanel.cs
- CustomValidator.cs
- SecurityCriticalDataForSet.cs
- LineVisual.cs
- HttpModuleActionCollection.cs
- Matrix3DConverter.cs
- ClearTypeHintValidation.cs
- DataGridHeaderBorder.cs
- SHA1Managed.cs
- InlineObject.cs
- WsiProfilesElementCollection.cs
- SweepDirectionValidation.cs
- ResourceReferenceKeyNotFoundException.cs
- GridToolTip.cs
- ListViewCommandEventArgs.cs
- DatagramAdapter.cs
- SecurityState.cs
- DetailsViewPagerRow.cs
- ThreadAbortException.cs
- ColorConvertedBitmapExtension.cs
- manifestimages.cs
- UInt32.cs
- CommandBindingCollection.cs
- SharedPersonalizationStateInfo.cs
- UIElementIsland.cs
- SourceLineInfo.cs
- JsonDeserializer.cs
- Transform3DGroup.cs
- CellIdBoolean.cs
- EntityDataReader.cs
- ErrorHandler.cs
- JoinElimination.cs
- InternalEnumValidator.cs
- hwndwrapper.cs
- Point3DCollection.cs
- RadioButtonBaseAdapter.cs
- PropertyInformationCollection.cs
- UInt16Converter.cs
- ButtonBaseAdapter.cs
- DetailsViewUpdateEventArgs.cs
- AsyncResult.cs
- DispatcherExceptionFilterEventArgs.cs
- BinHexEncoder.cs
- FormViewPagerRow.cs
- MasterPageCodeDomTreeGenerator.cs
- ImageButton.cs
- RtfToXamlLexer.cs
- Blend.cs
- DataGridViewCellMouseEventArgs.cs
- WindowsSidIdentity.cs
- ObjectViewQueryResultData.cs
- ImmutableCommunicationTimeouts.cs
- Registry.cs
- RectAnimationUsingKeyFrames.cs
- NodeInfo.cs
- URLString.cs
- XmlQueryType.cs
- InheritanceContextChangedEventManager.cs
- VisualCollection.cs
- WindowsFormsSectionHandler.cs
- InternalTypeHelper.cs
- EllipseGeometry.cs
- TableStyle.cs
- HealthMonitoringSectionHelper.cs
- IsolatedStorageFilePermission.cs
- DataControlFieldsEditor.cs
- PropertyValueChangedEvent.cs
- HtmlInputText.cs
- RegisteredDisposeScript.cs
- EncryptedPackage.cs
- RecognitionEventArgs.cs
- MediaCommands.cs
- RewritingValidator.cs
- DataFieldEditor.cs
- ReadOnlyTernaryTree.cs
- ObjectSecurity.cs
- RuleSetCollection.cs
- BitmapEffect.cs
- localization.cs
- ResourceReferenceExpressionConverter.cs
- OracleCommand.cs
- XmlDataImplementation.cs
- Tokenizer.cs
- IxmlLineInfo.cs
- FormViewCommandEventArgs.cs
- LambdaCompiler.Statements.cs
- CapabilitiesSection.cs
- xdrvalidator.cs
- ButtonBaseDesigner.cs
- DataGridCell.cs
- ISAPIApplicationHost.cs
- CellParagraph.cs
- ProvidePropertyAttribute.cs
- ThemeableAttribute.cs
- Expression.DebuggerProxy.cs