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
- GcHandle.cs
- BmpBitmapEncoder.cs
- ChangeToolStripParentVerb.cs
- ThreadStartException.cs
- ImageMap.cs
- AstTree.cs
- RuntimeComponentFilter.cs
- RadioButtonBaseAdapter.cs
- EventMappingSettings.cs
- SqlLiftIndependentRowExpressions.cs
- DBParameter.cs
- ValidationPropertyAttribute.cs
- EntityStoreSchemaFilterEntry.cs
- XmlCDATASection.cs
- InputLanguageSource.cs
- DataObjectMethodAttribute.cs
- RequestBringIntoViewEventArgs.cs
- FontUnitConverter.cs
- BinaryQueryOperator.cs
- Hash.cs
- XmlNodeChangedEventArgs.cs
- WebPartTransformerCollection.cs
- DataGridPageChangedEventArgs.cs
- KeyValueSerializer.cs
- XamlStyleSerializer.cs
- OracleEncoding.cs
- GifBitmapDecoder.cs
- ZipIOExtraFieldZip64Element.cs
- Normalizer.cs
- TreeNodeMouseHoverEvent.cs
- TextRangeSerialization.cs
- GridViewDeletedEventArgs.cs
- StylusTip.cs
- SetUserPreferenceRequest.cs
- TypeForwardedToAttribute.cs
- SafeEventLogWriteHandle.cs
- TrackingAnnotationCollection.cs
- DebuggerService.cs
- SqlNamer.cs
- SendingRequestEventArgs.cs
- RichTextBoxAutomationPeer.cs
- Int64Animation.cs
- ObjectAnimationBase.cs
- ScriptingProfileServiceSection.cs
- DynamicUpdateCommand.cs
- NumberAction.cs
- DependencyObjectValidator.cs
- Literal.cs
- BindingList.cs
- SectionInput.cs
- SerializeAbsoluteContext.cs
- StringConverter.cs
- TakeOrSkipWhileQueryOperator.cs
- ContextStaticAttribute.cs
- SHA1CryptoServiceProvider.cs
- SystemWebCachingSectionGroup.cs
- DataTemplate.cs
- DeclarativeCatalogPart.cs
- TransactionProxy.cs
- MetabaseServerConfig.cs
- SafeSecurityHandles.cs
- DBCSCodePageEncoding.cs
- ObjectDataSource.cs
- BatchServiceHost.cs
- CorrelationQueryBehavior.cs
- SatelliteContractVersionAttribute.cs
- counter.cs
- Converter.cs
- Configuration.cs
- DisplayInformation.cs
- Certificate.cs
- TemplatePagerField.cs
- SqlExpander.cs
- XmlSerializationWriter.cs
- EventDescriptorCollection.cs
- SafeProcessHandle.cs
- MatrixKeyFrameCollection.cs
- FigureParagraph.cs
- CompilerParameters.cs
- TrackingDataItem.cs
- ListBase.cs
- DependencyPropertyKind.cs
- codemethodreferenceexpression.cs
- GetResponse.cs
- ParameterBuilder.cs
- ArcSegment.cs
- CodeAttachEventStatement.cs
- HttpVersion.cs
- XmlSerializerSection.cs
- WebPartHelpVerb.cs
- TreeWalkHelper.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HttpDigestClientElement.cs
- SignatureDescription.cs
- DbProviderFactory.cs
- ControlBindingsCollection.cs
- BodyGlyph.cs
- DataObjectEventArgs.cs
- Subtree.cs
- FileUpload.cs