Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ImageListDesigner.cs
- XmlTypeAttribute.cs
- ToolStripContentPanelRenderEventArgs.cs
- EntityTransaction.cs
- CodeGenerator.cs
- CqlGenerator.cs
- ExceptionTranslationTable.cs
- SeverityFilter.cs
- IdentityVerifier.cs
- ByteStack.cs
- objectresult_tresulttype.cs
- SecurityStateEncoder.cs
- Underline.cs
- BufferModesCollection.cs
- ContentElement.cs
- ExceptionRoutedEventArgs.cs
- HttpBindingExtension.cs
- ReachSerializationUtils.cs
- MaskInputRejectedEventArgs.cs
- StateMachineDesignerPaint.cs
- XmlSchemaCompilationSettings.cs
- DataGridTable.cs
- objectquery_tresulttype.cs
- WizardPanelChangingEventArgs.cs
- DurationConverter.cs
- QilTypeChecker.cs
- ChangeBlockUndoRecord.cs
- TransformGroup.cs
- QilStrConcat.cs
- WebPartTracker.cs
- DataComponentMethodGenerator.cs
- TextPenaltyModule.cs
- ListMarkerLine.cs
- AmbientLight.cs
- DictionarySurrogate.cs
- X509Certificate2Collection.cs
- VisemeEventArgs.cs
- Cursor.cs
- GuidelineSet.cs
- IDReferencePropertyAttribute.cs
- NaturalLanguageHyphenator.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HotSpot.cs
- Variable.cs
- InputEventArgs.cs
- GeneratedView.cs
- PixelFormats.cs
- ChangeConflicts.cs
- SqlDeflator.cs
- TargetInvocationException.cs
- StringWriter.cs
- WindowsListViewScroll.cs
- FileVersion.cs
- DiscreteKeyFrames.cs
- OleDbDataReader.cs
- ValidationPropertyAttribute.cs
- InfoCardArgumentException.cs
- ConditionalAttribute.cs
- LoginView.cs
- NamespaceList.cs
- XmlFileEditor.cs
- TextServicesCompartmentContext.cs
- FileFormatException.cs
- StoragePropertyMapping.cs
- IdentityHolder.cs
- XPathPatternBuilder.cs
- FigureHelper.cs
- SharedTcpTransportManager.cs
- ConsoleCancelEventArgs.cs
- Int32CollectionConverter.cs
- SymDocumentType.cs
- TargetParameterCountException.cs
- ErrorBehavior.cs
- HyperLinkField.cs
- XmlReaderSettings.cs
- ListBindableAttribute.cs
- TagMapCollection.cs
- ColorAnimationUsingKeyFrames.cs
- SvcMapFileLoader.cs
- _ListenerRequestStream.cs
- SqlBulkCopyColumnMapping.cs
- NamedPipeAppDomainProtocolHandler.cs
- PolicyImporterElementCollection.cs
- ToolStripPanelRow.cs
- SiteIdentityPermission.cs
- XmlRawWriter.cs
- CodeDefaultValueExpression.cs
- CompositeActivityValidator.cs
- OleDbSchemaGuid.cs
- TableLayoutPanel.cs
- ListChangedEventArgs.cs
- DrawingContext.cs
- TemplatePropertyEntry.cs
- ExpressionTextBoxAutomationPeer.cs
- QilName.cs
- DataGridViewCellStyle.cs
- BaseInfoTable.cs
- EntitySet.cs
- HelloMessageCD1.cs
- ItemAutomationPeer.cs