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
- ShaderEffect.cs
- RightsManagementEncryptionTransform.cs
- ComEventsInfo.cs
- CompilerTypeWithParams.cs
- ClientFormsIdentity.cs
- SHA1CryptoServiceProvider.cs
- ForceCopyBuildProvider.cs
- SizeKeyFrameCollection.cs
- WbemException.cs
- MailAddressCollection.cs
- EdmItemCollection.cs
- PageCodeDomTreeGenerator.cs
- CustomTypeDescriptor.cs
- WebPartDescription.cs
- SqlXml.cs
- RuntimeHelpers.cs
- UnsafeCollabNativeMethods.cs
- SQLBinary.cs
- AuthenticationService.cs
- Bold.cs
- ComboBox.cs
- _Connection.cs
- Hex.cs
- DeclarativeCatalogPartDesigner.cs
- CodeGenerator.cs
- RSAOAEPKeyExchangeFormatter.cs
- QueryableDataSourceEditData.cs
- CngProperty.cs
- WebPartMenu.cs
- TextFormatterContext.cs
- NetMsmqBindingCollectionElement.cs
- MessageBox.cs
- DataExchangeServiceBinder.cs
- SqlDelegatedTransaction.cs
- ToolboxItemSnapLineBehavior.cs
- DataViewSettingCollection.cs
- PrintController.cs
- LastQueryOperator.cs
- ListBindableAttribute.cs
- XmlQuerySequence.cs
- ProcessHostMapPath.cs
- InternalDuplexChannelListener.cs
- RegexCaptureCollection.cs
- DataControlLinkButton.cs
- ToolboxDataAttribute.cs
- RequestCache.cs
- SmtpAuthenticationManager.cs
- CommonXSendMessage.cs
- BamlReader.cs
- TextFormatterImp.cs
- HyperLinkStyle.cs
- GeometryDrawing.cs
- Currency.cs
- SortedDictionary.cs
- TypeForwardedFromAttribute.cs
- GZipObjectSerializer.cs
- CodeAttributeDeclaration.cs
- SqlResolver.cs
- XamlBuildTaskServices.cs
- IntSecurity.cs
- WsdlBuildProvider.cs
- ParamArrayAttribute.cs
- ClientSettings.cs
- LazyTextWriterCreator.cs
- ValueType.cs
- ProfileSettingsCollection.cs
- CodeGen.cs
- DeobfuscatingStream.cs
- PtsContext.cs
- RsaSecurityKey.cs
- StringPropertyBuilder.cs
- ContextMarshalException.cs
- ErrorFormatterPage.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- TextEditorParagraphs.cs
- CacheMode.cs
- Monitor.cs
- FixedStringLookup.cs
- InkCanvas.cs
- NativeMethods.cs
- BitStack.cs
- WindowsPrincipal.cs
- EntityDataSourceWizardForm.cs
- StyleSheetDesigner.cs
- DefaultCommandConverter.cs
- TableParaClient.cs
- Compiler.cs
- CompilerState.cs
- CurrencyWrapper.cs
- SerializationStore.cs
- TextSegment.cs
- SafeProcessHandle.cs
- SqlConnectionHelper.cs
- DataRelationPropertyDescriptor.cs
- WhiteSpaceTrimStringConverter.cs
- StringFormat.cs
- DelayedRegex.cs
- ControlIdConverter.cs
- PropertyDescriptors.cs
- FloaterParaClient.cs