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
- CalendarBlackoutDatesCollection.cs
- HttpProfileGroupBase.cs
- ObjectDataSource.cs
- TextReturnReader.cs
- VirtualizingPanel.cs
- StylusPointDescription.cs
- FormView.cs
- Validator.cs
- SelectionItemPatternIdentifiers.cs
- ContainerParaClient.cs
- ParenthesizePropertyNameAttribute.cs
- X509InitiatorCertificateServiceElement.cs
- DesignerCategoryAttribute.cs
- X509Certificate.cs
- WindowsGraphics.cs
- EventRecord.cs
- WebPartActionVerb.cs
- NameTable.cs
- CalendarDateRangeChangingEventArgs.cs
- OutputScopeManager.cs
- DataGridColumnEventArgs.cs
- TreeBuilder.cs
- Rectangle.cs
- ClonableStack.cs
- ZipIOExtraFieldZip64Element.cs
- HtmlEncodedRawTextWriter.cs
- Rfc4050KeyFormatter.cs
- SourceFilter.cs
- TargetConverter.cs
- FormatSettings.cs
- DispatcherFrame.cs
- Byte.cs
- GridViewRowCollection.cs
- InputLanguageManager.cs
- BitStream.cs
- TextTreeExtractElementUndoUnit.cs
- ModuleBuilder.cs
- SelectionItemPatternIdentifiers.cs
- SoapIgnoreAttribute.cs
- RijndaelManaged.cs
- XmlQueryContext.cs
- ActivityDesignerHighlighter.cs
- RowToParametersTransformer.cs
- RotateTransform3D.cs
- DocumentGridPage.cs
- IdentifierElement.cs
- TableDetailsCollection.cs
- TextTreeInsertElementUndoUnit.cs
- Misc.cs
- SmtpNetworkElement.cs
- QilValidationVisitor.cs
- Schema.cs
- SslStream.cs
- EntityKeyElement.cs
- WebPartsPersonalizationAuthorization.cs
- EdmSchemaError.cs
- ProfileGroupSettingsCollection.cs
- XmlSchemaSubstitutionGroup.cs
- OdbcConnectionHandle.cs
- DesignerForm.cs
- ClientConvert.cs
- SetState.cs
- DataListItemCollection.cs
- ColumnMapCopier.cs
- SystemThemeKey.cs
- AllMembershipCondition.cs
- CssClassPropertyAttribute.cs
- FontEmbeddingManager.cs
- KnownBoxes.cs
- ListViewPagedDataSource.cs
- TableProvider.cs
- Pen.cs
- WebPartAddingEventArgs.cs
- WebRequest.cs
- LicFileLicenseProvider.cs
- Scripts.cs
- LayoutEditorPart.cs
- CodeCommentStatementCollection.cs
- ObjectConverter.cs
- ToolStripDropDown.cs
- _UriTypeConverter.cs
- NativeBuffer.cs
- ColorContextHelper.cs
- Camera.cs
- HyperlinkAutomationPeer.cs
- RotateTransform.cs
- DataRowView.cs
- SqlInternalConnectionSmi.cs
- CharacterBuffer.cs
- FolderBrowserDialogDesigner.cs
- DataColumnMapping.cs
- DataGridLinkButton.cs
- GridViewDeletedEventArgs.cs
- Propagator.JoinPropagator.cs
- DrawListViewColumnHeaderEventArgs.cs
- Debugger.cs
- AsyncPostBackErrorEventArgs.cs
- RuntimeArgumentHandle.cs
- XmlIlGenerator.cs
- TimeSpanOrInfiniteValidator.cs