/// <summary>
 /// Event: Menu -> Color -> Value Text Box
 /// Updates the current drape color with the value entered in the Color Value Text Box, when Enter is pressed.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">Empty event data.</param>
 private void EventMenuMainColorValueTextBoxKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Return)
     {
         FromString.IfHtmlColor(
             this.menuMainColorValueTextBox.Text,
             value =>
         {
             this.SetDrapeColor(value);
             e.SuppressKeyPress = true;
         },
             null);
     }
 }
        /// <summary>
        /// Loads the drape color, opacity, and focus areas from a CinemaDrape configuration file.
        /// </summary>
        /// <param name="filePath">The location of the configuration file.</param>
        /// <param name="loadAreas">True to load the focus areas, false otherwise.</param>
        private void LoadLayout(string filePath, bool loadAreas)
        {
            VerySimpleIni iniFile = string.IsNullOrEmpty(filePath) ?
                                    new VerySimpleIni(Properties.Resources.StringDefaultSettingsFile, Application.ExecutablePath, Application.CompanyName, Application.ProductName, false) :
                                    new VerySimpleIni(filePath, true);

            if (iniFile.Load())
            {
                FromString.IfHtmlColor(iniFile.GetValue(Properties.Resources.StringSettingsDrapeColor), this.SetDrapeColor, null);

                // Read the drape opacity as int (and support the legacy double format)
                string drapeOpacityStr = iniFile.GetValue(Properties.Resources.StringSettingsDrapeOpacity);
                FromString.IfInt(
                    drapeOpacityStr,
                    (value) => { this.SetDrapeOpacity(this.ConvertOpacity(value)); },
                    (error) => { FromString.IfDouble(drapeOpacityStr, this.SetDrapeOpacity, null); });

                string peekOpacityStr = iniFile.GetValue(Properties.Resources.StringSettingsPeekOpacity);
                FromString.IfInt(
                    peekOpacityStr,
                    (value) => { this.peekOpacity = this.ConvertOpacity(value); },
                    (error) => { FromString.IfDouble(peekOpacityStr, (value) => { this.peekOpacity = value; }, null); });

                this.hotKeyString = iniFile.GetValue(Properties.Resources.StringSettingsHotkey);

                FromString.IfBool(iniFile.GetValue(Properties.Resources.StringSettingsAutoRestoreAreas), value => { this.autoRestoreAreas = value; }, null);

                if (loadAreas || this.autoRestoreAreas)
                {
                    this.DeleteAllFocusAreas();

                    string focusRectString;
                    while (!string.IsNullOrEmpty(focusRectString = iniFile.GetValue(Properties.Resources.StringSettingsFocusArea)))
                    {
                        FromString.IfRectangle(focusRectString, this.AddNewFocusArea, null);
                    }
                }

                FromString.IfBool(iniFile.GetValue(Properties.Resources.StringSettingsShowQuickStart), value => { this.quickStartForm.ShowAtStartupCheckBox.Checked = value; }, null);
                FromString.IfPoint(iniFile.GetValue(Properties.Resources.StringSettingsQuickStartLocation), value => { this.quickStartForm.Location = value; }, null);
            }
        }