コード例 #1
0
        /// <summary>
        /// Adds a NeoPixel to the chain
        /// </summary>
        /// <param name="px">NeoPixel to be added</param>
        /// <returns>index of where the NeoPixel was added to</returns>
        public int Add(NeoPixel px)
        {
            int i = pixels.Add(px);

            if (i < 0)
            {
                throw new Exception("Add Failed");
            }
            return(i);
        }
コード例 #2
0
 /// <summary>
 /// Removes a NeoPixel instance from the chain
 ///
 /// Note: this only searches by reference
 /// </summary>
 /// <param name="px">NeoPixel instance to be removed</param>
 public void Remove(NeoPixel px)
 {
     pixels.Remove(px);
 }
コード例 #3
0
 /// <summary>
 /// Inserts a NeoPixel into the chain at a specific index.
 /// </summary>
 /// <param name="index">index of the insertion</param>
 /// <param name="px">NeoPixel to be inserted</param>
 public void Insert(int index, NeoPixel px)
 {
     pixels.Insert(index, px);
 }
コード例 #4
0
 /// <summary>
 /// Find where a specific NeoPixel instance is in the chain
 ///
 /// Note: this is only a search by reference
 /// </summary>
 /// <param name="px">NeoPixel instance to look for</param>
 /// <returns>index of the NeoPixel instance in the chain, or negative if it is not found</returns>
 public int IndexOf(NeoPixel px)
 {
     return(pixels.IndexOf(px));
 }
コード例 #5
0
 /// <summary>
 /// Whether or not the chain contains a reference to a NeoPixel instance
 ///
 /// Note: this is only a search by reference
 /// </summary>
 /// <param name="px">NeoPixel instance to check</param>
 /// <returns>whether or not the chain contains a reference to a NeoPixel instance</returns>
 public bool Contains(NeoPixel px)
 {
     return(pixels.Contains(px));
 }