Ejemplo n.º 1
0
        /// <summary>
        /// recursive worker for setting colors
        /// </summary>
        /// <param name="guiObject"></param>
        /// <param name="foreColor"></param>
        /// <param name="backColor"></param>
        /// <param name="recursive"></param>
        /// <param name="guiReset"></param>
        private void SetColorToObjectExtracted(Control guiObject, Color foreColor, Color backColor, Boolean recursive, Boolean guiReset)
        {
            try
            {
                guiObject.SetControlColors(foreColor, backColor, guiReset);

                if(recursive)
                {
                    foreach (Control subControl in guiObject.Controls)
                    { 
                      SetColorToObjectExtracted(subControl, foreColor, backColor, recursive, guiReset);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error while setting gui colors (recursive worker)", ex);
            }
        }