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
- CompoundFileStorageReference.cs
- OracleCommandSet.cs
- SetStateDesigner.cs
- HttpRequestCacheValidator.cs
- RuleSettingsCollection.cs
- PropertyPushdownHelper.cs
- DynamicAttribute.cs
- UmAlQuraCalendar.cs
- FormsAuthenticationEventArgs.cs
- Hash.cs
- CompleteWizardStep.cs
- serverconfig.cs
- LinkedList.cs
- ColumnTypeConverter.cs
- ApplicationDirectory.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- RoutedUICommand.cs
- SqlCacheDependencySection.cs
- ValidationUtility.cs
- WebResponse.cs
- HttpListenerRequest.cs
- PublisherMembershipCondition.cs
- ConfigurationSettings.cs
- InvokeBase.cs
- WorkflowDefinitionDispenser.cs
- EntityException.cs
- ClientSponsor.cs
- ControlPaint.cs
- FormsAuthenticationConfiguration.cs
- DataContext.cs
- SafeCryptHandles.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- DBDataPermissionAttribute.cs
- TreeNodeStyle.cs
- QuaternionValueSerializer.cs
- GeometryHitTestResult.cs
- DataAccessor.cs
- XmlAtomicValue.cs
- DataKey.cs
- DataBoundControlActionList.cs
- QueryException.cs
- TableLayoutSettings.cs
- RowUpdatedEventArgs.cs
- brushes.cs
- XmlElementAttribute.cs
- arabicshape.cs
- MatrixTransform.cs
- TreeNodeStyleCollection.cs
- SqlInternalConnectionSmi.cs
- TextSelectionHighlightLayer.cs
- contentDescriptor.cs
- Signature.cs
- ICspAsymmetricAlgorithm.cs
- TransformCollection.cs
- HttpCapabilitiesBase.cs
- PropertyKey.cs
- GenericRootAutomationPeer.cs
- SizeChangedInfo.cs
- Visual3D.cs
- Util.cs
- LinearGradientBrush.cs
- Serializer.cs
- columnmapkeybuilder.cs
- ReflectionUtil.cs
- RemotingException.cs
- Attributes.cs
- PrimitiveXmlSerializers.cs
- SemanticResolver.cs
- TimelineCollection.cs
- ProtocolState.cs
- AppDomain.cs
- CssClassPropertyAttribute.cs
- SmiMetaDataProperty.cs
- CodeNamespace.cs
- CompilerResults.cs
- XPathQilFactory.cs
- RunClient.cs
- RightsManagementEncryptionTransform.cs
- TextBoxBase.cs
- SQLInt64Storage.cs
- ObjectSet.cs
- GeometryGroup.cs
- OperationAbortedException.cs
- XmlAutoDetectWriter.cs
- SharingService.cs
- ComponentEditorForm.cs
- SecureStringHasher.cs
- SizeAnimation.cs
- ViewBox.cs
- IssuedTokenServiceElement.cs
- IndentedWriter.cs
- ScrollBarRenderer.cs
- DataGridViewRowPrePaintEventArgs.cs
- AppearanceEditorPart.cs
- TextComposition.cs
- ProfilePropertySettingsCollection.cs
- ProgressBar.cs
- DataSourceCache.cs
- PerformanceCounterPermission.cs
- DbConnectionStringBuilder.cs