Example #1
0
        /// <summary>
        /// Override constructor to instantiate the Licensing Manager and
        /// point it to an object that it's the running executable.
        /// </summary>
        /// <remarks>
        /// This constructor is useful when running an application and calling
        /// Scutex via a CCW (COM Callable Wrapper) and the executing assembly
        /// (i.e. Access) does not contain the security attribute.
        /// </remarks>
        /// <param name="instance">
        /// Reference to an object were the required attributes can be located
        /// </param>
        public LicensingManager(object instance)
        {
            this.instance = instance;

            Bootstrapper.Configure();

            InterfaceInteraction = new TrialInterfaceInteraction();

            hashingProvider = ObjectLocator.GetInstance<IHashingProvider>();
            encodingService = ObjectLocator.GetInstance<IEncodingService>();
            licenseManagerService = ObjectLocator.GetInstance<ILicenseManagerService>();
            _clientLicenseService = ObjectLocator.GetInstance<IClientLicenseService>();
            _comBypassProvider = ObjectLocator.GetInstance<IComBypassProvider>();
            _registerService = ObjectLocator.GetInstance<IRegisterService>();

            SetCriticalVerificationData();
            VerifyLicensingAssembly();
        }
Example #2
0
        /// <summary>
        /// Override constructor to instantiate the Licensing Manager and
        /// set options for its use.
        /// </summary>
        /// <remarks>
        /// This constructor is useful when calling Scutex from an instance
        /// where there is no running application or objects that can be
        /// used to run a attribute check. For example a .Net Component or
        /// Control.
        /// </remarks>
        /// <param name="instance">
        /// Reference to an object were the required attributes can be located
        /// </param>
        /// <param name="options">
        /// Options to override the default Licensing Manager behavior
        /// </param>
        public LicensingManager(object instance, LicensingManagerOptions options)
        {
            if (options != null)
            {
                _options     = options;
                _killOnError = _options.KillOnError;
            }

            this.instance = instance;

            Bootstrapper.Configure();

            InterfaceInteraction = new TrialInterfaceInteraction();

            hashingProvider       = ObjectLocator.GetInstance <IHashingProvider>();
            encodingService       = ObjectLocator.GetInstance <IEncodingService>();
            licenseManagerService = ObjectLocator.GetInstance <ILicenseManagerService>();
            _clientLicenseService = ObjectLocator.GetInstance <IClientLicenseService>();
            _comBypassProvider    = ObjectLocator.GetInstance <IComBypassProvider>();
            _registerService      = ObjectLocator.GetInstance <IRegisterService>();

            SetCriticalVerificationData();
            VerifyLicensingAssembly();
        }