1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import Cocoa
- import KMAdvertisement
- @main
- class AppDelegate: NSObject, NSApplicationDelegate {
- func applicationWillFinishLaunching(_ notification: Notification) {
- ComPDFUIConfig.initializeUIConfig();
- }
- func applicationDidFinishLaunching(_ aNotification: Notification) {
-
-
- KMAdvertisementManager.manager.initConfig(appName: .PDFReaderProMac,
- subscribeType: .unsubscribed,
- platform: .Mac)
-
- KMAdvertisementManager.manager.debug = true
- }
- func applicationWillTerminate(_ aNotification: Notification) {
-
- }
- func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
- return true
- }
- }
- extension AppDelegate : NSMenuDelegate,NSMenuItemValidation {
- func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if action == #selector(manageAcctounMenuAction) {
- return KMLightMemberManager.manager.isLogin()
- }
- if action == #selector(loginMenuItemAction) {
- return !KMLightMemberManager.manager.isLogin()
- }
- return true
- }
- }
|