コード例 #1
0
        /// <summary>
        /// Generates the offline deactivation request needed for deactivation of
        /// the license in the dashboard and deactivates the license locally.
        ///
        /// A valid offline deactivation file confirms that the license has been successfully
        /// deactivated on the user's machine.
        /// </summary>
        /// <param name="filePath">path of the file for the offline request</param>
        /// <returns>LA_OK, LA_FAIL</returns>
        public static int GenerateOfflineDeactivationRequest(string filePath)
        {
            int status;

            if (LexActivatorNative.IsWindows())
            {
                status = IntPtr.Size == 4 ? LexActivatorNative.GenerateOfflineDeactivationRequest_x86(filePath) : LexActivatorNative.GenerateOfflineDeactivationRequest(filePath);
            }
            else
            {
                status = LexActivatorNative.GenerateOfflineDeactivationRequestA(filePath);
            }
            switch (status)
            {
            case LexStatusCodes.LA_OK:
                return(LexStatusCodes.LA_OK);

            case LexStatusCodes.LA_FAIL:
                return(LexStatusCodes.LA_FAIL);

            default:
                throw new LexActivatorException(status);
            }
        }