Code:
/ DotNET / DotNET / 8.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
- AssemblyName.cs
- EncoderParameter.cs
- ConditionCollection.cs
- HtmlInputHidden.cs
- ListSourceHelper.cs
- TableLayoutSettings.cs
- FramingChannels.cs
- UserInitiatedNavigationPermission.cs
- ProxyWebPartConnectionCollection.cs
- AtomicFile.cs
- MessageLogger.cs
- StringConcat.cs
- CompoundFileStreamReference.cs
- PropertyInformationCollection.cs
- RectangleHotSpot.cs
- ErrorTableItemStyle.cs
- ValueExpressions.cs
- DefaultTextStore.cs
- ResXFileRef.cs
- EnvironmentPermission.cs
- XPathNodeList.cs
- DisplayInformation.cs
- path.cs
- XmlDocumentType.cs
- DictionaryBase.cs
- ProjectionCamera.cs
- DataGridViewSelectedRowCollection.cs
- BitStack.cs
- InfiniteTimeSpanConverter.cs
- HandlerWithFactory.cs
- GridViewColumnHeader.cs
- ClientConvert.cs
- _OverlappedAsyncResult.cs
- IntSecurity.cs
- ListViewDeletedEventArgs.cs
- PublisherMembershipCondition.cs
- HttpStreams.cs
- ListViewInsertEventArgs.cs
- RequestCache.cs
- ScopelessEnumAttribute.cs
- RequestSecurityTokenForGetBrowserToken.cs
- PropertyInformationCollection.cs
- BaseParaClient.cs
- PerformanceCounterNameAttribute.cs
- ParallelForEach.cs
- WriteFileContext.cs
- TemplateColumn.cs
- NotCondition.cs
- PathFigureCollection.cs
- DataGridViewCellStyleConverter.cs
- OverlappedAsyncResult.cs
- IndexOutOfRangeException.cs
- SapiRecoContext.cs
- TextViewBase.cs
- ObjectQueryExecutionPlan.cs
- XmlSchemaAnnotation.cs
- HtmlInputImage.cs
- SurrogateEncoder.cs
- ParameterModifier.cs
- ToolboxDataAttribute.cs
- StreamResourceInfo.cs
- ColumnMap.cs
- CodeIdentifier.cs
- Utils.cs
- NetworkInformationPermission.cs
- documentsequencetextpointer.cs
- MexBindingElement.cs
- CodePrimitiveExpression.cs
- TextEvent.cs
- ParameterToken.cs
- ListViewTableCell.cs
- SpecialFolderEnumConverter.cs
- SimpleWorkerRequest.cs
- ListControl.cs
- DllNotFoundException.cs
- Query.cs
- ConfigurationElement.cs
- EntitySetBaseCollection.cs
- DSACryptoServiceProvider.cs
- LineServicesRun.cs
- PropertyGridCommands.cs
- GridViewEditEventArgs.cs
- DataTableMappingCollection.cs
- IntSecurity.cs
- Utils.cs
- TraceFilter.cs
- Lasso.cs
- ProgressBarRenderer.cs
- AssemblyAttributesGoHere.cs
- CodeLabeledStatement.cs
- WebPartsPersonalization.cs
- DataGridViewCellCollection.cs
- HyperLinkField.cs
- CmsUtils.cs
- SortExpressionBuilder.cs
- FileDialogCustomPlacesCollection.cs
- ToolStripSystemRenderer.cs
- DropShadowBitmapEffect.cs
- DesignerImageAdapter.cs
- CookielessData.cs