Exemplo n.º 1
0
        private void DispatchMessage(PluginResult.Status status, string message, bool keepCallback, string callBackId)
        {
            var pluginResult = new PluginResult(status, message)
            {
                KeepCallback = keepCallback
            };

            DispatchCommandResult(pluginResult, callBackId);
        }
Exemplo n.º 2
0
        private void DispatchResult(object result, bool sucess)
        {
            if (result is string)
            {
                result = new { Message = (string)result };
            }

            string message = result != null?JsonConvert.SerializeObject(result, JsonSettings) : null;

            PluginResult.Status status = sucess ? PluginResult.Status.OK : PluginResult.Status.ERROR;
            Debug.WriteLine("result status {0} - mesage {1}", status, message);
            DispatchCommandResult(new PluginResult(status, message));
        }
Exemplo n.º 3
0
        /// <summary>
        /// OnResume event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnResume(object sender, ActivatedEventArgs e)
        {
            if (!this.isBluetoothSettingsOpen)
            {
                return;
            }
            PhoneApplicationService service = PhoneApplicationService.Current;

            service.Activated -= this.OnResume;

            this.isBluetoothSettingsOpen = false;

            this.DetectBluetoothState(state =>
            {
                PluginResult.Status status = (state == this.requestedState) ? PluginResult.Status.OK : PluginResult.Status.ERROR;
                this.DispatchCommandResult(new PluginResult(status));
            });
        }
Exemplo n.º 4
0
        private void SendResult(string callbackId, PluginResult.Status status)
        {
            var pluginResult = new PluginResult(status);

            DispatchCommandResult(pluginResult, callbackId);
        }
Exemplo n.º 5
0
 public void dispatchResult(PluginResult.Status status, string message)
 {
     DispatchCommandResult(new PluginResult(status, message));
 }