Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- AddInAttribute.cs
- Timer.cs
- SurrogateEncoder.cs
- DataGridLinkButton.cs
- DrawListViewSubItemEventArgs.cs
- InstalledVoice.cs
- NavigatorInput.cs
- WebPageTraceListener.cs
- FullTrustAssembliesSection.cs
- HttpConfigurationContext.cs
- MainMenu.cs
- MaskInputRejectedEventArgs.cs
- EDesignUtil.cs
- MethodToken.cs
- ConfigurationElement.cs
- FontDriver.cs
- _BasicClient.cs
- XmlSchemaSimpleType.cs
- SystemInfo.cs
- RelationshipEndCollection.cs
- ButtonChrome.cs
- OrderByLifter.cs
- FormatVersion.cs
- XmlILConstructAnalyzer.cs
- SqlMethods.cs
- UTF8Encoding.cs
- XmlSchemaSimpleTypeList.cs
- ValueOfAction.cs
- RelationshipEnd.cs
- SendActivity.cs
- EnumerableCollectionView.cs
- WebDisplayNameAttribute.cs
- DataSourceExpression.cs
- WrapPanel.cs
- ValidateNames.cs
- ProviderBase.cs
- FormView.cs
- WebPartEditorApplyVerb.cs
- SqlConnectionPoolProviderInfo.cs
- Page.cs
- XamlPointCollectionSerializer.cs
- ServiceHostingEnvironment.cs
- Listbox.cs
- XmlQueryOutput.cs
- TextEditorLists.cs
- ItemsControlAutomationPeer.cs
- BaseTreeIterator.cs
- EditorZoneBase.cs
- PrintEvent.cs
- Thumb.cs
- SRef.cs
- PageCache.cs
- ParentQuery.cs
- ValidationEventArgs.cs
- Validator.cs
- IndexedString.cs
- ListControlDataBindingHandler.cs
- EventRecordWrittenEventArgs.cs
- AttachmentCollection.cs
- MediaCommands.cs
- XmlAnyElementAttributes.cs
- AffineTransform3D.cs
- PersonalizableTypeEntry.cs
- COM2IDispatchConverter.cs
- WebPartDisplayMode.cs
- XmlEncoding.cs
- NavigatorOutput.cs
- BufferedReceiveElement.cs
- Effect.cs
- SHA1CryptoServiceProvider.cs
- AccessControlEntry.cs
- CornerRadius.cs
- Win32Exception.cs
- RepeatButtonAutomationPeer.cs
- ConfigXmlElement.cs
- Emitter.cs
- Validator.cs
- OperationBehaviorAttribute.cs
- GraphicsPath.cs
- PropertyGridView.cs
- XomlCompilerError.cs
- BackStopAuthenticationModule.cs
- BamlReader.cs
- GrabHandleGlyph.cs
- RuntimeHandles.cs
- Msec.cs
- ADConnectionHelper.cs
- SqlMultiplexer.cs
- BufferModesCollection.cs
- ContextInformation.cs
- FirewallWrapper.cs
- ToolStripCustomTypeDescriptor.cs
- ModelItemKeyValuePair.cs
- DataGridViewCellCancelEventArgs.cs
- TargetControlTypeCache.cs
- NullableDoubleSumAggregationOperator.cs
- _NetworkingPerfCounters.cs
- SystemColors.cs
- ParserContext.cs
- MultipartContentParser.cs