Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Web / IncomingWebResponseContext.cs / 1 / 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.Diagnostics.CodeAnalysis; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.Net; using System.Collections.ObjectModel; using System.Collections.Specialized; 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XappLauncher.cs
- EdmProviderManifest.cs
- TdsParserSafeHandles.cs
- ExtentKey.cs
- ISO2022Encoding.cs
- XhtmlBasicCommandAdapter.cs
- SingleStorage.cs
- ConstructorArgumentAttribute.cs
- ThousandthOfEmRealDoubles.cs
- ExpressionBuilder.cs
- MetafileHeader.cs
- ConsoleTraceListener.cs
- Rule.cs
- ValueUtilsSmi.cs
- SmiRecordBuffer.cs
- DispatcherSynchronizationContext.cs
- HTTPNotFoundHandler.cs
- EllipseGeometry.cs
- CannotUnloadAppDomainException.cs
- BrushMappingModeValidation.cs
- DbProviderConfigurationHandler.cs
- ConsoleCancelEventArgs.cs
- OracleParameterCollection.cs
- NavigationExpr.cs
- RuleEngine.cs
- WmlListAdapter.cs
- ResourceReader.cs
- SqlNamer.cs
- XmlCharacterData.cs
- SqlLiftWhereClauses.cs
- StorageEntitySetMapping.cs
- AuthenticationModulesSection.cs
- WebPartManagerDesigner.cs
- Deserializer.cs
- DetailsViewAutoFormat.cs
- ReachSerializerAsync.cs
- TabPageDesigner.cs
- FormatterServices.cs
- EntityDataSourceContextCreatedEventArgs.cs
- IDictionary.cs
- UserControlCodeDomTreeGenerator.cs
- Baml2006KeyRecord.cs
- MouseEvent.cs
- SqlUDTStorage.cs
- IPCCacheManager.cs
- Function.cs
- DataPagerCommandEventArgs.cs
- PageCatalogPart.cs
- JsonGlobals.cs
- RequestCacheEntry.cs
- entityreference_tresulttype.cs
- WriteTimeStream.cs
- VariableAction.cs
- Queue.cs
- WebPartPersonalization.cs
- TextElementCollection.cs
- MenuBase.cs
- TimeSpan.cs
- SafeRegistryKey.cs
- OleDbDataAdapter.cs
- ManipulationPivot.cs
- FixedNode.cs
- ReferencedAssembly.cs
- StickyNote.cs
- MetadataItemSerializer.cs
- GeometryDrawing.cs
- RawMouseInputReport.cs
- TcpHostedTransportConfiguration.cs
- PartitionResolver.cs
- RectangleGeometry.cs
- FrameworkElementFactory.cs
- DictionaryBase.cs
- SmiRequestExecutor.cs
- UpdateExpressionVisitor.cs
- TextParaLineResult.cs
- UnSafeCharBuffer.cs
- RequestCache.cs
- Literal.cs
- xsdvalidator.cs
- Track.cs
- CodeGotoStatement.cs
- _ChunkParse.cs
- IndependentlyAnimatedPropertyMetadata.cs
- SchemaHelper.cs
- RawMouseInputReport.cs
- SiteOfOriginPart.cs
- StylusSystemGestureEventArgs.cs
- InputReferenceExpression.cs
- AssemblyInfo.cs
- HttpRuntimeSection.cs
- AssertSection.cs
- StylusCollection.cs
- PingOptions.cs
- TextTrailingCharacterEllipsis.cs
- RunInstallerAttribute.cs
- ToolboxBitmapAttribute.cs
- BuildResult.cs
- webclient.cs
- ProfileProvider.cs
- HtmlHead.cs