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
- BulletedListEventArgs.cs
- UidManager.cs
- OuterGlowBitmapEffect.cs
- DataGridViewCellStateChangedEventArgs.cs
- GetPageCompletedEventArgs.cs
- ObjectHelper.cs
- DataTableNewRowEvent.cs
- SecurityVersion.cs
- Span.cs
- XmlILAnnotation.cs
- XmlNamespaceMapping.cs
- XmlCharacterData.cs
- OperatingSystem.cs
- IntegerValidatorAttribute.cs
- HWStack.cs
- SqlWebEventProvider.cs
- ConfigXmlDocument.cs
- TextBlockAutomationPeer.cs
- TableColumnCollectionInternal.cs
- RegexRunner.cs
- ValueUnavailableException.cs
- BaseAsyncResult.cs
- UrlParameterWriter.cs
- RadioButtonAutomationPeer.cs
- SettingsProviderCollection.cs
- BaseAppDomainProtocolHandler.cs
- Int32Rect.cs
- SafeThreadHandle.cs
- ItemsControl.cs
- Hashtable.cs
- FtpWebResponse.cs
- HostingEnvironmentSection.cs
- MultitargetUtil.cs
- ManagedWndProcTracker.cs
- ByteAnimationUsingKeyFrames.cs
- StylusButtonEventArgs.cs
- DataGridLinkButton.cs
- ProfileModule.cs
- JavaScriptString.cs
- ParseHttpDate.cs
- ObjectDataSourceFilteringEventArgs.cs
- CodeGenerator.cs
- TreeNodeCollection.cs
- RegisteredScript.cs
- SettingsSection.cs
- HtmlTableRow.cs
- InvokePattern.cs
- HttpContextServiceHost.cs
- PromptStyle.cs
- ITextView.cs
- ToolboxBitmapAttribute.cs
- PartialTrustVisibleAssembliesSection.cs
- ViewManager.cs
- SocketAddress.cs
- TemplatedAdorner.cs
- InvalidProgramException.cs
- RoleManagerEventArgs.cs
- NavigationExpr.cs
- XpsLiterals.cs
- Ipv6Element.cs
- Tool.cs
- XamlInt32CollectionSerializer.cs
- TextSelectionProcessor.cs
- CookieProtection.cs
- MessageSmuggler.cs
- FormViewDeletedEventArgs.cs
- CodeObjectCreateExpression.cs
- ChildrenQuery.cs
- CombinedGeometry.cs
- TypeFieldSchema.cs
- TemplateKey.cs
- WindowsButton.cs
- PriorityRange.cs
- LassoSelectionBehavior.cs
- GregorianCalendarHelper.cs
- HttpStaticObjectsCollectionWrapper.cs
- Attributes.cs
- SqlBulkCopy.cs
- DataGridColumn.cs
- StatusBarPanel.cs
- GeneralTransform2DTo3D.cs
- WebPartCatalogCloseVerb.cs
- XPathScanner.cs
- _LazyAsyncResult.cs
- ToolBarButton.cs
- EventLogException.cs
- HwndSource.cs
- InvalidProgramException.cs
- BaseAddressElement.cs
- CatalogZoneAutoFormat.cs
- ModuleElement.cs
- Style.cs
- RegistryPermission.cs
- PatternMatcher.cs
- datacache.cs
- FrameworkElement.cs
- ValuePattern.cs
- SqlStream.cs
- XpsFontSubsetter.cs
- FixedSOMSemanticBox.cs