コード例 #1
0
ファイル: Connection.cs プロジェクト: HaKDMoDz/GNet
        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;
        }
コード例 #2
0
        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);
        }