Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / HttpRequestMessageProperty.cs / 2 / HttpRequestMessageProperty.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System;
using System.Net;
using System.ServiceModel.Activation;
using System.Collections.Specialized;
public sealed class HttpRequestMessageProperty
{
WebHeaderCollection headers;
string method;
string queryString;
bool suppressEntityBody;
HttpListenerRequest listenerRequest;
HostedRequestContainer hostedRequestContainer;
internal HttpRequestMessageProperty(HttpListenerRequest listenerRequest)
: this()
{
this.listenerRequest = listenerRequest;
}
internal HttpRequestMessageProperty(HostedRequestContainer hostedRequest)
: this()
{
this.hostedRequestContainer = hostedRequest;
}
public HttpRequestMessageProperty()
{
this.method = "POST";
this.queryString = string.Empty;
this.suppressEntityBody = false;
}
public static string Name
{
get { return "httpRequest"; }
}
public WebHeaderCollection Headers
{
get
{
if (this.headers == null)
{
this.headers = new WebHeaderCollection();
if (this.listenerRequest != null)
{
this.headers.Add(this.listenerRequest.Headers);
// MB 57988 - System.Net strips off user-agent from the headers collection
if (this.listenerRequest.UserAgent != null && this.headers[HttpRequestHeader.UserAgent] == null)
{
this.headers.Add(HttpRequestHeader.UserAgent, this.listenerRequest.UserAgent);
}
this.listenerRequest = null;
}
else if (this.hostedRequestContainer != null)
{
this.hostedRequestContainer.CopyHeaders(this.headers);
this.hostedRequestContainer = null;
}
}
return this.headers;
}
}
public string Method
{
get
{
return this.method;
}
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
this.method = value;
}
}
public string QueryString
{
get
{
return this.queryString;
}
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
this.queryString = value;
}
}
public bool SuppressEntityBody
{
get
{
return this.suppressEntityBody;
}
set
{
this.suppressEntityBody = value;
}
}
internal void MakeRequestContainerNull()
{
this.hostedRequestContainer = null;
}
}
}
// 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
- DataShape.cs
- FileUpload.cs
- BackEase.cs
- FontConverter.cs
- parserscommon.cs
- Debug.cs
- GenericTypeParameterBuilder.cs
- FloaterBaseParagraph.cs
- WsiProfilesElementCollection.cs
- GenericXmlSecurityToken.cs
- DateTimeParse.cs
- VBCodeProvider.cs
- LineVisual.cs
- DateTimeSerializationSection.cs
- VirtualizingPanel.cs
- CodeTypeDeclaration.cs
- ManagementOptions.cs
- XsdDuration.cs
- TerminateDesigner.cs
- XmlBaseWriter.cs
- DnsEndPoint.cs
- UtilityExtension.cs
- PermissionSetEnumerator.cs
- RepeaterItemEventArgs.cs
- AccessKeyManager.cs
- InlineCategoriesDocument.cs
- ServiceParser.cs
- MethodToken.cs
- ChangesetResponse.cs
- FastEncoderStatics.cs
- EventDescriptor.cs
- ClientBase.cs
- CachedBitmap.cs
- PKCS1MaskGenerationMethod.cs
- IteratorDescriptor.cs
- FunctionUpdateCommand.cs
- WorkflowQueue.cs
- isolationinterop.cs
- ColorContext.cs
- SqlPersonalizationProvider.cs
- Light.cs
- ContextBase.cs
- ToolStripItemTextRenderEventArgs.cs
- RefreshEventArgs.cs
- TypeElement.cs
- RequestCachePolicy.cs
- ZipIORawDataFileBlock.cs
- RemotingException.cs
- SimpleHandlerFactory.cs
- Helpers.cs
- BindToObject.cs
- MarshalByRefObject.cs
- ExpandableObjectConverter.cs
- PauseStoryboard.cs
- TextSelectionProcessor.cs
- WebPartDisplayMode.cs
- TypeUsageBuilder.cs
- ActiveXContainer.cs
- MouseGestureConverter.cs
- HitTestDrawingContextWalker.cs
- ApplicationSecurityManager.cs
- SkinBuilder.cs
- ObjectDataSourceMethodEditor.cs
- TextFormatter.cs
- ObjectDataSourceSelectingEventArgs.cs
- SelectorItemAutomationPeer.cs
- ZipIOCentralDirectoryFileHeader.cs
- safex509handles.cs
- DataGridViewLinkCell.cs
- CapabilitiesPattern.cs
- DesignerSerializationOptionsAttribute.cs
- Parser.cs
- SimpleWorkerRequest.cs
- DynamicValueConverter.cs
- SiteMap.cs
- MailWriter.cs
- CalendarDataBindingHandler.cs
- embossbitmapeffect.cs
- StringValueSerializer.cs
- LocationInfo.cs
- Brush.cs
- ImageCodecInfo.cs
- ContainerVisual.cs
- TextShapeableCharacters.cs
- UnauthorizedWebPart.cs
- PropertyValueUIItem.cs
- ProtocolsSection.cs
- ClientScriptItem.cs
- HostDesigntimeLicenseContext.cs
- Focus.cs
- TableRowsCollectionEditor.cs
- EncryptedReference.cs
- PathGeometry.cs
- IsolatedStorageFileStream.cs
- Int16.cs
- XmlWellformedWriter.cs
- AnnotationStore.cs
- ProxyElement.cs
- SudsParser.cs
- DataObject.cs