Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- Profiler.cs
- DesignerWithHeader.cs
- SQLResource.cs
- RepeatBehaviorConverter.cs
- NotifyInputEventArgs.cs
- panel.cs
- ScriptRegistrationManager.cs
- SqlDataReaderSmi.cs
- XmlException.cs
- DbTypeMap.cs
- Pen.cs
- HelpEvent.cs
- AlternateView.cs
- SpotLight.cs
- StateManagedCollection.cs
- ReadOnlyPropertyMetadata.cs
- RegexParser.cs
- SignatureTargetIdManager.cs
- XdrBuilder.cs
- ExpressionServices.cs
- HtmlInputPassword.cs
- SQLGuidStorage.cs
- IsolatedStorage.cs
- CultureInfo.cs
- Comparer.cs
- RangeValuePatternIdentifiers.cs
- FunctionDescription.cs
- HtmlTextArea.cs
- CodeMemberEvent.cs
- RootProfilePropertySettingsCollection.cs
- WindowsToolbarAsMenu.cs
- ParserStreamGeometryContext.cs
- InheritedPropertyDescriptor.cs
- HelpFileFileNameEditor.cs
- BuildProvidersCompiler.cs
- StringValidator.cs
- StreamUpdate.cs
- XmlHierarchicalDataSourceView.cs
- DbParameterCollection.cs
- InfoCardProofToken.cs
- UIntPtr.cs
- EasingKeyFrames.cs
- BooleanFunctions.cs
- Guid.cs
- CodeRegionDirective.cs
- XmlQueryRuntime.cs
- FlowLayoutSettings.cs
- DataBoundLiteralControl.cs
- Icon.cs
- XmlNodeComparer.cs
- Composition.cs
- Set.cs
- StringUtil.cs
- WebPartVerb.cs
- SqlDataRecord.cs
- TableLayoutStyle.cs
- XmlResolver.cs
- PassportAuthenticationEventArgs.cs
- MetadataSource.cs
- AQNBuilder.cs
- ContainerSelectorActiveEvent.cs
- ContextInformation.cs
- MappedMetaModel.cs
- CollectionsUtil.cs
- XmlKeywords.cs
- DynamicRendererThreadManager.cs
- DataContractSerializerOperationBehavior.cs
- RegisteredHiddenField.cs
- ReturnEventArgs.cs
- ControlIdConverter.cs
- BuilderPropertyEntry.cs
- DefaultObjectMappingItemCollection.cs
- DesignerSerializationVisibilityAttribute.cs
- EntityContainer.cs
- RectKeyFrameCollection.cs
- XmlUrlResolver.cs
- FlowLayoutSettings.cs
- SerializationEventsCache.cs
- TdsParameterSetter.cs
- UITypeEditor.cs
- XmlChildEnumerator.cs
- Bits.cs
- DataGridViewBand.cs
- SQLByte.cs
- BookmarkScopeInfo.cs
- RotateTransform3D.cs
- ZipPackagePart.cs
- CodeIndexerExpression.cs
- PartitionedStreamMerger.cs
- FixedSOMTableCell.cs
- PropertyStore.cs
- RectangleHotSpot.cs
- RepeatBehaviorConverter.cs
- SystemIPAddressInformation.cs
- ToolStripControlHost.cs
- ViewLoader.cs
- Int64Animation.cs
- CombinedGeometry.cs
- TextEditorMouse.cs
- SafeArchiveContext.cs