Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / LicenseProviderAttribute.cs / 1305376 / LicenseProviderAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class LicenseProviderAttribute : Attribute { ///Specifies the ////// to use with a class. /// public static readonly LicenseProviderAttribute Default = new LicenseProviderAttribute(); private Type licenseProviderType = null; private string licenseProviderName = null; ////// Specifies the default value, which is no provider. This ///field is read-only. /// /// public LicenseProviderAttribute() : this((string)null) { } ///Initializes a new instance of the ///class without a license /// provider. /// public LicenseProviderAttribute(string typeName) { licenseProviderName = typeName; } ////// Initializes a new instance of the ///class with /// the specified type. /// /// public LicenseProviderAttribute(Type type) { licenseProviderType = type; } ////// Initializes a new instance of the ///class with /// the specified type of license provider. /// /// public Type LicenseProvider { // SECREVIEW: Remove this attribute once bug#411910 is fixed. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] get { if (licenseProviderType == null && licenseProviderName != null) { licenseProviderType = Type.GetType(licenseProviderName); } return licenseProviderType; } } ///Gets the license provider to use with the associated class. ////// /// public override object TypeId { get { string typeName = licenseProviderName; if (typeName == null && licenseProviderType != null) { typeName = licenseProviderType.FullName; } return GetType().FullName + typeName; } } ////// This defines a unique ID for this attribute type. It is used /// by filtering algorithms to identify two attributes that are /// the same type. For most attributes, this just returns the /// Type instance for the attribute. LicenseProviderAttribute overrides this to include the type name and the /// provider type name. /// ////// /// public override bool Equals(object value) { if (value is LicenseProviderAttribute && value != null) { Type type = ((LicenseProviderAttribute)value).LicenseProvider; if (type == LicenseProvider) { return true; } else { if (type != null && type.Equals(LicenseProvider)) { return true; } } } return false; } ////// public override int GetHashCode() { return base.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Returns the hashcode for this object. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class LicenseProviderAttribute : Attribute { ///Specifies the ////// to use with a class. /// public static readonly LicenseProviderAttribute Default = new LicenseProviderAttribute(); private Type licenseProviderType = null; private string licenseProviderName = null; ////// Specifies the default value, which is no provider. This ///field is read-only. /// /// public LicenseProviderAttribute() : this((string)null) { } ///Initializes a new instance of the ///class without a license /// provider. /// public LicenseProviderAttribute(string typeName) { licenseProviderName = typeName; } ////// Initializes a new instance of the ///class with /// the specified type. /// /// public LicenseProviderAttribute(Type type) { licenseProviderType = type; } ////// Initializes a new instance of the ///class with /// the specified type of license provider. /// /// public Type LicenseProvider { // SECREVIEW: Remove this attribute once bug#411910 is fixed. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] get { if (licenseProviderType == null && licenseProviderName != null) { licenseProviderType = Type.GetType(licenseProviderName); } return licenseProviderType; } } ///Gets the license provider to use with the associated class. ////// /// public override object TypeId { get { string typeName = licenseProviderName; if (typeName == null && licenseProviderType != null) { typeName = licenseProviderType.FullName; } return GetType().FullName + typeName; } } ////// This defines a unique ID for this attribute type. It is used /// by filtering algorithms to identify two attributes that are /// the same type. For most attributes, this just returns the /// Type instance for the attribute. LicenseProviderAttribute overrides this to include the type name and the /// provider type name. /// ////// /// public override bool Equals(object value) { if (value is LicenseProviderAttribute && value != null) { Type type = ((LicenseProviderAttribute)value).LicenseProvider; if (type == LicenseProvider) { return true; } else { if (type != null && type.Equals(LicenseProvider)) { return true; } } } return false; } ////// public override int GetHashCode() { return base.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Returns the hashcode for this object. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Clipboard.cs
- Accessible.cs
- XPathChildIterator.cs
- CharEnumerator.cs
- InProcStateClientManager.cs
- DesignTableCollection.cs
- Currency.cs
- TextRunProperties.cs
- loginstatus.cs
- TableColumn.cs
- mansign.cs
- CharacterBuffer.cs
- InstancePersistenceCommandException.cs
- rsa.cs
- RectangleHotSpot.cs
- DriveInfo.cs
- BaseCAMarshaler.cs
- Themes.cs
- BlurBitmapEffect.cs
- AnonymousIdentificationSection.cs
- Bits.cs
- HttpConfigurationSystem.cs
- OdbcCommandBuilder.cs
- _ProxyChain.cs
- DetailsViewPagerRow.cs
- ConstructorBuilder.cs
- WebReference.cs
- ResourcesBuildProvider.cs
- SHA512.cs
- PageStatePersister.cs
- AutomationElementIdentifiers.cs
- XsdCachingReader.cs
- CodePrimitiveExpression.cs
- FileReservationCollection.cs
- PageCatalogPartDesigner.cs
- TypeGeneratedEventArgs.cs
- StrokeNodeEnumerator.cs
- IdnElement.cs
- CookieProtection.cs
- GreenMethods.cs
- ipaddressinformationcollection.cs
- XmlDictionaryReader.cs
- ChildrenQuery.cs
- thaishape.cs
- DockAndAnchorLayout.cs
- BindingExpression.cs
- ConvertEvent.cs
- InputLanguageCollection.cs
- WasHostedComPlusFactory.cs
- AsnEncodedData.cs
- HttpTransportManager.cs
- controlskin.cs
- SafeNativeMethods.cs
- NativeMethodsCLR.cs
- PathFigureCollectionConverter.cs
- GPStream.cs
- Cursors.cs
- DataSourceProvider.cs
- FocusManager.cs
- AudioFormatConverter.cs
- UriExt.cs
- Unit.cs
- UnicastIPAddressInformationCollection.cs
- Identifier.cs
- AccessDataSource.cs
- ControlType.cs
- IteratorFilter.cs
- IisTraceWebEventProvider.cs
- RouteTable.cs
- FunctionOverloadResolver.cs
- TableRow.cs
- DelegatedStream.cs
- DataGridItemAutomationPeer.cs
- RefreshPropertiesAttribute.cs
- HtmlUtf8RawTextWriter.cs
- EventLogEntryCollection.cs
- peersecurityelement.cs
- EventLog.cs
- BamlTreeNode.cs
- ServicePointManager.cs
- DataPointer.cs
- StringFunctions.cs
- BindingCompleteEventArgs.cs
- CodeObjectCreateExpression.cs
- DefaultValueMapping.cs
- IISUnsafeMethods.cs
- ProfileSection.cs
- ClientConfigurationHost.cs
- OperationCanceledException.cs
- StrokeRenderer.cs
- sqlser.cs
- EncryptedKeyIdentifierClause.cs
- ViewManager.cs
- NotFiniteNumberException.cs
- UriSection.cs
- MetafileHeader.cs
- UnsafeNetInfoNativeMethods.cs
- ToolStripDesignerAvailabilityAttribute.cs
- EmbossBitmapEffect.cs
- FrameSecurityDescriptor.cs