Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XmlSchemaSimpleContentRestriction.cs
- TraceXPathNavigator.cs
- SHA384Managed.cs
- SQLInt64.cs
- WindowsIdentity.cs
- XmlEventCache.cs
- DbCommandDefinition.cs
- ProxyWebPartConnectionCollection.cs
- PEFileReader.cs
- ClassHandlersStore.cs
- ReaderContextStackData.cs
- ScrollViewerAutomationPeer.cs
- Model3DCollection.cs
- ResponseStream.cs
- NopReturnReader.cs
- TableAdapterManagerGenerator.cs
- WebPartHelpVerb.cs
- ComEventsMethod.cs
- FontStretchConverter.cs
- XmlSchemaAppInfo.cs
- CodeTypeReferenceCollection.cs
- SchemaMapping.cs
- UpdateException.cs
- Utils.cs
- ProtectedProviderSettings.cs
- Stopwatch.cs
- WebHostUnsafeNativeMethods.cs
- MulticastNotSupportedException.cs
- ResourcePermissionBaseEntry.cs
- SafeLibraryHandle.cs
- GeneralTransform2DTo3D.cs
- Button.cs
- AncestorChangedEventArgs.cs
- GridViewColumnCollection.cs
- LoginUtil.cs
- BooleanAnimationUsingKeyFrames.cs
- _FixedSizeReader.cs
- TempFiles.cs
- HtmlForm.cs
- DashStyles.cs
- CatalogZoneBase.cs
- WindowsBrush.cs
- IsolatedStorage.cs
- DelegateHelpers.Generated.cs
- ListViewEditEventArgs.cs
- GridViewHeaderRowPresenter.cs
- LoadGrammarCompletedEventArgs.cs
- KeyGestureConverter.cs
- XmlHierarchicalDataSourceView.cs
- RIPEMD160.cs
- DesignerCapabilities.cs
- XmlSchemaException.cs
- ParameterBinding.cs
- SafeProcessHandle.cs
- ResetableIterator.cs
- ContentTextAutomationPeer.cs
- WebControlsSection.cs
- ChtmlTextBoxAdapter.cs
- PageContentAsyncResult.cs
- ObjectViewEntityCollectionData.cs
- TypedTableBase.cs
- DrawingState.cs
- FontStyles.cs
- CodeAccessPermission.cs
- XmlSignificantWhitespace.cs
- ClickablePoint.cs
- TrackingServices.cs
- InternalControlCollection.cs
- Point3DIndependentAnimationStorage.cs
- ToolBarButton.cs
- LiteralControl.cs
- StickyNote.cs
- NamespaceQuery.cs
- SizeAnimationBase.cs
- Color.cs
- WebException.cs
- BlockCollection.cs
- TrustManager.cs
- Odbc32.cs
- SqlExpander.cs
- FontCacheUtil.cs
- ViewSimplifier.cs
- ProfileSettings.cs
- StreamWithDictionary.cs
- GlobalProxySelection.cs
- Int32Animation.cs
- XmlQueryOutput.cs
- ContainerUtilities.cs
- WebPartsPersonalization.cs
- UriTemplateDispatchFormatter.cs
- prefixendpointaddressmessagefilter.cs
- SerializerProvider.cs
- MessageSmuggler.cs
- SparseMemoryStream.cs
- TypeConverter.cs
- LightweightEntityWrapper.cs
- EditorServiceContext.cs
- SubtreeProcessor.cs
- ChangeTracker.cs
- MarginsConverter.cs