Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / LicenseProviderAttribute.cs / 1305376 / 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
- DataGridAutoFormatDialog.cs
- Perspective.cs
- PagerSettings.cs
- PixelFormatConverter.cs
- EncryptedPackage.cs
- regiisutil.cs
- UnsafeNativeMethods.cs
- DataBindingHandlerAttribute.cs
- AnnouncementSendsAsyncResult.cs
- DataColumnMappingCollection.cs
- TextServicesProperty.cs
- FactoryGenerator.cs
- RequestedSignatureDialog.cs
- WMIGenerator.cs
- SkinBuilder.cs
- ScrollBarAutomationPeer.cs
- MouseGestureValueSerializer.cs
- Socket.cs
- ListViewUpdatedEventArgs.cs
- SqlBuilder.cs
- BitmapEffectGeneralTransform.cs
- WorkflowClientDeliverMessageWrapper.cs
- ParallelTimeline.cs
- RtfToken.cs
- FontStyle.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- PipelineDeploymentState.cs
- KnownTypeDataContractResolver.cs
- Timer.cs
- ErrorStyle.cs
- BuildProviderCollection.cs
- ToolStripPanel.cs
- JpegBitmapEncoder.cs
- HuffmanTree.cs
- DirtyTextRange.cs
- OdbcConnectionString.cs
- ControlBindingsCollection.cs
- DSASignatureFormatter.cs
- Profiler.cs
- MenuCommandsChangedEventArgs.cs
- ValidationHelper.cs
- HostingEnvironmentException.cs
- Instrumentation.cs
- SourceInterpreter.cs
- DPAPIProtectedConfigurationProvider.cs
- EntityTypeBase.cs
- DynamicValueConverter.cs
- WindowsListViewSubItem.cs
- StructuredType.cs
- ProgressiveCrcCalculatingStream.cs
- Comparer.cs
- ComponentDispatcher.cs
- StatusBarAutomationPeer.cs
- odbcmetadatacolumnnames.cs
- WindowInteractionStateTracker.cs
- MaxValueConverter.cs
- XmlCustomFormatter.cs
- DelayLoadType.cs
- ProgressChangedEventArgs.cs
- DeferredReference.cs
- TakeOrSkipWhileQueryOperator.cs
- DbProviderConfigurationHandler.cs
- ProcessHostMapPath.cs
- PropertyBuilder.cs
- ModelItemDictionaryImpl.cs
- Stopwatch.cs
- SrgsOneOf.cs
- BitmapDownload.cs
- UserPreferenceChangingEventArgs.cs
- XamlPathDataSerializer.cs
- DispatchChannelSink.cs
- OdbcReferenceCollection.cs
- XmlSchemaSubstitutionGroup.cs
- PresentationSource.cs
- _CookieModule.cs
- ExtensionDataReader.cs
- LicFileLicenseProvider.cs
- _LocalDataStore.cs
- ListBoxItem.cs
- WindowsServiceElement.cs
- ClientFormsIdentity.cs
- Helper.cs
- XmlSchemaExternal.cs
- Graphics.cs
- PrintDocument.cs
- FlowchartStart.xaml.cs
- XamlInterfaces.cs
- AppSettingsExpressionBuilder.cs
- UpdateTracker.cs
- MULTI_QI.cs
- PenContext.cs
- EntitySetDataBindingList.cs
- MessageQueuePermission.cs
- DetailsViewInsertedEventArgs.cs
- ProcessHostFactoryHelper.cs
- DatagridviewDisplayedBandsData.cs
- DataGridViewCellParsingEventArgs.cs
- StringDictionaryWithComparer.cs
- RawStylusInputReport.cs
- PhysicalAddress.cs