This documentation is archived and is not being maintained.

ContractDescription.HasProtectionLevel Property

Gets a value that indicates whether the contract has had a protection level set.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public bool HasProtectionLevel { get; }

Property Value

Type: System.Boolean
true if the protection level has been set; otherwise, false.

When the ProtectionLevel is set, the HasProtectionLevel property is set to true.

bool hasProtectionLevel = cd.HasProtectionLevel;
if (hasProtectionLevel)
{
    ProtectionLevel protectionLevel = cd.ProtectionLevel;
    Console.WriteLine("\tProtection Level: {0}", protectionLevel.ToString());
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: