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
- SrgsElementList.cs
- SQLStringStorage.cs
- PeerTransportListenAddressValidator.cs
- CqlWriter.cs
- TextBox.cs
- PreservationFileReader.cs
- AdvancedBindingPropertyDescriptor.cs
- MouseEvent.cs
- Vector3DAnimationUsingKeyFrames.cs
- EntityCommandExecutionException.cs
- HttpInputStream.cs
- PeerNodeTraceRecord.cs
- Atom10FormatterFactory.cs
- SqlBinder.cs
- EntityContainerEmitter.cs
- X509SecurityTokenAuthenticator.cs
- EntityException.cs
- InvalidAsynchronousStateException.cs
- StaticFileHandler.cs
- HostExecutionContextManager.cs
- FontWeights.cs
- StylusShape.cs
- CharStorage.cs
- JsonEnumDataContract.cs
- AdapterUtil.cs
- CultureSpecificCharacterBufferRange.cs
- PackWebRequestFactory.cs
- SqlParameter.cs
- CacheHelper.cs
- SyntaxCheck.cs
- ClientConfigurationSystem.cs
- RangeValidator.cs
- ReliableChannelFactory.cs
- ChannelServices.cs
- UnknownBitmapEncoder.cs
- ConnectionManagementElementCollection.cs
- LayoutTable.cs
- FramingEncoders.cs
- DataGridViewHitTestInfo.cs
- FtpWebResponse.cs
- ImageField.cs
- TextServicesCompartmentEventSink.cs
- NamedObjectList.cs
- CatalogPart.cs
- PolyQuadraticBezierSegment.cs
- SystemWebSectionGroup.cs
- TypeDelegator.cs
- DataServiceHost.cs
- ProviderMetadata.cs
- Simplifier.cs
- DeferredSelectedIndexReference.cs
- DeploymentSection.cs
- DecoderFallbackWithFailureFlag.cs
- KeyTime.cs
- ProtocolElement.cs
- TrackingMemoryStreamFactory.cs
- UriTemplateClientFormatter.cs
- NetTcpBindingElement.cs
- FormatException.cs
- Math.cs
- WebUtil.cs
- TimeSpanSecondsConverter.cs
- LogReserveAndAppendState.cs
- ImageCodecInfoPrivate.cs
- TreeBuilderXamlTranslator.cs
- LinqDataSourceInsertEventArgs.cs
- UIAgentAsyncParams.cs
- storepermission.cs
- Style.cs
- StandardToolWindows.cs
- RecommendedAsConfigurableAttribute.cs
- HttpProfileBase.cs
- ConnectionStringSettings.cs
- InputMethodStateChangeEventArgs.cs
- BamlRecordHelper.cs
- PersonalizationStateQuery.cs
- WebRequestModulesSection.cs
- DescendantBaseQuery.cs
- CompositeFontParser.cs
- ProxyGenerationError.cs
- IdnElement.cs
- SqlGatherConsumedAliases.cs
- RewritingPass.cs
- Trigger.cs
- HiddenField.cs
- CollectionTypeElement.cs
- UnicastIPAddressInformationCollection.cs
- versioninfo.cs
- CssStyleCollection.cs
- NetworkCredential.cs
- LiteralTextContainerControlBuilder.cs
- XmlCharCheckingReader.cs
- ChangePassword.cs
- QilInvokeLateBound.cs
- figurelength.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- Application.cs
- XmlNamedNodeMap.cs
- StylusPointPropertyUnit.cs
- SaveWorkflowAsyncResult.cs