Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Authorization.cs / 1 / Authorization.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Net {
///
/// Used for handling and completing a custom authorization.
///
public class Authorization {
private string m_Message;
private bool m_Complete;
private string[] m_ProtectionRealm;
private string m_ConnectionGroupId;
private bool m_MutualAuth;
///
///
/// Creates a new instance of the class with the specified
/// authorization token.
///
///
public Authorization(string token) {
m_Message = ValidationHelper.MakeStringNull(token);
m_Complete = true;
}
///
///
/// Creates a new instance of the class with the specified
/// authorization token and completion status.
///
///
public Authorization(string token, bool finished) {
m_Message = ValidationHelper.MakeStringNull(token);
m_Complete = finished;
}
///
///
/// Creates a new instance of the class with the specified
/// authorization token, completion status, and connection m_ConnectionGroupId identifier.
///
///
public Authorization(string token, bool finished, string connectionGroupId): this(token, finished, connectionGroupId, false) {
}
//
internal Authorization(string token, bool finished, string connectionGroupId, bool mutualAuth) {
m_Message = ValidationHelper.MakeStringNull(token);
m_ConnectionGroupId = ValidationHelper.MakeStringNull(connectionGroupId);
m_Complete = finished;
m_MutualAuth = mutualAuth;
}
///
/// Gets
/// the response returned to the server in response to an authentication
/// challenge.
///
public string Message {
get { return m_Message;}
}
// used to specify if this Authorization needs a special private server connection,
// identified by this string
///
/// [To be supplied.]
///
public string ConnectionGroupId {
get { return m_ConnectionGroupId; }
}
///
/// Gets the completion status of the authorization.
///
public bool Complete {
get { return m_Complete;}
}
internal void SetComplete(bool complete) {
m_Complete = complete;
}
///
/// Gets or sets the prefix for Uris that can be authenticated with the property.
///
public string[] ProtectionRealm {
get { return m_ProtectionRealm;}
set {
string[] newValue = ValidationHelper.MakeEmptyArrayNull(value);
m_ProtectionRealm = newValue;
}
}
//
//
public bool MutuallyAuthenticated {
get {
return Complete && m_MutualAuth;
}
set {
m_MutualAuth = value;
}
}
} // class Authorization
} // namespace System.Net
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StreamResourceInfo.cs
- Knowncolors.cs
- WindowAutomationPeer.cs
- TextServicesDisplayAttribute.cs
- UIElement.cs
- ZoneButton.cs
- InputBindingCollection.cs
- DispatcherExceptionEventArgs.cs
- ListViewCommandEventArgs.cs
- DateTimeFormat.cs
- Sequence.cs
- GridViewAutomationPeer.cs
- ProgressChangedEventArgs.cs
- RecognizedWordUnit.cs
- DefaultHttpHandler.cs
- Container.cs
- SecurityTokenAuthenticator.cs
- BufferedStream.cs
- SqlRecordBuffer.cs
- ValidatedControlConverter.cs
- SoapReflectionImporter.cs
- BitmapCodecInfo.cs
- ButtonBaseAdapter.cs
- ColumnCollection.cs
- ChangeDirector.cs
- MenuBindingsEditor.cs
- RecognitionEventArgs.cs
- SettingsProperty.cs
- ToolStripMenuItem.cs
- ProvidersHelper.cs
- LoginName.cs
- CultureMapper.cs
- Calendar.cs
- Sql8ConformanceChecker.cs
- ScrollChangedEventArgs.cs
- ConsoleTraceListener.cs
- CapabilitiesRule.cs
- TextOptionsInternal.cs
- SiteMapNodeItem.cs
- NullableLongSumAggregationOperator.cs
- ScrollProperties.cs
- EntityContainerRelationshipSet.cs
- WebServiceEnumData.cs
- CodeCatchClause.cs
- SHA256.cs
- LogReservationCollection.cs
- GridViewPageEventArgs.cs
- SerializationFieldInfo.cs
- ImageSource.cs
- DataColumnChangeEvent.cs
- ToolStripDropDownItemDesigner.cs
- WindowInteropHelper.cs
- SmiRequestExecutor.cs
- Model3DGroup.cs
- SubMenuStyleCollection.cs
- PeerCredentialElement.cs
- ColumnMapProcessor.cs
- XamlHttpHandlerFactory.cs
- shaper.cs
- ISO2022Encoding.cs
- VirtualizedCellInfoCollection.cs
- Convert.cs
- MultiBindingExpression.cs
- HtmlForm.cs
- AbandonedMutexException.cs
- UnionCodeGroup.cs
- CollectionsUtil.cs
- ISO2022Encoding.cs
- bidPrivateBase.cs
- Msec.cs
- unsafenativemethodstextservices.cs
- CmsUtils.cs
- RemotingAttributes.cs
- UriTemplateHelpers.cs
- CaseExpr.cs
- ServiceOperationParameter.cs
- ListViewCommandEventArgs.cs
- ZipFileInfoCollection.cs
- WindowsSpinner.cs
- util.cs
- MemoryMappedFile.cs
- UnsafeNativeMethodsTablet.cs
- DockAndAnchorLayout.cs
- BinaryNode.cs
- SourceLineInfo.cs
- BamlCollectionHolder.cs
- CellRelation.cs
- AffineTransform3D.cs
- PermissionSet.cs
- PreProcessInputEventArgs.cs
- LinkButton.cs
- AutomationElementIdentifiers.cs
- GenericEnumConverter.cs
- WindowsStatusBar.cs
- NameNode.cs
- SystemNetworkInterface.cs
- SqlDataSourceCustomCommandEditor.cs
- CodeSubDirectoriesCollection.cs
- StatusBarItemAutomationPeer.cs
- SharedPerformanceCounter.cs