private void DispatchAction(ChannelButton sender) { Channel c = sender.channel; if (File.Exists(c.GetStopFile())) { c.start(); } else { c.stop(); } // todo reload stuff }
private void LoadChannelButtons() { _channelButtons = new ChannelButton[Model.NumberOfChannels]; for (int i = 0; i < _channelButtons.Length; i++) { _channelButtons[i] = new ChannelButton(i) { IsEnabled = false }; ChannelButtonsGrid.Children.Add(_channelButtons[i]); _channelButtons[i].SetValue(Grid.ColumnProperty, i); } }
override protected void HandleData(AData data) { ChannelData messageData = (ChannelData)data; if (!_user.chatChannels.ContainsKey(messageData.ChannelId)) { Channel newChannel = Instantiate(_channelPrefab, _channelsHolder); newChannel.gameObject.SetActive(_user.CurrentChatChannel == messageData.ChannelId); newChannel.ChannelData = messageData; ChannelButton newChannelButton = Instantiate(_channelButtonPrefab, _channelButtonsHolder); newChannelButton.channelId = messageData.ChannelId; newChannelButton.channelName.text = messageData.ChannelName; newChannel.ChannelButton = newChannelButton; _user.chatChannels.Add(messageData.ChannelId, newChannel); } _user.chatChannels[messageData.ChannelId].ChannelButton.channelName.text = messageData.ChannelName; _user.chatChannels[messageData.ChannelId].SetNicknameList(messageData.UserNicknames); }
public ChannelState(ChannelButton button, int channelNumber) { _button = button; ChannelNumber = channelNumber; }