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
- EncoderReplacementFallback.cs
- WindowPattern.cs
- ArithmeticException.cs
- DrawTreeNodeEventArgs.cs
- ScriptResourceMapping.cs
- ClientScriptManager.cs
- CommonObjectSecurity.cs
- ParallelTimeline.cs
- DataGridViewCellEventArgs.cs
- MarkupCompiler.cs
- EFTableProvider.cs
- SetterBaseCollection.cs
- WebService.cs
- TransactionChannelFactory.cs
- LinkClickEvent.cs
- WSFederationHttpSecurity.cs
- XNameTypeConverter.cs
- SapiRecoInterop.cs
- UrlMapping.cs
- WebSysDisplayNameAttribute.cs
- M3DUtil.cs
- DeclarationUpdate.cs
- TextSimpleMarkerProperties.cs
- WriteTimeStream.cs
- ByteAnimation.cs
- QueryComponents.cs
- ButtonColumn.cs
- SystemResourceHost.cs
- ToolStripOverflowButton.cs
- NameObjectCollectionBase.cs
- CodeRemoveEventStatement.cs
- _AutoWebProxyScriptEngine.cs
- DynamicRendererThreadManager.cs
- TranslateTransform.cs
- SymmetricAlgorithm.cs
- GeneralTransform3D.cs
- DataControlField.cs
- PeerName.cs
- controlskin.cs
- AndCondition.cs
- CurrencyWrapper.cs
- HtmlLink.cs
- WindowsFormsHelpers.cs
- TreeViewAutomationPeer.cs
- SerialPinChanges.cs
- RecommendedAsConfigurableAttribute.cs
- TraceLevelStore.cs
- ExpressionBuilder.cs
- TempEnvironment.cs
- InlineCollection.cs
- EdmFunctionAttribute.cs
- Matrix.cs
- XPathAncestorIterator.cs
- FamilyTypefaceCollection.cs
- CommandSet.cs
- StyleXamlParser.cs
- AttributeEmitter.cs
- SettingsPropertyValue.cs
- ViewStateException.cs
- Attributes.cs
- TextRunTypographyProperties.cs
- handlecollector.cs
- ManagedWndProcTracker.cs
- TransformedBitmap.cs
- HorizontalAlignConverter.cs
- QueuedDeliveryRequirementsMode.cs
- BinaryHeap.cs
- RandomNumberGenerator.cs
- CodeVariableReferenceExpression.cs
- StatusBarPanelClickEvent.cs
- FilterableData.cs
- AdornedElementPlaceholder.cs
- EdmComplexPropertyAttribute.cs
- CodeDelegateCreateExpression.cs
- Composition.cs
- DataGridItemEventArgs.cs
- Aggregates.cs
- Function.cs
- COAUTHINFO.cs
- SizeConverter.cs
- EmptyReadOnlyDictionaryInternal.cs
- IndexedEnumerable.cs
- UIElement.cs
- DataSetFieldSchema.cs
- SqlUtils.cs
- PathSegment.cs
- UnsafeNativeMethods.cs
- DynamicMethod.cs
- InputLangChangeRequestEvent.cs
- TdsParameterSetter.cs
- OrderPreservingMergeHelper.cs
- CodeAttributeDeclarationCollection.cs
- hebrewshape.cs
- AsyncOperation.cs
- InternalBufferOverflowException.cs
- CheckedPointers.cs
- CleanUpVirtualizedItemEventArgs.cs
- DuplexChannelFactory.cs
- GlyphElement.cs
- FunctionImportMapping.cs