Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EmptyEnumerator.cs
- ClientSponsor.cs
- FixedSOMTableCell.cs
- UIElementPropertyUndoUnit.cs
- ObjectStorage.cs
- DesignerCatalogPartChrome.cs
- DirectoryRedirect.cs
- RegistryKey.cs
- AuthenticatingEventArgs.cs
- RadioButton.cs
- CompModSwitches.cs
- TableRow.cs
- CompilationUtil.cs
- Point3DCollection.cs
- RawStylusInput.cs
- PerspectiveCamera.cs
- MenuItemBindingCollection.cs
- DataGrid.cs
- EntityDataSourceWizardForm.cs
- FormattedText.cs
- CriticalFinalizerObject.cs
- Rule.cs
- XmlText.cs
- OutputCacheSection.cs
- PackUriHelper.cs
- WpfPayload.cs
- SecurityPolicySection.cs
- SqlAggregateChecker.cs
- XmlTextReaderImpl.cs
- SerializationException.cs
- MappingMetadataHelper.cs
- XmlnsCache.cs
- EdmError.cs
- EmptyEnumerator.cs
- SecurityElement.cs
- ByteKeyFrameCollection.cs
- RegistrationServices.cs
- CompiledQueryCacheEntry.cs
- AutoGeneratedFieldProperties.cs
- ClientUtils.cs
- ElementsClipboardData.cs
- PackWebRequest.cs
- CodeBinaryOperatorExpression.cs
- ContextDataSourceContextData.cs
- TemplateEditingService.cs
- MexTcpBindingElement.cs
- HtmlToClrEventProxy.cs
- Repeater.cs
- SmtpNtlmAuthenticationModule.cs
- ConnectionInterfaceCollection.cs
- SiteMapProvider.cs
- ColumnReorderedEventArgs.cs
- TableDetailsRow.cs
- EnumCodeDomSerializer.cs
- WsdlParser.cs
- TcpWorkerProcess.cs
- StringDictionaryWithComparer.cs
- XsltArgumentList.cs
- Options.cs
- TransferMode.cs
- ComplexTypeEmitter.cs
- OracleNumber.cs
- ValidationErrorInfo.cs
- TransformerConfigurationWizardBase.cs
- SqlIdentifier.cs
- EventProviderClassic.cs
- MD5.cs
- Timer.cs
- DiagnosticsElement.cs
- WebPartRestoreVerb.cs
- FragmentQueryProcessor.cs
- TableDetailsRow.cs
- XappLauncher.cs
- SqlConnectionString.cs
- DataGridViewImageColumn.cs
- HostDesigntimeLicenseContext.cs
- IsolatedStorageFile.cs
- RegexFCD.cs
- Tuple.cs
- ClientBuildManager.cs
- RegexStringValidatorAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- DisplayInformation.cs
- SoapCodeExporter.cs
- MachineKeySection.cs
- GridViewSortEventArgs.cs
- LogStore.cs
- JobPageOrder.cs
- FieldAccessException.cs
- Wow64ConfigurationLoader.cs
- ExtensionSurface.cs
- WorkflowViewStateService.cs
- JapaneseLunisolarCalendar.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- XamlSerializationHelper.cs
- TextServicesContext.cs
- XmlTextReaderImplHelpers.cs
- ListItem.cs
- CodeDomExtensionMethods.cs
- TextFormatterContext.cs