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
- ADConnectionHelper.cs
- Logging.cs
- EventsTab.cs
- TraceUtils.cs
- SafeFindHandle.cs
- LogRestartAreaEnumerator.cs
- MetadataExchangeClient.cs
- CompiledRegexRunner.cs
- UriWriter.cs
- WindowsRebar.cs
- Int32RectValueSerializer.cs
- ControlIdConverter.cs
- SizeLimitedCache.cs
- NetworkAddressChange.cs
- DataMisalignedException.cs
- WeakEventManager.cs
- StagingAreaInputItem.cs
- HttpRuntimeSection.cs
- SoapProtocolImporter.cs
- LateBoundBitmapDecoder.cs
- XmlArrayAttribute.cs
- EventSinkHelperWriter.cs
- SamlDoNotCacheCondition.cs
- FontSizeConverter.cs
- RegexWriter.cs
- SqlParameter.cs
- OdbcDataAdapter.cs
- __ComObject.cs
- EntityCodeGenerator.cs
- DesignObjectWrapper.cs
- ServiceReflector.cs
- GeometryCollection.cs
- Literal.cs
- ApplicationManager.cs
- FontClient.cs
- ClientOptions.cs
- BulletChrome.cs
- connectionpool.cs
- XappLauncher.cs
- UrlMappingsModule.cs
- BinHexEncoding.cs
- HttpHandlersSection.cs
- MouseEventArgs.cs
- DESCryptoServiceProvider.cs
- WebConfigurationHostFileChange.cs
- SoapFaultCodes.cs
- HMACRIPEMD160.cs
- ObjectStateFormatter.cs
- ToolboxService.cs
- PriorityRange.cs
- PrivateFontCollection.cs
- Single.cs
- ValueProviderWrapper.cs
- SR.cs
- SpecialNameAttribute.cs
- MimeTypeMapper.cs
- SharedPerformanceCounter.cs
- ProxyAttribute.cs
- GridViewPageEventArgs.cs
- InputScope.cs
- DataTableCollection.cs
- ListSortDescriptionCollection.cs
- XmlDocumentSerializer.cs
- FixedDocumentPaginator.cs
- MinMaxParagraphWidth.cs
- FileChangesMonitor.cs
- SettingsPropertyValueCollection.cs
- KeyPullup.cs
- OleDbFactory.cs
- ArrayHelper.cs
- PropertyExpression.cs
- ExpressionVisitorHelpers.cs
- DataGridViewCheckBoxCell.cs
- RowType.cs
- TextSegment.cs
- SymmetricSecurityProtocolFactory.cs
- IPGlobalProperties.cs
- SID.cs
- SchemaConstraints.cs
- HttpDictionary.cs
- ValidationSummary.cs
- Part.cs
- KeySplineConverter.cs
- Function.cs
- TargetControlTypeAttribute.cs
- AssemblyCollection.cs
- dtdvalidator.cs
- GlobalAllocSafeHandle.cs
- ToolStripGrip.cs
- Matrix3DConverter.cs
- Item.cs
- BufferedStream2.cs
- Misc.cs
- InputQueueChannel.cs
- CodeTypeParameterCollection.cs
- PrintDialogDesigner.cs
- XmlSchemaObject.cs
- PrintDialog.cs
- StandardCommands.cs
- Wildcard.cs