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
- ArraySubsetEnumerator.cs
- ParserHooks.cs
- CmsInterop.cs
- ServiceModelEnumValidator.cs
- TemplateComponentConnector.cs
- EntityDataSourceChangingEventArgs.cs
- Stackframe.cs
- WorkflowInstanceExtensionCollection.cs
- SimpleWebHandlerParser.cs
- RegistryKey.cs
- DataBinding.cs
- AsyncOperationContext.cs
- MiniMapControl.xaml.cs
- MobileControlsSectionHelper.cs
- PromptBuilder.cs
- WebPartHeaderCloseVerb.cs
- RemoteCryptoTokenProvider.cs
- SaveWorkflowAsyncResult.cs
- DynamicILGenerator.cs
- Compensate.cs
- MailMessageEventArgs.cs
- xsdvalidator.cs
- BitmapSizeOptions.cs
- XmlNamedNodeMap.cs
- Row.cs
- DropShadowBitmapEffect.cs
- EffectiveValueEntry.cs
- Paragraph.cs
- FormConverter.cs
- ConstraintStruct.cs
- ClonableStack.cs
- handlecollector.cs
- SqlUtil.cs
- CompilerParameters.cs
- XPathNode.cs
- OledbConnectionStringbuilder.cs
- ImageAnimator.cs
- ObjectDataSourceEventArgs.cs
- FocusChangedEventArgs.cs
- Font.cs
- SerialErrors.cs
- SystemUnicastIPAddressInformation.cs
- IFormattable.cs
- ToolStripActionList.cs
- RelationshipConstraintValidator.cs
- TagElement.cs
- SizeAnimation.cs
- WebServiceHost.cs
- UIElementParaClient.cs
- XslException.cs
- RangeContentEnumerator.cs
- Style.cs
- OperationResponse.cs
- SqlInternalConnectionTds.cs
- PlatformCulture.cs
- updatecommandorderer.cs
- DLinqColumnProvider.cs
- XmlDataImplementation.cs
- TableRowCollection.cs
- X509ChainPolicy.cs
- WebReferenceCollection.cs
- Comparer.cs
- TabItemWrapperAutomationPeer.cs
- XmlQueryOutput.cs
- ServerType.cs
- StreamWithDictionary.cs
- GenericTypeParameterBuilder.cs
- ExpressionEditorSheet.cs
- TraceHwndHost.cs
- ParentUndoUnit.cs
- DelegateOutArgument.cs
- XamlFigureLengthSerializer.cs
- ItemMap.cs
- SocketPermission.cs
- QueryOperatorEnumerator.cs
- SqlVersion.cs
- FileDialog_Vista.cs
- Module.cs
- Util.cs
- ComponentRenameEvent.cs
- Fx.cs
- Avt.cs
- ReflectionTypeLoadException.cs
- HiddenFieldPageStatePersister.cs
- SqlNodeAnnotations.cs
- diagnosticsswitches.cs
- HyperlinkAutomationPeer.cs
- RubberbandSelector.cs
- ThreadInterruptedException.cs
- OracleBinary.cs
- HostExecutionContextManager.cs
- PropertyGridEditorPart.cs
- CallbackValidatorAttribute.cs
- XPathAxisIterator.cs
- UserControlCodeDomTreeGenerator.cs
- DataViewListener.cs
- BorderGapMaskConverter.cs
- DynamicDataResources.Designer.cs
- ResXResourceReader.cs
- BulletChrome.cs