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
- EmptyCollection.cs
- GotoExpression.cs
- FillErrorEventArgs.cs
- wmiprovider.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- InterleavedZipPartStream.cs
- ImportedNamespaceContextItem.cs
- AppSecurityManager.cs
- RelatedPropertyManager.cs
- CellIdBoolean.cs
- Pair.cs
- TransformProviderWrapper.cs
- WebPartConnectionsConfigureVerb.cs
- CryptoKeySecurity.cs
- ElementHost.cs
- SqlRecordBuffer.cs
- ServicePointManager.cs
- PerformanceCounterPermissionEntry.cs
- wgx_commands.cs
- HandoffBehavior.cs
- XmlHierarchicalEnumerable.cs
- DictionaryBase.cs
- RawStylusSystemGestureInputReport.cs
- XmlSortKeyAccumulator.cs
- KeySpline.cs
- XamlBuildTaskServices.cs
- DataTablePropertyDescriptor.cs
- RuntimeArgumentHandle.cs
- GlyphInfoList.cs
- sqlpipe.cs
- Rights.cs
- XmlSchemaDocumentation.cs
- ServicePoint.cs
- SafeEventLogReadHandle.cs
- StylusPlugin.cs
- CodeDOMUtility.cs
- ScrollProviderWrapper.cs
- XamlWriterExtensions.cs
- Codec.cs
- CompletedAsyncResult.cs
- DataKey.cs
- SrgsDocumentParser.cs
- HttpDateParse.cs
- AnchoredBlock.cs
- LineBreakRecord.cs
- XXXInfos.cs
- ObjectStateManager.cs
- RepeaterItemEventArgs.cs
- EnvelopedPkcs7.cs
- dtdvalidator.cs
- COM2ExtendedUITypeEditor.cs
- PartBasedPackageProperties.cs
- AccessControlEntry.cs
- DataKey.cs
- CryptoApi.cs
- InputReferenceExpression.cs
- PriorityBinding.cs
- DataServiceRequest.cs
- RegexGroupCollection.cs
- Decimal.cs
- SrgsSubset.cs
- TableRowCollection.cs
- VirtualPathProvider.cs
- CalloutQueueItem.cs
- FullTextState.cs
- EndpointInstanceProvider.cs
- TextSimpleMarkerProperties.cs
- ImportContext.cs
- SplayTreeNode.cs
- Baml2006ReaderContext.cs
- MemoryStream.cs
- DataRow.cs
- login.cs
- AffineTransform3D.cs
- Typeface.cs
- XamlTypeMapperSchemaContext.cs
- RotateTransform.cs
- followingsibling.cs
- DataGridViewRowStateChangedEventArgs.cs
- TimeStampChecker.cs
- Menu.cs
- PanelDesigner.cs
- MimeParameters.cs
- BindingListCollectionView.cs
- KeyedPriorityQueue.cs
- AssertSection.cs
- WebPartsSection.cs
- CodeGroup.cs
- SharedPersonalizationStateInfo.cs
- PasswordTextContainer.cs
- Decorator.cs
- SystemIcmpV4Statistics.cs
- DesignTimeSiteMapProvider.cs
- JpegBitmapDecoder.cs
- LastQueryOperator.cs
- SqlDependencyListener.cs
- Rotation3D.cs
- X509SecurityTokenAuthenticator.cs
- SelectQueryOperator.cs
- ColorContextHelper.cs