Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ToolboxItemImageConverter.cs
- OracleMonthSpan.cs
- FacetEnabledSchemaElement.cs
- VirtualDirectoryMappingCollection.cs
- SiteOfOriginPart.cs
- CodeSnippetCompileUnit.cs
- FocusManager.cs
- TemplateManager.cs
- HttpListener.cs
- PersistenceTypeAttribute.cs
- CatalogPartChrome.cs
- CdpEqualityComparer.cs
- PersonalizationState.cs
- InvariantComparer.cs
- DynamicExpression.cs
- FileStream.cs
- WebPartDisplayModeCancelEventArgs.cs
- ThreadAbortException.cs
- ExpressionReplacer.cs
- SecurityRuntime.cs
- StorageComplexTypeMapping.cs
- TraceHandlerErrorFormatter.cs
- RichTextBoxConstants.cs
- SelectionListComponentEditor.cs
- ReliableChannelBinder.cs
- EnumConverter.cs
- ByteRangeDownloader.cs
- AlternateViewCollection.cs
- CultureInfoConverter.cs
- Grant.cs
- Privilege.cs
- StylusButtonEventArgs.cs
- TreeSet.cs
- EmptyQuery.cs
- Aes.cs
- VirtualPathUtility.cs
- IntellisenseTextBox.cs
- SafeNativeMethods.cs
- XmlSerializerVersionAttribute.cs
- TemplateBamlRecordReader.cs
- Slider.cs
- Win32MouseDevice.cs
- TypeInfo.cs
- AQNBuilder.cs
- DispatchRuntime.cs
- SymmetricAlgorithm.cs
- OptimalBreakSession.cs
- RoutedPropertyChangedEventArgs.cs
- SHA384Cng.cs
- DataGridViewDesigner.cs
- XmlDesignerDataSourceView.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- CallbackBehaviorAttribute.cs
- PipelineModuleStepContainer.cs
- Ipv6Element.cs
- LineSegment.cs
- HttpModulesSection.cs
- XPathPatternParser.cs
- CategoryGridEntry.cs
- TextModifierScope.cs
- LinearGradientBrush.cs
- PrimitiveType.cs
- HitTestParameters3D.cs
- PolicyStatement.cs
- CommonXSendMessage.cs
- AssemblyAttributesGoHere.cs
- TriggerBase.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- NumberSubstitution.cs
- DurableOperationAttribute.cs
- InputScopeConverter.cs
- ModelFactory.cs
- CancellationState.cs
- NullableConverter.cs
- TypeLoadException.cs
- CookielessHelper.cs
- StreamWithDictionary.cs
- PackageDigitalSignatureManager.cs
- OdbcConnectionPoolProviderInfo.cs
- TimerElapsedEvenArgs.cs
- PeerCollaborationPermission.cs
- MenuItemAutomationPeer.cs
- BoolExpressionVisitors.cs
- ResourceDescriptionAttribute.cs
- NavigationFailedEventArgs.cs
- HttpRequestBase.cs
- AssemblyCache.cs
- HtmlControl.cs
- ToolStripDropDown.cs
- DbConnectionClosed.cs
- MessageEncodingBindingElementImporter.cs
- EncoderNLS.cs
- UserControl.cs
- DbDataAdapter.cs
- HasCopySemanticsAttribute.cs
- Span.cs
- XmlChoiceIdentifierAttribute.cs
- ModelFactory.cs
- CellQuery.cs
- Odbc32.cs