Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Web / IncomingWebResponseContext.cs / 1305376 / IncomingWebResponseContext.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- #pragma warning disable 1634, 1691 namespace System.ServiceModel.Web { using System; using System.Globalization; using System.Net; using System.Runtime; using System.ServiceModel; using System.ServiceModel.Channels; public class IncomingWebResponseContext { OperationContext operationContext; internal IncomingWebResponseContext(OperationContext operationContext) { Fx.Assert(operationContext != null, "operationContext is null"); this.operationContext = operationContext; } public long ContentLength { get { return long.Parse(EnsureMessageProperty().Headers[HttpResponseHeader.ContentLength], CultureInfo.InvariantCulture); } } public string ContentType { get { return EnsureMessageProperty().Headers[HttpResponseHeader.ContentType]; } } public string ETag { get { return EnsureMessageProperty().Headers[HttpResponseHeader.ETag]; } } public WebHeaderCollection Headers { get { return EnsureMessageProperty().Headers; } } public string Location { get { return EnsureMessageProperty().Headers[HttpResponseHeader.Location]; } } public HttpStatusCode StatusCode { get { return this.EnsureMessageProperty().StatusCode; } } public string StatusDescription { get { return this.EnsureMessageProperty().StatusDescription; } } HttpResponseMessageProperty MessageProperty { get { if (operationContext.IncomingMessageProperties == null) { return null; } if (!operationContext.IncomingMessageProperties.ContainsKey(HttpResponseMessageProperty.Name)) { return null; } return operationContext.IncomingMessageProperties[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty; } } HttpResponseMessageProperty EnsureMessageProperty() { if (this.MessageProperty == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR2.GetString(SR2.HttpContextNoIncomingMessageProperty, typeof(HttpResponseMessageProperty).Name))); } return this.MessageProperty; } } } // 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
- Encoding.cs
- HttpConfigurationSystem.cs
- DbModificationCommandTree.cs
- CodePageEncoding.cs
- TemplateLookupAction.cs
- EntityDataSourceContainerNameConverter.cs
- UnsettableComboBox.cs
- WebPartZone.cs
- BindingOperations.cs
- GcHandle.cs
- PageEventArgs.cs
- X509Extension.cs
- EraserBehavior.cs
- ThicknessKeyFrameCollection.cs
- TraversalRequest.cs
- FontNameEditor.cs
- CompressStream.cs
- GlyphShapingProperties.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- AngleUtil.cs
- UnsafeNativeMethods.cs
- DataPagerFieldCommandEventArgs.cs
- XmlSchemaCollection.cs
- CfgSemanticTag.cs
- COAUTHIDENTITY.cs
- HtmlMeta.cs
- TypedMessageConverter.cs
- ObjectKeyFrameCollection.cs
- LogLogRecordEnumerator.cs
- EditableRegion.cs
- X509CertificateTrustedIssuerElementCollection.cs
- SHA256.cs
- TextPointerBase.cs
- MenuScrollingVisibilityConverter.cs
- ServiceEndpointAssociationProvider.cs
- Popup.cs
- StringFormat.cs
- ConversionHelper.cs
- RuntimeWrappedException.cs
- ExpandableObjectConverter.cs
- StringStorage.cs
- XmlSchemaSimpleType.cs
- DirectionalLight.cs
- TypedDatasetGenerator.cs
- XPathSingletonIterator.cs
- Vector3DAnimationUsingKeyFrames.cs
- SymbolMethod.cs
- WebEventTraceProvider.cs
- RelatedCurrencyManager.cs
- PointAnimationUsingKeyFrames.cs
- WsdlContractConversionContext.cs
- ProfileServiceManager.cs
- WindowsEditBox.cs
- XmlSchemas.cs
- UnionExpr.cs
- InstanceDescriptor.cs
- EntityDataSourceViewSchema.cs
- WebMessageBodyStyleHelper.cs
- EmbeddedMailObject.cs
- PackageDocument.cs
- ApplicationFileParser.cs
- EdmFunction.cs
- Control.cs
- TraceSection.cs
- PageCodeDomTreeGenerator.cs
- ReturnType.cs
- ClassHandlersStore.cs
- ListItemCollection.cs
- StrokeCollectionDefaultValueFactory.cs
- COM2ExtendedBrowsingHandler.cs
- PersonalizableAttribute.cs
- AutomationElement.cs
- PerformanceCounterCategory.cs
- DesignerForm.cs
- CodeTypeReferenceExpression.cs
- Membership.cs
- DesignColumn.cs
- BezierSegment.cs
- NaturalLanguageHyphenator.cs
- KeyValueInternalCollection.cs
- EventLogPermission.cs
- ConstraintConverter.cs
- ConvertEvent.cs
- SqlDuplicator.cs
- ChannelServices.cs
- QualifiedCellIdBoolean.cs
- TextServicesDisplayAttributePropertyRanges.cs
- SqlDataSourceConfigureFilterForm.cs
- ThemeConfigurationDialog.cs
- InvalidOleVariantTypeException.cs
- ConfigurationStrings.cs
- ThrowHelper.cs
- OracleDataAdapter.cs
- HwndProxyElementProvider.cs
- RadioButtonList.cs
- Point.cs
- MenuRendererStandards.cs
- DataGridItemEventArgs.cs
- DbProviderConfigurationHandler.cs
- EntityKey.cs