Ejemplo n.º 1
0
 public LicenseProviderAttribute(string typeName)
 {
     this.licenseProviderType = null;
     this.licenseProviderName = null;
     this.licenseProviderName = typeName;
     this.resourceType        = LicenseResourceType.File;
 }
Ejemplo n.º 2
0
 public LicenseProviderAttribute(Type type, LicenseResourceType resourceType)
 {
     this.licenseProviderType = null;
     this.licenseProviderName = null;
     this.licenseProviderType = type;
     this.resourceType        = resourceType;
 }
        /// <summary>
        /// Returns a license for the instance of the component, if one is available.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="allowExceptions"></param>
        /// <param name="resourceType"></param>
        /// <param name="typeAssembly"></param>
        /// <returns></returns>
        public override License GetLicense(Type type, Assembly typeAssembly, LicenseResourceType resourceType, bool allowExceptions)
        {
            this.typeAssembly    = typeAssembly;
            this.allowExceptions = allowExceptions;
            this.resourceType    = resourceType;
            PublicKeyLicense license = new PublicKeyLicense(this, type);

            return(license);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// When overridden in a derived class, gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception.
 /// </summary>
 /// <param name="type">A System.Type that represents the component requesting the license.</param>
 /// <param name="typeAssembly"></param>
 /// <param name="resourceType">LicenseResourceType that represents the way the client license is supplied.</param>
 /// <param name="allowExceptions">true if a System.ComponentModel.LicenseException should be thrown when the component cannot be granted a license; otherwise, false.</param>
 /// <returns>A valid OpenNETCF.ComponentModel.License.</returns>
 public abstract License GetLicense(Type type, Assembly typeAssembly, LicenseResourceType resourceType, bool allowExceptions);