Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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(); } } }/// Returns the hashcode for this object. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InternalControlCollection.cs
- HandleCollector.cs
- TransactedBatchingBehavior.cs
- DateTimeStorage.cs
- SmiEventSink.cs
- isolationinterop.cs
- ErrorEventArgs.cs
- FixedPage.cs
- SignatureResourcePool.cs
- QilIterator.cs
- CompositeControlDesigner.cs
- FrameworkObject.cs
- QuinticEase.cs
- DatasetMethodGenerator.cs
- WebPartTransformer.cs
- XmlMemberMapping.cs
- FileStream.cs
- NetworkInterface.cs
- DecimalStorage.cs
- ChangeDirector.cs
- TextEncodedRawTextWriter.cs
- EntityDataSourceWrapperCollection.cs
- CallContext.cs
- AccessDataSourceView.cs
- DataGridRow.cs
- SQLByteStorage.cs
- OperatingSystem.cs
- BoundField.cs
- SQLConvert.cs
- TreeView.cs
- WindowsAltTab.cs
- FilterRepeater.cs
- BinaryFormatterWriter.cs
- FunctionNode.cs
- SafeNativeMethods.cs
- TemplateParser.cs
- Light.cs
- HttpChannelFactory.cs
- IndexedGlyphRun.cs
- RecordsAffectedEventArgs.cs
- ColumnClickEvent.cs
- AutomationPatternInfo.cs
- WebRequest.cs
- DataControlReference.cs
- StrokeNode.cs
- Deserializer.cs
- SessionEndedEventArgs.cs
- PageTheme.cs
- SecurityIdentifierElementCollection.cs
- DataGridDetailsPresenter.cs
- StateManagedCollection.cs
- LinkedResource.cs
- ContextStack.cs
- NavigationWindowAutomationPeer.cs
- ActivationArguments.cs
- TextServicesCompartmentEventSink.cs
- TransformerConfigurationWizardBase.cs
- UserNameSecurityTokenParameters.cs
- ControlType.cs
- GridToolTip.cs
- SelectionWordBreaker.cs
- SettingsSection.cs
- BaseUriHelper.cs
- DataGridSortCommandEventArgs.cs
- Domain.cs
- EdmProviderManifest.cs
- DataGridRelationshipRow.cs
- TypeLoadException.cs
- TranslateTransform3D.cs
- XmlUnspecifiedAttribute.cs
- PartialCachingControl.cs
- BamlBinaryReader.cs
- WebMessageEncodingBindingElement.cs
- IdentityReference.cs
- Literal.cs
- Helpers.cs
- CompilerError.cs
- FontStyleConverter.cs
- RelationshipSet.cs
- BaseValidator.cs
- AppSettingsSection.cs
- TimeZone.cs
- QueryableDataSource.cs
- MenuItemCollection.cs
- QilUnary.cs
- BreadCrumbTextConverter.cs
- FixedPage.cs
- ExceptionUtil.cs
- Queue.cs
- GAC.cs
- FormViewCommandEventArgs.cs
- DataSourceHelper.cs
- VersionValidator.cs
- TreeViewImageIndexConverter.cs
- ScriptModule.cs
- DataKey.cs
- ManifestSignedXml.cs
- BamlWriter.cs
- StdRegProviderWrapper.cs
- SelectionRange.cs