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
- log.cs
- TreeNodeBinding.cs
- DesignerAdRotatorAdapter.cs
- LogReserveAndAppendState.cs
- SqlConnectionPoolProviderInfo.cs
- XNodeValidator.cs
- WebPartConnectVerb.cs
- PropertyItem.cs
- SQLMoney.cs
- SqlDataRecord.cs
- XmlSchemaSimpleTypeUnion.cs
- InertiaTranslationBehavior.cs
- ScrollViewerAutomationPeer.cs
- XmlSchemaFacet.cs
- AssemblyFilter.cs
- PrinterSettings.cs
- EnumCodeDomSerializer.cs
- XmlSchemaSimpleType.cs
- ParallelQuery.cs
- Point3DIndependentAnimationStorage.cs
- TypeNameHelper.cs
- XXXInfos.cs
- SmiMetaDataProperty.cs
- BaseCAMarshaler.cs
- PriorityItem.cs
- TransactionTraceIdentifier.cs
- DocumentGridContextMenu.cs
- QueryModel.cs
- DataGridViewElement.cs
- ToolTipService.cs
- DelayedRegex.cs
- ISO2022Encoding.cs
- ReceiveParametersContent.cs
- PropertySet.cs
- XmlDeclaration.cs
- ImageListUtils.cs
- AutomationAttributeInfo.cs
- XmlUTF8TextReader.cs
- GAC.cs
- ActivationWorker.cs
- GlobalEventManager.cs
- CreateUserWizardDesigner.cs
- CurrentTimeZone.cs
- DependencyProperty.cs
- StateDesigner.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- tibetanshape.cs
- QueryExtender.cs
- UrlAuthorizationModule.cs
- TiffBitmapDecoder.cs
- DataContext.cs
- StylusButtonEventArgs.cs
- BindableAttribute.cs
- COM2Properties.cs
- TypeConverterHelper.cs
- ExpressionList.cs
- Collection.cs
- DataControlReferenceCollection.cs
- Pointer.cs
- RepeaterDesigner.cs
- StandardTransformFactory.cs
- ArrangedElementCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DebugHandleTracker.cs
- WinInetCache.cs
- LayoutEditorPart.cs
- PropertyInfoSet.cs
- FolderBrowserDialogDesigner.cs
- PointAnimationUsingPath.cs
- RuntimeCompatibilityAttribute.cs
- StrongNameIdentityPermission.cs
- CompilerInfo.cs
- QilLiteral.cs
- TextTreeTextElementNode.cs
- SamlAction.cs
- CodeRemoveEventStatement.cs
- FlowDecisionDesigner.xaml.cs
- AssemblyHash.cs
- ColumnResizeUndoUnit.cs
- XamlClipboardData.cs
- odbcmetadatafactory.cs
- ZipIOModeEnforcingStream.cs
- UriWriter.cs
- Component.cs
- RunClient.cs
- GenericsInstances.cs
- WindowsImpersonationContext.cs
- ConnectionStringsExpressionEditor.cs
- ApplicationProxyInternal.cs
- AbstractExpressions.cs
- AnnotationObservableCollection.cs
- WebPartZoneDesigner.cs
- DateTimeValueSerializerContext.cs
- CommonRemoteMemoryBlock.cs
- GenericTypeParameterBuilder.cs
- TypeReference.cs
- PeerNameRecordCollection.cs
- SyntaxCheck.cs
- FieldAccessException.cs
- PropertyValue.cs