Ejemplo n.º 1
0
        protected virtual void RaiseExecuteCommand(AudioCommandEventArgs.Commands command, double value)
        {
            if (this.silent)
            {
                return;
            }

            ExecuteCommand?.Invoke(this, new AudioCommandValueEventArgs(command, value));
        }
Ejemplo n.º 2
0
        private void OnCommandTapped(object sender, TappedRoutedEventArgs e)
        {
            var command = ((FrameworkElement)sender).DataContext as IDialogCommand;

            if (null != command)
            {
                commandDispatcher.ExecuteCommand(command);
                ExecuteCommand?.Invoke(this, new DialogCommandExecuteEventArgs(command));
            }
        }
Ejemplo n.º 3
0
        }///

        async void SubscribeDeviceReading()
        {
            // initialize status
            GattCommunicationStatus status = GattCommunicationStatus.Unreachable;
            var cccdValue = GattClientCharacteristicConfigurationDescriptorValue.None;

            if (GlucometerCharacteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Indicate))
            {
                cccdValue = GattClientCharacteristicConfigurationDescriptorValue.Indicate;
            }
            else if (GlucometerCharacteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Notify))
            {
                cccdValue = GattClientCharacteristicConfigurationDescriptorValue.Notify;
            }

            // BT_Code: Must write the CCCD in order for server to send indications.
            // We receive them in the ValueChanged event handler.
            status = await GlucometerCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(cccdValue);

            if (status == GattCommunicationStatus.Success)
            {
                MainPage.mainPage.commChannel.SendMessageToMCC(string.Format(CommunicationCommands.GLUCORESULTRESSTATUS,
                                                                             "Successfully subscribed."));
                //AddValueBPMeasureChangedHandler();
                MainPage.TestresultModel.NotifyStatusMessage?.Invoke("Successfully subscribed  value  changes");
            }
            else
            {
                MainPage.mainPage.commChannel.SendMessageToMCC(string.Format(CommunicationCommands.GLUCORESULTRESSTATUS,
                                                                             $"Error registering for value changes: { status}"));
                MainPage.TestresultModel.NotifyStatusMessage?.Invoke($"Error registering for value changes: {status}", 1);
            }

            GlucometerCharacteristic.ValueChanged += Characteristic_ValueChanged;
            MainPage.TestresultModel.DeviceConnectedTime(DeviceTypesenums.GLUCOMONITOR, DateTime.Now.ToString(), true);
            Execute?.Invoke();
        }
Ejemplo n.º 4
0
 /// <summary>
 ///     对当前命令目标执行 <see cref="RelayCommand" />。
 /// </summary>
 /// <param name="parameter">
 ///     命令使用的数据。如果不需要向命令传递数据,则可将此对象设置为 null。
 /// </param>
 public void Execute(object parameter)
 {
     ExecuteCommand?.Invoke(parameter.SafeCast <T>());
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     对当前命令目标执行 <see cref="RelayCommand" />。
 /// </summary>
 /// <param name="parameter">
 ///     命令使用的数据。如果不需要向命令传递数据,则可将此对象设置为 null。
 /// </param>
 public void Execute(object parameter)
 {
     ExecuteCommand?.Invoke();
 }
Ejemplo n.º 6
0
 internal async Task DoExecuteCommand(ExecuteCommandEventArgs args)
 {
     ExecuteCommand?.Invoke(this, args);
     await Task.CompletedTask.ConfigureAwait(false);
 }
 public void Execute(object parameter)
 {
     ExecuteCommand.Invoke((T)parameter);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
        public void Execute(object parameter)
        {
            var commandValue = (T)parameter;

            ExecuteCommand?.Invoke(commandValue);
        }
Ejemplo n.º 9
0
 private void OnExecuteCommand(IUndoCommand command)
 {
     ExecuteCommand?.Invoke(command);
 }