Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / LicenseProviderAttribute.cs / 1 / 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
- TdsEnums.cs
- Base64Encoder.cs
- PassportPrincipal.cs
- CompositeFontParser.cs
- DocumentPageHost.cs
- followingsibling.cs
- OdbcDataReader.cs
- XmlLinkedNode.cs
- CrossAppDomainChannel.cs
- SchemaInfo.cs
- MeasureItemEvent.cs
- ListViewDeletedEventArgs.cs
- DiagnosticTrace.cs
- RawUIStateInputReport.cs
- SkinBuilder.cs
- DataSysAttribute.cs
- MergablePropertyAttribute.cs
- DesignColumn.cs
- CachedPathData.cs
- Propagator.ExtentPlaceholderCreator.cs
- AutoCompleteStringCollection.cs
- UICuesEvent.cs
- CodeThrowExceptionStatement.cs
- HtmlUtf8RawTextWriter.cs
- CompositeFontParser.cs
- NetCodeGroup.cs
- ApplicationInterop.cs
- AuthStoreRoleProvider.cs
- PageSettings.cs
- MyContact.cs
- XmlDataSource.cs
- RemotingAttributes.cs
- StretchValidation.cs
- FrameworkReadOnlyPropertyMetadata.cs
- TypeConverters.cs
- _HeaderInfo.cs
- ToolStripRendererSwitcher.cs
- DoubleLink.cs
- NetTcpSecurityElement.cs
- Substitution.cs
- WebControlParameterProxy.cs
- InkCollectionBehavior.cs
- XPathBuilder.cs
- EnumerableCollectionView.cs
- DetailsViewPagerRow.cs
- CanonicalFontFamilyReference.cs
- DetailsViewDeletedEventArgs.cs
- NullableConverter.cs
- CLSCompliantAttribute.cs
- KnownBoxes.cs
- ScrollEventArgs.cs
- GcSettings.cs
- DataGridViewImageCell.cs
- ScrollChrome.cs
- PermissionSetEnumerator.cs
- ScrollableControl.cs
- BuildProvider.cs
- ServicePrincipalNameElement.cs
- CodeChecksumPragma.cs
- JoinCqlBlock.cs
- BindingListCollectionView.cs
- IntegerValidator.cs
- ManualWorkflowSchedulerService.cs
- ThreadSafeList.cs
- DataListCommandEventArgs.cs
- SplineKeyFrames.cs
- GeneratedContractType.cs
- ObjectRef.cs
- XmlSchemaSimpleContentRestriction.cs
- Propagator.cs
- NavigationProperty.cs
- ListMarkerLine.cs
- AsymmetricAlgorithm.cs
- PersianCalendar.cs
- StylusPointPropertyId.cs
- RegexWorker.cs
- SiteMapDataSourceView.cs
- CallbackCorrelationInitializer.cs
- x509store.cs
- MailWebEventProvider.cs
- QueryConverter.cs
- UnionExpr.cs
- ValueSerializerAttribute.cs
- ThicknessAnimationBase.cs
- SpnegoTokenAuthenticator.cs
- EventLogPermission.cs
- InterleavedZipPartStream.cs
- NavigationHelper.cs
- ObjectRef.cs
- Membership.cs
- WpfGeneratedKnownProperties.cs
- LiteralDesigner.cs
- WindowsIPAddress.cs
- Comparer.cs
- ToolBar.cs
- DynamicMethod.cs
- PropertyChangingEventArgs.cs
- ProviderMetadata.cs
- PageBreakRecord.cs
- Permission.cs