AGENT.Contrib.Hardware.AgentButtonListener.StartListeningTo C# (CSharp) Méthode

StartListeningTo() public méthode

public StartListeningTo ( ) : void
Résultat void
		public void StartListeningTo (params AgentButton[] buttons)
		{
			foreach (var b in buttons)
			{
				StartListeningTo (b);
			}
		}

Same methods

AgentButtonListener::StartListeningTo ( AgentButton b ) : void

Usage Example

		public CombinationAgentButtonListener (AgentButtonListener listener, params AgentButton[] buttons)
		{
			if (listener == null)
				throw new ArgumentNullException ("listener");

			m_Listener = listener;

			m_ButtonToStateMap = new Hashtable();
			foreach (var b in AgentButton.Empty.GetAll ())
				m_ButtonToStateMap[b] = AgentButtonState.Up;

			listener.StartListeningTo (buttons);
			m_AgentButtonListener = OnAgentButtonListenerPressed;
			listener.OnButtonStateChange += m_AgentButtonListener;
        }