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
- CompareValidator.cs
- Mutex.cs
- MarshalDirectiveException.cs
- DiscoveryReference.cs
- HtmlElementCollection.cs
- DataGridViewImageColumn.cs
- unsafeIndexingFilterStream.cs
- WindowsScrollBarBits.cs
- GeneralTransform.cs
- documentsequencetextcontainer.cs
- IPEndPoint.cs
- HttpWriter.cs
- TcpServerChannel.cs
- EventLogPermissionEntryCollection.cs
- MergePropertyDescriptor.cs
- ChildTable.cs
- DbMetaDataCollectionNames.cs
- ApplicationContext.cs
- TokenBasedSet.cs
- Converter.cs
- IFlowDocumentViewer.cs
- InputGestureCollection.cs
- DataViewSettingCollection.cs
- SourceFileInfo.cs
- Glyph.cs
- ContentPosition.cs
- Number.cs
- PauseStoryboard.cs
- StateRuntime.cs
- XamlLoadErrorInfo.cs
- InputLanguageProfileNotifySink.cs
- ConfigXmlText.cs
- InputLangChangeEvent.cs
- ControlType.cs
- ModelUIElement3D.cs
- XmlEncoding.cs
- SoapCommonClasses.cs
- SharedPersonalizationStateInfo.cs
- AttributeProviderAttribute.cs
- AtomMaterializer.cs
- QueryProcessor.cs
- Matrix3DStack.cs
- MetadataUtil.cs
- Point3DValueSerializer.cs
- ScrollEventArgs.cs
- WebPartZone.cs
- Gdiplus.cs
- _WinHttpWebProxyDataBuilder.cs
- SQLGuid.cs
- PeerContact.cs
- MenuBase.cs
- PersianCalendar.cs
- CatalogPartChrome.cs
- XsdBuilder.cs
- FileResponseElement.cs
- SapiRecoInterop.cs
- PassportAuthentication.cs
- _UriSyntax.cs
- SafeEventLogReadHandle.cs
- AddInStore.cs
- GrabHandleGlyph.cs
- SqlWebEventProvider.cs
- SByte.cs
- TextUtf8RawTextWriter.cs
- X509InitiatorCertificateServiceElement.cs
- ConsoleCancelEventArgs.cs
- Accessible.cs
- XsltArgumentList.cs
- NotSupportedException.cs
- TextAutomationPeer.cs
- TextContainer.cs
- PageAsyncTaskManager.cs
- FlowDocumentPage.cs
- storepermission.cs
- CheckBoxList.cs
- ScaleTransform3D.cs
- QueryExpression.cs
- Options.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- GridViewColumnHeaderAutomationPeer.cs
- DataRelationCollection.cs
- VariableDesigner.xaml.cs
- SystemIPInterfaceProperties.cs
- WebServiceAttribute.cs
- SoapHttpTransportImporter.cs
- SlipBehavior.cs
- CacheVirtualItemsEvent.cs
- UserControlParser.cs
- XmlNamespaceDeclarationsAttribute.cs
- ProtocolsConfigurationHandler.cs
- StyleCollection.cs
- MarkupProperty.cs
- EntityDataSourceDesigner.cs
- AccessibilityHelperForVista.cs
- ContentValidator.cs
- CategoryEditor.cs
- FileSystemWatcher.cs
- RefreshEventArgs.cs
- ScriptingRoleServiceSection.cs
- StandardOleMarshalObject.cs