public bool Connect(string appName, int capabilities = LGLCD_APPLET_CAP_BW) { if (!LgLcdAvailable) return false; if (isConnected) return false; notifyContext = new lgLcdNotificationContext { notificationCallback = new lgLcdOnNotificationCB(OnNotify), notifyContext = IntPtr.Zero }; connectContext = new lgLcdConnectContextEx { appFriendlyName = appName, dwAppletCapabilitiesSupported = capabilities, isAutostartable = false, isPersistent = false, onNotify = notifyContext }; var val = lgLcdConnectEx(ref connectContext); isConnected = val == ERROR_SUCCESS; return isConnected; }
public bool Connect(string appName, int capabilities = LGLCD_APPLET_CAP_BW) { if (!LgLcdAvailable) { return(false); } if (isConnected) { return(false); } notifyContext = new lgLcdNotificationContext { notificationCallback = new lgLcdOnNotificationCB(OnNotify), notifyContext = IntPtr.Zero }; connectContext = new lgLcdConnectContextEx { appFriendlyName = appName, dwAppletCapabilitiesSupported = capabilities, isAutostartable = false, isPersistent = false, onNotify = notifyContext }; var val = lgLcdConnectEx(ref connectContext); isConnected = val == ERROR_SUCCESS; return(isConnected); }