Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / PasswordPropertyTextAttribute.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XMLSyntaxException.cs
- UrlPath.cs
- Char.cs
- WindowsNonControl.cs
- DescendentsWalker.cs
- SR.Designer.cs
- FastEncoder.cs
- Timer.cs
- TagPrefixAttribute.cs
- Panel.cs
- NameValuePair.cs
- GridErrorDlg.cs
- BadImageFormatException.cs
- CacheDependency.cs
- __FastResourceComparer.cs
- DiscoveryInnerClientAdhocCD1.cs
- CopyOfAction.cs
- FakeModelPropertyImpl.cs
- ByteStreamGeometryContext.cs
- PieceNameHelper.cs
- CharConverter.cs
- SafeRegistryHandle.cs
- DataTableMappingCollection.cs
- InstancePersistence.cs
- MeasureItemEvent.cs
- TabControlEvent.cs
- ArrayElementGridEntry.cs
- RequestQueue.cs
- AssemblyAttributesGoHere.cs
- FactoryRecord.cs
- ImageDrawing.cs
- RectIndependentAnimationStorage.cs
- Rotation3DAnimationUsingKeyFrames.cs
- MissingSatelliteAssemblyException.cs
- DataServiceClientException.cs
- XmlTypeMapping.cs
- TimerEventSubscriptionCollection.cs
- TypeInfo.cs
- HashRepartitionEnumerator.cs
- ProfilePropertyNameValidator.cs
- ResolvedKeyFrameEntry.cs
- ScrollContentPresenter.cs
- InvalidPropValue.cs
- SiteMapDataSourceView.cs
- XhtmlTextWriter.cs
- XmlCharType.cs
- Vector3DCollectionConverter.cs
- HttpListener.cs
- SmtpException.cs
- WindowsSolidBrush.cs
- RelationshipDetailsCollection.cs
- XmlQualifiedName.cs
- Nodes.cs
- BuildProviderAppliesToAttribute.cs
- CompareInfo.cs
- SqlInternalConnection.cs
- ScriptBehaviorDescriptor.cs
- SortDescriptionCollection.cs
- SQLGuid.cs
- GeneratedCodeAttribute.cs
- ColorBuilder.cs
- XamlTemplateSerializer.cs
- StringUtil.cs
- BindStream.cs
- CodeIterationStatement.cs
- TreeViewCancelEvent.cs
- DetailsView.cs
- ImageButton.cs
- PropertyKey.cs
- DataGridColumnCollection.cs
- Function.cs
- TextBoxRenderer.cs
- SQLMoneyStorage.cs
- BamlMapTable.cs
- Stream.cs
- WebEventCodes.cs
- XmlWrappingWriter.cs
- XsltSettings.cs
- ExclusiveCanonicalizationTransform.cs
- Vector3DKeyFrameCollection.cs
- HttpHeaderCollection.cs
- SqlCommandSet.cs
- DesignerDataTableBase.cs
- KeyInterop.cs
- XmlUnspecifiedAttribute.cs
- CharacterBuffer.cs
- DecimalKeyFrameCollection.cs
- PassportAuthentication.cs
- ZoneMembershipCondition.cs
- UTF8Encoding.cs
- IMembershipProvider.cs
- SQLBytes.cs
- TextContainerChangedEventArgs.cs
- SchemaNotation.cs
- MembershipPasswordException.cs
- EdmError.cs
- RangeBaseAutomationPeer.cs
- OdbcErrorCollection.cs
- FacetDescription.cs
- Version.cs