Code:
/ FX-1434 / FX-1434 / 1.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
- ContentDisposition.cs
- ObjectDataSourceSelectingEventArgs.cs
- Image.cs
- WorkflowApplicationException.cs
- ChannelBuilder.cs
- EntityDataSourceView.cs
- PreservationFileWriter.cs
- SslStream.cs
- Token.cs
- EntityCollection.cs
- InputMethodStateChangeEventArgs.cs
- NativeMethods.cs
- FirstMatchCodeGroup.cs
- SharedRuntimeState.cs
- GenerateScriptTypeAttribute.cs
- JapaneseLunisolarCalendar.cs
- DecoratedNameAttribute.cs
- InvariantComparer.cs
- HWStack.cs
- Directory.cs
- DataGridDetailsPresenterAutomationPeer.cs
- FieldTemplateUserControl.cs
- HMACSHA256.cs
- SystemDropShadowChrome.cs
- TemplateControlCodeDomTreeGenerator.cs
- FontEmbeddingManager.cs
- EntityDataSourceDataSelectionPanel.cs
- SafeSystemMetrics.cs
- Hash.cs
- EventLogTraceListener.cs
- Visual3D.cs
- DbTransaction.cs
- ByteStreamMessageEncoder.cs
- SponsorHelper.cs
- ResourceAttributes.cs
- EntityDataSourceState.cs
- DefaultIfEmptyQueryOperator.cs
- EventLogWatcher.cs
- IsolatedStorageSecurityState.cs
- BrowserInteropHelper.cs
- EventlogProvider.cs
- Animatable.cs
- MonitoringDescriptionAttribute.cs
- DataObjectEventArgs.cs
- XmlSchemaIdentityConstraint.cs
- HttpRequest.cs
- DataGridViewComboBoxColumn.cs
- ConfigurationElementCollection.cs
- UserCancellationException.cs
- DbDataAdapter.cs
- UserValidatedEventArgs.cs
- ThreadStartException.cs
- WebColorConverter.cs
- SelectionEditingBehavior.cs
- ConfigXmlComment.cs
- DateTimeOffsetConverter.cs
- ConsoleCancelEventArgs.cs
- ISO2022Encoding.cs
- InertiaTranslationBehavior.cs
- WeakHashtable.cs
- _LocalDataStoreMgr.cs
- EnterpriseServicesHelper.cs
- XmlNodeList.cs
- WindowsListViewGroupSubsetLink.cs
- DataConnectionHelper.cs
- FunctionNode.cs
- _Rfc2616CacheValidators.cs
- UniqueEventHelper.cs
- RoleManagerModule.cs
- ToolStripGripRenderEventArgs.cs
- BufferBuilder.cs
- CompilerTypeWithParams.cs
- XPathItem.cs
- TransactionTraceIdentifier.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SecurityCapabilities.cs
- ErrorHandlingAcceptor.cs
- SchemaTypeEmitter.cs
- Rules.cs
- DesignTable.cs
- ToolStripPanelRenderEventArgs.cs
- ActiveXSite.cs
- TransformPatternIdentifiers.cs
- ActiveXHelper.cs
- BinHexDecoder.cs
- MdbDataFileEditor.cs
- XPathScanner.cs
- RowParagraph.cs
- LocalBuilder.cs
- ProcessModule.cs
- BindableTemplateBuilder.cs
- TransactionProxy.cs
- XmlEntityReference.cs
- TypeListConverter.cs
- DataListCommandEventArgs.cs
- SystemException.cs
- WebColorConverter.cs
- FloaterParaClient.cs
- ControlFilterExpression.cs
- RuleSetDialog.cs