Code:
/ 4.0 / 4.0 / untmp / 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. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventMetadata.cs
- DataGridViewCell.cs
- updatecommandorderer.cs
- GridViewRowCollection.cs
- AccessDataSourceView.cs
- PeerContact.cs
- SHA1.cs
- TemplateBindingExpression.cs
- InputElement.cs
- ComponentRenameEvent.cs
- BitFlagsGenerator.cs
- TypeListConverter.cs
- rsa.cs
- DiscoveryViaBehavior.cs
- DecimalKeyFrameCollection.cs
- DefinitionBase.cs
- DecoderNLS.cs
- SecurityDescriptor.cs
- CharEntityEncoderFallback.cs
- ListViewHitTestInfo.cs
- Substitution.cs
- SecureStringHasher.cs
- StyleXamlParser.cs
- SafeMemoryMappedFileHandle.cs
- FormatterServicesNoSerializableCheck.cs
- DebugHandleTracker.cs
- DataRecord.cs
- SubclassTypeValidatorAttribute.cs
- DataObjectAttribute.cs
- Peer.cs
- SrgsRule.cs
- ValueType.cs
- BinaryUtilClasses.cs
- XmlQueryRuntime.cs
- ToolStripDropDownClosedEventArgs.cs
- SettingsBindableAttribute.cs
- SqlRemoveConstantOrderBy.cs
- MultiBinding.cs
- RubberbandSelector.cs
- BezierSegment.cs
- Int32RectConverter.cs
- RectIndependentAnimationStorage.cs
- CacheChildrenQuery.cs
- ITextView.cs
- EnumType.cs
- XmlTextReaderImpl.cs
- KnownBoxes.cs
- StringUtil.cs
- Pkcs9Attribute.cs
- TransformedBitmap.cs
- LinearGradientBrush.cs
- _FtpDataStream.cs
- FixedTextPointer.cs
- DrawingContextWalker.cs
- RuleSettings.cs
- ContainerFilterService.cs
- ellipse.cs
- HiddenFieldPageStatePersister.cs
- InheritanceRules.cs
- AnnotationObservableCollection.cs
- ScriptManager.cs
- TraceEventCache.cs
- TextTreeObjectNode.cs
- FocusWithinProperty.cs
- AddingNewEventArgs.cs
- DataPagerField.cs
- SplashScreenNativeMethods.cs
- WebPartZoneBaseDesigner.cs
- SqlDelegatedTransaction.cs
- ComponentConverter.cs
- DbProviderFactories.cs
- MetadataConversionError.cs
- DBBindings.cs
- ListViewGroupConverter.cs
- externdll.cs
- RangeValueProviderWrapper.cs
- HttpApplicationFactory.cs
- EntityDataSourceQueryBuilder.cs
- propertytag.cs
- CommandExpr.cs
- Int64.cs
- NamespaceExpr.cs
- ProtocolsSection.cs
- CanonicalFontFamilyReference.cs
- EventWaitHandle.cs
- MetadataSerializer.cs
- WorkflowDefinitionContext.cs
- OdbcFactory.cs
- ImageMapEventArgs.cs
- TabControlAutomationPeer.cs
- TiffBitmapEncoder.cs
- BreakRecordTable.cs
- Mutex.cs
- HostSecurityManager.cs
- ToolStripEditorManager.cs
- CatalogZoneBase.cs
- RenamedEventArgs.cs
- ContextBase.cs
- ClipboardProcessor.cs
- BufferedWebEventProvider.cs