Пример #1
0
        /// <summary>
        /// Remove an app from the Pebble, using an App instance retrieved from the Appbank.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="async">When true, this returns null immediately.  Otherwise it waits for the event and sends
        /// the appropriate AppbankInstallMessageEventArgs.</param>
        /// <returns></returns>
        public async Task <AppbankInstallResponse> RemoveAppAsync(AppBank.App app)
        {
            var msg = Util.CombineArrays(new byte[] { 2 },
                                         Util.GetBytes(app.ID),
                                         Util.GetBytes(app.Index));

            return(await SendMessageAsync <AppbankInstallResponse>(Endpoint.AppManager, msg));
        }
Пример #2
0
        /// <summary>
        /// Remove an app from the Pebble, using an App instance retrieved from the Appbank.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="async">When true, this returns null immediately.  Otherwise it waits for the event and sends
        /// the appropriate AppbankInstallMessageEventArgs.</param>
        /// <returns></returns>
        public AppbankInstallMessageEventArgs RemoveApp(AppBank.App app, bool async = false)
        {
            var msg = Util.Pack("!bII", 2, app.ID, app.Index);

            sendMessage(Endpoints.APP_MANAGER, msg);
            if (!async)
            {
                var wait = new EndpointSync <AppbankInstallMessageEventArgs>(this, Endpoints.APP_MANAGER);
                return(wait.WaitAndReturn());
            }
            else
            {
                return(null);
            }
        }