Example #1
0
        public void AddHuePicker( HuePicker huePicker )
        {
            if ( m_HuePickers == null )
                return;

            if ( m_HuePickers.Count >= m_HuePickerCap )
            {
                Console.WriteLine( "Client: {0}: Exceeded hue picker cap, disconnecting...", this );
                Dispose();
            }
            else
            {
                m_HuePickers.Add( huePicker );
            }
        }
Example #2
0
 public DisplayHuePicker( HuePicker huePicker )
     : base(0x95, 9)
 {
     m_Stream.Write( (int) huePicker.Serial );
     m_Stream.Write( (short) 0 );
     m_Stream.Write( (short) huePicker.ItemID );
 }
Example #3
0
        public void AddHuePicker( HuePicker huePicker )
        {
            if ( m_HuePickers == null ) {
                m_HuePickers = new List<HuePicker>();
            }

            if ( m_HuePickers.Count < m_HuePickerCap ) {
                m_HuePickers.Add( huePicker );
            } else {
                WriteConsole( "Exceeded hue picker cap, disconnecting..." );
                Dispose();
            }
        }
Example #4
0
 public void RemoveHuePicker( HuePicker huePicker )
 {
     if ( m_HuePickers != null ) {
         m_HuePickers.Remove( huePicker );
     }
 }
Example #5
0
 public bool SendHuePicker( HuePicker p, bool throwOnOffline )
 {
     if ( m_NetState != null )
     {
         p.SendTo( m_NetState );
         return true;
     }
     else if ( throwOnOffline )
     {
         throw new MobileNotConnectedException( this, "Hue picker could not be sent." );
     }
     else
     {
         return false;
     }
 }
Example #6
0
 public bool SendHuePicker( HuePicker p )
 {
     return SendHuePicker( p, false );
 }
Example #7
0
        public void RemoveHuePicker( HuePicker huePicker )
        {
            if ( m_HuePickers == null )
                return;

            m_HuePickers.Remove( huePicker );
        }
Example #8
0
        public bool SendHuePicker( HuePicker p, bool throwOnOffline = false )
        {
            if ( m_Client == null )
            {
                if ( throwOnOffline )
                    throw new MobileNotConnectedException( this, "Hue picker could not be sent." );

                return false;
            }

            p.SendTo( m_Client );
            return true;
        }
		public void AddHuePicker( HuePicker huePicker )
		{
			if ( m_HuePickers == null )
				m_HuePickers = new HuePickerCollection();

			if ( m_HuePickers.Count >= m_HuePickerCap )
			{
				log.WarnFormat("Client: {0}: Exceeded hue picker cap, disconnecting...",
							   this);
				Dispose();
			}
			else
			{
				m_HuePickers.Add( huePicker );
			}
		}