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
- Stylesheet.cs
- SizeAnimationClockResource.cs
- SmtpAuthenticationManager.cs
- Single.cs
- NonceCache.cs
- EditorPart.cs
- HexParser.cs
- MapPathBasedVirtualPathProvider.cs
- ElementUtil.cs
- TCPListener.cs
- ImageFormat.cs
- TypeConverter.cs
- WebScriptEnablingBehavior.cs
- WorkflowMarkupSerializationException.cs
- SerializableAttribute.cs
- LambdaCompiler.Binary.cs
- InternalControlCollection.cs
- CryptoKeySecurity.cs
- ResourceCollectionInfo.cs
- QilList.cs
- ITextView.cs
- RightsManagementPermission.cs
- Message.cs
- WebRequestModuleElement.cs
- AuthenticateEventArgs.cs
- CredentialCache.cs
- ConstructorBuilder.cs
- AutomationElement.cs
- OdbcCommandBuilder.cs
- HttpWrapper.cs
- OdbcDataAdapter.cs
- AnnotationComponentChooser.cs
- GridItemPattern.cs
- ShaperBuffers.cs
- AssemblyHash.cs
- FixedSOMContainer.cs
- ValidatorCompatibilityHelper.cs
- SqlMethodCallConverter.cs
- OleTxTransaction.cs
- EnumType.cs
- BuildManagerHost.cs
- ByteStreamGeometryContext.cs
- CompareValidator.cs
- Trace.cs
- ParenthesizePropertyNameAttribute.cs
- Axis.cs
- HtmlControl.cs
- ExpressionBinding.cs
- formatter.cs
- DataGridViewImageCell.cs
- ActiveXSite.cs
- EventDescriptor.cs
- PeerApplicationLaunchInfo.cs
- QilTernary.cs
- DataKey.cs
- MultiView.cs
- PointCollection.cs
- TrimSurroundingWhitespaceAttribute.cs
- XmlAttributeProperties.cs
- ParagraphVisual.cs
- BaseTypeViewSchema.cs
- OpenFileDialog.cs
- HTMLTagNameToTypeMapper.cs
- UIElementParaClient.cs
- CustomExpressionEventArgs.cs
- AnnouncementSendsAsyncResult.cs
- HttpHandlersSection.cs
- ToolboxControl.cs
- ModulesEntry.cs
- DataListItemEventArgs.cs
- RuntimeResourceSet.cs
- HtmlTable.cs
- SupportsEventValidationAttribute.cs
- FlowDocumentReaderAutomationPeer.cs
- Quaternion.cs
- ListViewUpdatedEventArgs.cs
- WmpBitmapDecoder.cs
- DependencyPropertyKind.cs
- AnnotationResourceChangedEventArgs.cs
- XXXInfos.cs
- UxThemeWrapper.cs
- XmlSchemaComplexContentExtension.cs
- ClientCredentialsSecurityTokenManager.cs
- XmlValidatingReader.cs
- HostedTransportConfigurationManager.cs
- CompositeDuplexBindingElement.cs
- MarginCollapsingState.cs
- TargetInvocationException.cs
- MouseActionConverter.cs
- GlyphInfoList.cs
- Models.cs
- _Events.cs
- DownloadProgressEventArgs.cs
- NamedObjectList.cs
- String.cs
- SerializationSectionGroup.cs
- SoapWriter.cs
- TagNameToTypeMapper.cs
- LongSumAggregationOperator.cs
- RealizedColumnsBlock.cs