Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / WebHttpSecurity.cs / 1305376 / WebHttpSecurity.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel
{
using System.Runtime;
using System.ServiceModel.Channels;
using System.ComponentModel;
public sealed class WebHttpSecurity
{
internal const WebHttpSecurityMode DefaultMode = WebHttpSecurityMode.None;
WebHttpSecurityMode mode;
HttpTransportSecurity transportSecurity;
bool isModeSet;
public WebHttpSecurity()
{
this.transportSecurity = new HttpTransportSecurity();
}
public WebHttpSecurityMode Mode
{
get { return this.mode; }
set
{
if (!WebHttpSecurityModeHelper.IsDefined(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value"));
}
this.mode = value;
this.isModeSet = true;
}
}
internal bool IsModeSet
{
get { return this.isModeSet; }
}
public HttpTransportSecurity Transport
{
get { return this.transportSecurity; }
set
{
this.transportSecurity = (value == null) ? new HttpTransportSecurity() : value;
}
}
internal void DisableTransportAuthentication(HttpTransportBindingElement http)
{
this.transportSecurity.DisableTransportAuthentication(http);
}
internal void EnableTransportAuthentication(HttpTransportBindingElement http)
{
this.transportSecurity.ConfigureTransportAuthentication(http);
}
internal void EnableTransportSecurity(HttpsTransportBindingElement https)
{
this.transportSecurity.ConfigureTransportProtectionAndAuthentication(https);
}
internal bool InternalShouldSerialize()
{
return this.ShouldSerializeMode()
|| this.ShouldSerializeTransport();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeMode()
{
return this.Mode != DefaultMode;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeTransport()
{
return this.Transport.InternalShouldSerialize();
}
}
}
// 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
- HwndKeyboardInputProvider.cs
- AuthStoreRoleProvider.cs
- DesignerView.Commands.cs
- WebPartAddingEventArgs.cs
- HelpExampleGenerator.cs
- X500Name.cs
- LazyLoadBehavior.cs
- CollectionDataContract.cs
- DiagnosticSection.cs
- invalidudtexception.cs
- ConsoleKeyInfo.cs
- CodeSubDirectoriesCollection.cs
- AsyncOperationContext.cs
- ExpressionLink.cs
- SessionPageStateSection.cs
- RuntimeHelpers.cs
- BamlReader.cs
- DesignerCategoryAttribute.cs
- DataListCommandEventArgs.cs
- SweepDirectionValidation.cs
- HebrewCalendar.cs
- BmpBitmapDecoder.cs
- ValueUnavailableException.cs
- OpCodes.cs
- DesignOnlyAttribute.cs
- DataGridViewTopRowAccessibleObject.cs
- MemberCollection.cs
- BindingContext.cs
- SqlDeflator.cs
- BufferedGraphicsContext.cs
- NativeMethodsOther.cs
- MenuItemBinding.cs
- _AutoWebProxyScriptWrapper.cs
- MethodBody.cs
- ParameterModifier.cs
- WebPartTransformerCollection.cs
- ConditionCollection.cs
- OpenTypeLayoutCache.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ScaleTransform.cs
- AccessViolationException.cs
- XPathSelectionIterator.cs
- CalendarButton.cs
- ComplexPropertyEntry.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- EncodingInfo.cs
- DataBindingsDialog.cs
- StatusBar.cs
- EditableTreeList.cs
- CodeBlockBuilder.cs
- XmlSchemaParticle.cs
- PathSegmentCollection.cs
- ResourceIDHelper.cs
- Publisher.cs
- ContainerParaClient.cs
- SiteMapNode.cs
- EncryptedReference.cs
- CursorConverter.cs
- CheckBoxPopupAdapter.cs
- FontSourceCollection.cs
- ProxySimple.cs
- _ShellExpression.cs
- CodeTypeMemberCollection.cs
- TraceSection.cs
- HttpCookie.cs
- Header.cs
- BindingCompleteEventArgs.cs
- VersionConverter.cs
- ProfileGroupSettings.cs
- CatalogZoneBase.cs
- FilterInvalidBodyAccessException.cs
- Pool.cs
- BrowserDefinition.cs
- DependencyPropertyValueSerializer.cs
- MenuItem.cs
- SmiXetterAccessMap.cs
- ExpandCollapseProviderWrapper.cs
- TableItemPatternIdentifiers.cs
- DurationConverter.cs
- ZoneButton.cs
- ListViewItemEventArgs.cs
- PathFigure.cs
- LifetimeManager.cs
- OleDbCommand.cs
- CheckBoxPopupAdapter.cs
- KeyFrames.cs
- ExpanderAutomationPeer.cs
- RotateTransform3D.cs
- TargetControlTypeCache.cs
- BinaryFormatter.cs
- XmlUnspecifiedAttribute.cs
- ConnectionPoolManager.cs
- SwitchAttribute.cs
- ReachBasicContext.cs
- LoginCancelEventArgs.cs
- ListViewCommandEventArgs.cs
- CssTextWriter.cs
- BamlReader.cs
- GlyphCache.cs
- SqlDataSourceView.cs