コード例 #1
0
 private void MessageUpdated(object sender, Client.MessageUpdatedEventArgs e)
 {
     if (e.DataType.Equals(typeof(SlotCollection)))
      {
     _slotCollection = _fahClient.GetMessage<SlotCollection>();
     foreach (var slot in _slotCollection)
     {
        _fahClient.SendCommand(String.Format(CultureInfo.InvariantCulture, Constants.FahClientSlotOptions, slot.Id));
     }
     _settingsModel.RefreshSlots(_slotCollection);
      }
      else if (e.DataType.Equals(typeof(SlotOptions)))
      {
     var options = _fahClient.GetMessage<SlotOptions>();
     if (options.MachineId.HasValue)
     {
        var slot = _slotCollection.FirstOrDefault(x => x.Id == options.MachineId);
        if (slot != null)
        {
           slot.SlotOptions = options;
           _settingsModel.RefreshSlots(_slotCollection);
        }
     }
      }
 }
コード例 #2
0
 private void ConnectedChanged(object sender, Client.ConnectedChangedEventArgs e)
 {
     _settingsView.SetConnectButtonEnabled(!e.Connected);
      if (e.Connected)
      {
     _fahClient.SendCommand("slot-info");
      }
 }