Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / PasswordPropertyTextAttribute.cs / 1 / PasswordPropertyTextAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using System;
using System.Security.Permissions;
///
/// If this attribute is placed on a property or a type, its text representation in a property window
/// will appear as dots or astrisks to indicate a password field. This indidation in no way
/// represents any type of encryption or security.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class PasswordPropertyTextAttribute : Attribute {
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to true.
///
public static readonly PasswordPropertyTextAttribute Yes = new PasswordPropertyTextAttribute(true);
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to false.
///
public static readonly PasswordPropertyTextAttribute No = new PasswordPropertyTextAttribute(false);
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to false.
///
public static readonly PasswordPropertyTextAttribute Default = No;
private bool _password;
///
/// Creates a default PasswordPropertyTextAttribute.
///
public PasswordPropertyTextAttribute() : this(false) {
}
///
/// Creates a PasswordPropertyTextAttribute with the given password value.
///
public PasswordPropertyTextAttribute(bool password) {
_password = password;
}
///
/// Gets a value indicating if the property this attribute is defined for should be shown as password text.
///
public bool Password {
get {
return _password;
}
}
///
/// Overload for object equality
///
public override bool Equals(object o) {
if (o is PasswordPropertyTextAttribute) {
return ((PasswordPropertyTextAttribute)o).Password == _password;
}
return false;
}
///
/// Returns the hashcode for this object.
///
public override int GetHashCode() {
return base.GetHashCode();
}
///
/// Gets a value indicating whether this attribute is set to true by default.
///
public override bool IsDefaultAttribute() {
return this.Equals(Default);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using System;
using System.Security.Permissions;
///
/// If this attribute is placed on a property or a type, its text representation in a property window
/// will appear as dots or astrisks to indicate a password field. This indidation in no way
/// represents any type of encryption or security.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class PasswordPropertyTextAttribute : Attribute {
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to true.
///
public static readonly PasswordPropertyTextAttribute Yes = new PasswordPropertyTextAttribute(true);
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to false.
///
public static readonly PasswordPropertyTextAttribute No = new PasswordPropertyTextAttribute(false);
///
/// Sets the System.ComponentModel.Design.PasswordPropertyText
/// attribute by default to false.
///
public static readonly PasswordPropertyTextAttribute Default = No;
private bool _password;
///
/// Creates a default PasswordPropertyTextAttribute.
///
public PasswordPropertyTextAttribute() : this(false) {
}
///
/// Creates a PasswordPropertyTextAttribute with the given password value.
///
public PasswordPropertyTextAttribute(bool password) {
_password = password;
}
///
/// Gets a value indicating if the property this attribute is defined for should be shown as password text.
///
public bool Password {
get {
return _password;
}
}
///
/// Overload for object equality
///
public override bool Equals(object o) {
if (o is PasswordPropertyTextAttribute) {
return ((PasswordPropertyTextAttribute)o).Password == _password;
}
return false;
}
///
/// Returns the hashcode for this object.
///
public override int GetHashCode() {
return base.GetHashCode();
}
///
/// Gets a value indicating whether this attribute is set to true by default.
///
public override bool IsDefaultAttribute() {
return this.Equals(Default);
}
}
}
// 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
- Translator.cs
- OdbcInfoMessageEvent.cs
- DataGridViewColumn.cs
- RadioButtonBaseAdapter.cs
- NamespaceImport.cs
- MethodToken.cs
- CryptoConfig.cs
- DynamicVirtualDiscoSearcher.cs
- EventDescriptorCollection.cs
- SafeLocalMemHandle.cs
- ExpandedProjectionNode.cs
- DataGridViewCellEventArgs.cs
- BooleanStorage.cs
- PageVisual.cs
- DependencyPropertyConverter.cs
- PolyBezierSegment.cs
- SemaphoreSecurity.cs
- WebRequest.cs
- SmtpLoginAuthenticationModule.cs
- MessageDirection.cs
- PointLight.cs
- OrderedHashRepartitionEnumerator.cs
- ShapingEngine.cs
- ChangeTracker.cs
- StrongTypingException.cs
- SqlXml.cs
- IdentityValidationException.cs
- AssemblySettingAttributes.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- ImageClickEventArgs.cs
- BrowserCapabilitiesFactory.cs
- DataGridViewComboBoxEditingControl.cs
- DiagnosticsElement.cs
- InitializingNewItemEventArgs.cs
- CriticalFileToken.cs
- CompiledXpathExpr.cs
- ChannelManagerBase.cs
- PathTooLongException.cs
- TextRangeEditLists.cs
- DurationConverter.cs
- XmlObjectSerializer.cs
- DecimalAnimation.cs
- PrinterSettings.cs
- AdobeCFFWrapper.cs
- TypeDelegator.cs
- ToolboxItem.cs
- IInstanceTable.cs
- MatrixCamera.cs
- CodeArrayIndexerExpression.cs
- WindowsStatusBar.cs
- cookiecollection.cs
- SmiMetaData.cs
- TraceContext.cs
- CriticalFinalizerObject.cs
- ProtectedConfigurationSection.cs
- NotifyParentPropertyAttribute.cs
- DockingAttribute.cs
- HandleCollector.cs
- QueryResultOp.cs
- DataBindEngine.cs
- ShapeTypeface.cs
- StringDictionaryWithComparer.cs
- EntityParameterCollection.cs
- COM2PictureConverter.cs
- DataListItemCollection.cs
- Type.cs
- TTSEngineProxy.cs
- SchemaMapping.cs
- ClientSettings.cs
- Icon.cs
- FontSourceCollection.cs
- ModelVisual3D.cs
- HotCommands.cs
- ApplicationContext.cs
- BinaryMessageEncoder.cs
- LogAppendAsyncResult.cs
- MissingMethodException.cs
- Rights.cs
- CodeStatement.cs
- FormViewCommandEventArgs.cs
- ImportedNamespaceContextItem.cs
- HttpCapabilitiesSectionHandler.cs
- processwaithandle.cs
- ContentElementAutomationPeer.cs
- TransformCryptoHandle.cs
- ButtonField.cs
- XmlNodeList.cs
- PersistenceTypeAttribute.cs
- QilStrConcatenator.cs
- HttpStreams.cs
- ArgumentOutOfRangeException.cs
- SamlSecurityToken.cs
- ContainerParaClient.cs
- BasicHttpSecurity.cs
- WebErrorHandler.cs
- IDispatchConstantAttribute.cs
- TextProperties.cs
- InputProcessorProfiles.cs
- IsolatedStorageException.cs
- AppDomainAttributes.cs