context: //    This file is part of QTTabBar, a shell extension for Microsoft
  //    Windows Explorer.
  //    Copyright (C) 2007-2010  Quizo, Paul Accisano
  //
  //    QTTabBar is free software: you can redistribute it and/or modify
  //    it under the terms of the GNU General Public License as published by
  //    the Free Software Foundation, either version 3 of the License, or
  //    (at your option) any later version.
  //
  //    QTTabBar is distributed in the hope that it will be useful,
  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  //    GNU General Public License for more details.
  //
  //    You should have received a copy of the GNU General Public License
  //    along with QTTabBar.  If not, see <http://www.gnu.org/licenses/>.
  
  using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Diagnostics;
  using System.Drawing;
  using System.IO;
  using System.Linq;
  using System.Media;
  using System.Windows.Forms;
  using System.Windows.Forms.VisualStyles;
  using Microsoft.Win32;
  using QTPlugin;
  using QTTabBarLib.Interop;
  using ContentAlignment = System.Drawing.ContentAlignment;
  
  namespace QTTabBarLib {
      internal sealed class OptionsDialog : Form {
          private static int[] arrSpecialFolderCSIDLs;
          private static string[] arrSpecialFolderDipNms;
          private Button btnActTxtClr;
          private Button btnAdd_NoCapture;
          private Button btnAddImgExt;
          private Button btnAddSep_app;
          private Button btnAddSep_Grp;
          private Button btnAddSpcFol_Grp;
          private Button btnAddSpcFol_NoCapture;
          private Button btnAddTextExt;
          private Button btnAddToken_Arg;
          private Button btnAddToken_Wrk;
          private Button btnAddVFolder_app;
          private Button btnAlternate_Default;
          private Button btnAlternateColor;
          private Button btnAlternateColor_Text;
          private Button btnApply;
          private Button btnBFD_app;
          private Button btnBrowseAction_BarDblClck;
          private Button btnBrowsePlugin;
          private Button btnBrowsePluginLang;
          private Button btnCancel;
          private Button btnCheckUpdates;
          private Button btnClearRecentFile;
          private Button btnCopyKeys;
          private Button btnDefaultImgExt;
          private Button btnDefaultTextExt;
          private Button btnDefTxtClr;
          private Button btnDelImgExt;
          private Button btnDelTextExt;
          private Button btnDown_app;
          private Button btnDown_Grp;
          private Button btnExportSettings;
          private Button btnHiliteClsc;
          private Button btnHistoryClear;
          private Button btnInactTxtClr;
          private Button btnLangBrowse;
          private Button btnMinus_app;
          private Button btnMinus_Grp;
          private Button btnOFD_app;
          private Button btnOFD_NoCapture;
          private Button btnOK;
          private Button btnPayPal;
          private Button btnPlus_app;
          private Button btnPlus_Grp;
          private Button btnPreviewFont;
          private Button btnPreviewFontDefault;
          private Button btnRebarImage;
          private Button btnRemove_NoCapture;
          private Button btnShadowAct;
          private Button btnShadowIna;
          private Button btnStartUpGrp;
          private Button btnTabFont;
          private Button btnTabImage;
          private Button btnToolBarBGClr;
          private Button btnUp_app;
          private Button btnUp_Grp;
          private FormMethodInvoker callBack;
          private CheckBox chbActivateNew;
          private CheckBox chbAlternateColor;
          private CheckBox chbAlwaysShowHeader;
          private CheckBox chbAutoSubText;
          private CheckBox chbAutoUpdate;
          private CheckBox chbBlockProcess;
          private CheckBox chbBoldActv;
          private CheckBox chbBSUpOneLvl;
          private CheckBox chbCloseWhenGroup;
          private CheckBox chbCursorLoop;
          private CheckBox chbDD;
          private CheckBox chbDontOpenSame;
          private CheckBox chbDriveLetter;
          private CheckBox chbF2Selection;
          private CheckBox chbFolderIcon;
          private CheckBox chbFoldrTree;
          private CheckBox chbForceSysListView;
          private CheckBox chbGridLine;
          private CheckBox chbGroupKey;
          private CheckBox chbHideMenu;
          private CheckBox chbHolizontalScroll;
          private CheckBox chbNavBtn;
          private CheckBox chbNCADblClck;
          private CheckBox chbNeverCloseWindow;
          private CheckBox chbNeverCloseWndLocked;
          private CheckBox chbNoFulRowSelect;
          private CheckBox chbNoHistory;
          private CheckBox chbNoTabFromOuteside;
          private CheckBox chbPlaySound;
          private CheckBox chbPreviewInfo;
          private CheckBox chbPreviewMode;
          private CheckBox chbRebarBGImage;
          private CheckBox chbRemoveOnSeparate;
          private CheckBox chbRestoreClosed;
          private CheckBox chbRestoreLocked;
          private CheckBox chbSaveExecuted;
          private CheckBox chbSelectWithoutExt;
          private CheckBox chbSendToTray;
          private CheckBox chbSendToTrayOnMinimize;
          private CheckBox chbShowPreview;
          private CheckBox chbShowTooltip;
          private CheckBox chbSubDirTip;
          private CheckBox chbSubDirTipMode;
          private CheckBox chbSubDirTipModeFile;
          private CheckBox chbSubDirTipModeHidden;
          private CheckBox chbSubDirTipModeSystem;
          private CheckBox chbSubDirTipOnTab;
          private CheckBox chbSubDirTipPreview;
          private CheckBox chbTabCloseBtnAlt;
          private CheckBox chbTabCloseBtnHover;
          private CheckBox chbTabCloseButton;
          private CheckBox chbTabSwitcher;
          private CheckBox chbTabTitleShadow;
          private CheckBox chbToolbarBGClr;
          private CheckBox chbTreeShftWhlTab;
          private CheckBox chbUserAppKey;
          private CheckBox chbUseTabSkin;
          private CheckBox chbWhlChangeView;
          private CheckBox chbWhlClick;
          private CheckBox chbWndRestrAlpha;
          private CheckBox chbWndUnresizable;
          private CheckBox chbX1X2;
          private ColumnHeader clmKeys_Action;
          private ColumnHeader clmKeys_Key;
          private ColumnHeader clmnHeader_NoCapture;
          private ComboBox cmbActvClose;
          private ComboBox cmbBGDblClick;
          private ComboBox cmbImgExts;
          private ComboBox cmbMenuRenderer;
          private ComboBox cmbMultiRow;
          private ComboBox cmbNavBtn;
          private ComboBox cmbNewTabLoc;
          private ComboBox cmbRebarBGImageMode;
          private ComboBox cmbSpclFol_Grp;
          private ComboBox cmbSpclFol_NoCapture;
          private ComboBox cmbTabDblClck;
          private ComboBox cmbTabSizeMode;
          private ComboBox cmbTabTextAlignment;
          private ComboBox cmbTabWhlClck;
          private ComboBox cmbTextExts;
          private ComboBox cmbWhlClick;
          private ContextMenuStrip cmsAddToken;
          private static bool fInitialized;
          private bool fNowListViewItemEditing;
          private bool fNowTreeNodeEditing;
          private Font fntStartUpGroup;
          private bool fSuppressTextChangeEvent_Group;
          private bool fSuppressTextChangeEvent_UserApps;
          private int iComboBoxTextPreview;
          private int iConboBoxImagPreview;
          private Label lblAction_BarDblClick;
          private Label lblActvClose;
          private Label lblBGDblClik;
          private Label lblGroupKey;
          private Label lblLang;
          private Label lblMenuRenderer;
          private Label lblMultiRows;
          private Label lblNetworkTimeOut;
          private Label lblNewTabLoc;
          private Label lblPluginLang;
          private Label lblPreviewHeight;
          private Label lblPreviewWidth;
          private Label lblSep;
          private Label lblTabDblClk;
          private Label lblTabFont;
          private Label lblTabHeight;
          private Label lblTabSizeTitle;
          private Label lblTabTextAlignment;
          private Label lblTabTxtClr;
          private Label lblTabWFix;
          private Label lblTabWhlClk;
          private Label lblTabWidth;
          private Label lblTabWMax;
          private Label lblTabWMin;
          private Label lblUserApps_Args;
          private Label lblUserApps_Key;
          private Label lblUserApps_Path;
          private Label lblUserApps_Working;
          private LinkLabel lblVer;
          private ListView listView_NoCapture;
          private ListViewEx listViewKeyboard;
          private List<PluginAssembly> lstPluginAssembliesUserAdded = new List<PluginAssembly>();
          private const int MAX_PATH = 260;
          private static MenuItemArguments MIA_GROUPSEP;
          private NumericUpDown nudMaxRecentFile;
          private NumericUpDown nudMaxUndo;
          private NumericUpDown nudNetworkTimeOut;
          private NumericUpDown nudPreviewMaxHeight;
          private NumericUpDown nudPreviewMaxWidth;
          private NumericUpDown nudTabHeight;
          private NumericUpDown nudTabWidth;
          private NumericUpDown nudTabWidthMax;
          private NumericUpDown nudTabWidthMin;
          private PluginManager pluginManager;
          private PluginView pluginView;
          private PropertyGrid propertyGrid1;
          private static string RES_REMOVEPLGIN;
          private static string[] ResOpt;
          private static string[] ResOpt_DropDown;
          private static string[] ResOpt_Genre;
          private StringFormat sfPlugins;
          private TabControl tabControl1;
          private TabImageSetting tabImageSetting;
          private TabPage tabPage1_Gnrl;
          private TabPage tabPage2_Tabs;
          private TabPage tabPage3_Wndw;
          private TabPage tabPage4_View;
          private TabPage tabPage5_Grps;
          private TabPage tabPage6_Apps;
          private TabPage tabPage7_Plug;
          private TabPage tabPage8_Keys;
          private TabPage tabPage9_Misc;
          private TabPage tabPageA_Path;
          private TextBox tbArgs;
          private TextBox tbGroupKey;
          private TextBox tbPath;
          private TextBox tbRebarImagePath;
          private TextBox tbTabImagePath;
          private TextBox tbUserAppKey;
          private TextBox tbWorking;
          private const string TEXT_EXT_DEFVAL_IMG = "(Image & movie file)";
          private const string TEXT_EXT_DEFVAL_TXT = "(Text file)";
          private const string TEXT_ONW_DEFVAL = "Enter path";
          private const string TEXT_SEPDISPLAY = "----------- Separator -----------";
          private TextBox textBoxAction_BarDblClck;
          private TextBox textBoxLang;
          private TextBox textBoxPluginLang;
          private TreeNode tnGroupsRoot;
          private TreeNode tnRoot_UserApps;
          private TreeView treeViewGroup;
          private TreeView treeViewUserApps;
  
          public OptionsDialog(PluginManager pluginManager, FormMethodInvoker callBack) {
              InitializeStaticFields();
              this.pluginManager = pluginManager;
              this.callBack = callBack;
              InitializeComponent();
              tabImageSetting = new TabImageSetting();
              propertyGrid1.SelectedObject = tabImageSetting;
              propertyGrid1.ExpandAllGridItems();
              fntStartUpGroup = new Font(treeViewGroup.Font, FontStyle.Underline);
              sfPlugins = new StringFormat(StringFormatFlags.NoWrap);
              sfPlugins.Alignment = StringAlignment.Near;
              sfPlugins.LineAlignment = StringAlignment.Center;
              SuspendLayout();
              lblVer.Text = "QTTabBar " + QTUtility2.MakeVersionString();
              tabPage1_Gnrl.Text = ResOpt_Genre[0];
              tabPage2_Tabs.Text = ResOpt_Genre[1];
              tabPage3_Wndw.Text = ResOpt_Genre[2];
              tabPage4_View.Text = ResOpt_Genre[3];
              tabPage5_Grps.Text = ResOpt_Genre[4];
              tabPage6_Apps.Text = ResOpt_Genre[5];
              tabPage7_Plug.Text = ResOpt_Genre[6];
              tabPage8_Keys.Text = ResOpt_Genre[7];
              tabPage9_Misc.Text = ResOpt_Genre[8];
              tabPageA_Path.Text = ResOpt_Genre[9];
              string[] strArray = QTUtility.TextResourcesDic["DialogButtons"];
              btnOK.Text = strArray[0];
              btnCancel.Text = strArray[1];
              btnApply.Text = strArray[2];
              chbActivateNew.Text = ResOpt[0];
              chbDontOpenSame.Text = ResOpt[1];
              chbCloseWhenGroup.Text = ResOpt[2];
              chbShowTooltip.Text = ResOpt[3];
              chbX1X2.Text = ResOpt[4];
              chbNavBtn.Text = ResOpt[5];
              chbNoHistory.Text = ResOpt[6];
              chbSaveExecuted.Text = ResOpt[7];
              chbDD.Text = ResOpt[8];
              lblLang.Text = ResOpt[9];
              lblNewTabLoc.Text = ResOpt[10];
              lblActvClose.Text = ResOpt[11];
              lblTabDblClk.Text = ResOpt[12];
              lblBGDblClik.Text = ResOpt[13];
              lblAction_BarDblClick.Text = ResOpt[14];
              lblMultiRows.Text = ResOpt[15];
              chbAutoSubText.Text = ResOpt[0x10];
              chbWhlClick.Text = ResOpt[0x11];
              chbNCADblClck.Text = ResOpt[0x12];
              chbWndUnresizable.Text = ResOpt[0x13];
              chbWndRestrAlpha.Text = ResOpt[20];
              chbBlockProcess.Text = ResOpt[0x15];
              chbFoldrTree.Text = ResOpt[0x16];
              chbNoTabFromOuteside.Text = ResOpt[0x17];
              chbHolizontalScroll.Text = ResOpt[0x18];
              chbWhlChangeView.Text = ResOpt[0x19];
              chbNeverCloseWindow.Text = ResOpt[0x1a];
              chbNeverCloseWndLocked.Text = ResOpt[0x1b];
              chbRestoreClosed.Text = ResOpt[0x1c];
              chbRestoreLocked.Text = ResOpt[0x1d];
              chbUseTabSkin.Text = ResOpt[30];
              btnHiliteClsc.Text = ResOpt[0x1f];
              lblTabSizeTitle.Text = ResOpt[0x20];
              lblTabWidth.Text = ResOpt[0x21];
              lblTabHeight.Text = ResOpt[0x22];
              lblTabWFix.Text = ResOpt_DropDown[0x18];
              lblTabWMax.Text = ResOpt[0x23];
              lblTabWMin.Text = ResOpt[0x24];
              lblTabFont.Text = ResOpt[0x25];
              btnTabFont.Text = ResOpt[0x25];
              chbBoldActv.Text = ResOpt[0x26];
              lblTabTxtClr.Text = ResOpt[0x27];
              btnActTxtClr.Text = ResOpt[40];
              btnShadowAct.Text = ResOpt[40];
              btnInactTxtClr.Text = ResOpt[0x29];
              btnShadowIna.Text = ResOpt[0x29];
              btnDefTxtClr.Text = ResOpt[0x2a];
              chbToolbarBGClr.Text = btnToolBarBGClr.Text = ResOpt[0x2b];
              chbFolderIcon.Text = ResOpt[0x2c];
              lblUserApps_Path.Text = ResOpt[0x2d] + ":";
              lblUserApps_Args.Text = ResOpt[0x2e] + ":";
              lblUserApps_Working.Text = ResOpt[0x2f] + ":";
              lblUserApps_Key.Text = ResOpt_Genre[7] + ":";
              lblGroupKey.Text = ResOpt_Genre[7] + ":";
              lblPluginLang.Text = ResOpt[0x30];
              chbHideMenu.Text = ResOpt[0x31];
              chbBSUpOneLvl.Text = ResOpt[50];
              chbNoFulRowSelect.Text = ResOpt[0x33];
              chbGridLine.Text = ResOpt[0x34];
              chbAlternateColor.Text = ResOpt[0x35];
              chbShowPreview.Text = ResOpt[0x36];
              chbPreviewMode.Text = ResOpt[0x37];
              chbSubDirTip.Text = ResOpt[0x38];
              chbSubDirTipMode.Text = ResOpt[0x37];
              chbSubDirTipModeHidden.Text = ResOpt[0x39];
              chbSubDirTipPreview.Text = ResOpt[0x36];
              chbSubDirTipModeFile.Text = ResOpt[0x3a];
              chbSelectWithoutExt.Text = ResOpt[0x3b];
              chbSubDirTipModeSystem.Text = ResOpt[60];
              chbSendToTray.Text = ResOpt[0x3d];
              lblPreviewWidth.Text = ResOpt[0x3e];
              lblPreviewHeight.Text = ResOpt[0x3f];
              chbRebarBGImage.Text = ResOpt[0x40];
              chbF2Selection.Text = ResOpt[0x41];
              chbTabCloseButton.Text = ResOpt[0x42];
              lblTabWhlClk.Text = ResOpt[0x43];
              chbSubDirTipOnTab.Text = ResOpt[0x44];
              clmnHeader_NoCapture.Text = ResOpt[0x45];
              chbTabCloseBtnAlt.Text = ResOpt[70];
              chbTabCloseBtnHover.Text = ResOpt[0x47];
              btnExportSettings.Text = ResOpt[0x48];
              chbCursorLoop.Text = ResOpt[0x49];
              lblNetworkTimeOut.Text = ResOpt[0x4a];
              chbSendToTrayOnMinimize.Text = ResOpt[0x4b];
              btnPreviewFont.Text = ResOpt[0x25];
              lblTabTextAlignment.Text = ResOpt[0x4c];
              lblMenuRenderer.Text = ResOpt[0x4d];
              string[] strArray2 = QTUtility.TextResourcesDic["TabBar_Option2"];
              chbTreeShftWhlTab.Text = strArray2[0];
              chbTabSwitcher.Text = strArray2[1];
              chbTabTitleShadow.Text = strArray2[2];
              chbAutoUpdate.Text = strArray2[3];
              chbRemoveOnSeparate.Text = strArray2[4];
              chbDriveLetter.Text = strArray2[5];
              chbPlaySound.Text = strArray2[6];
              btnBrowsePlugin.Text = strArray2[7];
              PluginView.BTN_OPTION = strArray2[8];
              PluginView.BTN_DISABLE = strArray2[9];
              PluginView.BTN_ENABLE = strArray2[10];
              PluginView.BTN_REMOVE = strArray2[11];
              PluginView.MNU_PLUGINABOUT = strArray2[12];
              RES_REMOVEPLGIN = strArray2[13];
              chbPreviewInfo.Text = strArray2[14];
              chbForceSysListView.Text = strArray2[15];
              chbAlwaysShowHeader.Text = strArray2[16];
              string[] strArray3 = QTUtility.TextResourcesDic["TabBar_Option_Buttons"];
              btnHistoryClear.Text = btnClearRecentFile.Text = strArray3[0];
              btnUp_Grp.Text = strArray3[1];
              btnUp_app.Text = strArray3[1];
              btnDown_Grp.Text = strArray3[2];
              btnDown_app.Text = strArray3[2];
              btnAddSep_Grp.Text = strArray3[3];
              btnAddSep_app.Text = strArray3[3];
              btnStartUpGrp.Text = strArray3[4];
              btnAlternateColor.Text = strArray3[6];
              btnAlternateColor_Text.Text = strArray3[7];
              btnAlternate_Default.Text = strArray3[8];
              btnDefaultTextExt.Text = strArray3[8];
              btnDefaultImgExt.Text = strArray3[8];
              btnPreviewFontDefault.Text = strArray3[8];
              btnAddTextExt.Text = strArray3[9];
              btnAddImgExt.Text = strArray3[9];
              btnDelTextExt.Text = strArray3[10];
              btnDelImgExt.Text = strArray3[10];
              btnCheckUpdates.Text = strArray3[11];
              btnCopyKeys.Text = strArray3[12];
              cmbNavBtn.Items.AddRange(new string[] { ResOpt_DropDown[0], ResOpt_DropDown[1] });
              cmbNewTabLoc.Items.AddRange(new string[] { ResOpt_DropDown[2], ResOpt_DropDown[3], ResOpt_DropDown[1], ResOpt_DropDown[0] });
              cmbActvClose.Items.AddRange(new string[] { ResOpt_DropDown[1], ResOpt_DropDown[0], ResOpt_DropDown[2], ResOpt_DropDown[3], ResOpt_DropDown[4] });
              cmbTabDblClck.Items.AddRange(new string[] { ResOpt_DropDown[5], ResOpt_DropDown[6], ResOpt_DropDown[7], ResOpt_DropDown[8], ResOpt_DropDown[9], ResOpt_DropDown[10], ResOpt_DropDown[11], ResOpt_DropDown[12], ResOpt_DropDown[13] });
              cmbBGDblClick.Items.AddRange(new string[] { ResOpt_DropDown[14], ResOpt_DropDown[5], ResOpt_DropDown[15], ResOpt_DropDown[0x10], ResOpt_DropDown[8], ResOpt_DropDown[0x11], ResOpt_DropDown[0x12], ResOpt_DropDown[0x13], ResOpt_DropDown[20], ResOpt_DropDown[0x16], ResOpt_DropDown[9], ResOpt_DropDown[4], ResOpt_DropDown[13] });
              cmbTabWhlClck.Items.AddRange(new string[] { ResOpt_DropDown[6], ResOpt_DropDown[5], ResOpt_DropDown[7], ResOpt_DropDown[8], ResOpt_DropDown[9], ResOpt_DropDown[10], ResOpt_DropDown[11], ResOpt_DropDown[12], ResOpt_DropDown[13] });
              cmbMultiRow.Items.AddRange(new string[] { ResOpt_DropDown[13], ResOpt_DropDown[0x15] + "1", ResOpt_DropDown[0x15] + "2" });
              cmbWhlClick.Items.AddRange(new string[] { ResOpt_DropDown[0x16], ResOpt_DropDown[9] });
              cmbTabSizeMode.Items.AddRange(new string[] { ResOpt_DropDown[0x17], ResOpt_DropDown[0x18], ResOpt_DropDown[0x19] });
              cmbTabTextAlignment.Items.AddRange(new string[] { ResOpt_DropDown[0x1d], ResOpt_DropDown[30] });
              cmbTextExts.Items.Add("(Text file)");
              cmbTextExts.Items.AddRange(QTUtility.PreviewExtsList_Txt.ToArray());
              cmbTextExts.SelectedIndex = 0;
              cmbImgExts.Items.Add("(Image & movie file)");
              cmbImgExts.Items.AddRange(QTUtility.PreviewExtsList_Img.ToArray());
              cmbImgExts.SelectedIndex = 0;
              cmbRebarBGImageMode.Items.AddRange(new string[] { ResOpt_DropDown[0x1a], ResOpt_DropDown[0x1b], ResOpt_DropDown[0x1c], ResOpt_DropDown[0x21] });
              cmbMenuRenderer.Items.AddRange(new string[] { ResOpt[0x2a], ResOpt_DropDown[0x1f], ResOpt_DropDown[0x20] });
              if(arrSpecialFolderCSIDLs == null) {
                  if(!QTUtility.IsXP) {
                      arrSpecialFolderCSIDLs = new int[] { 
              0x11, 0, 10, 3, 0x12, 0x31, 4, 5, 0x27, 13, 14, 6, 0x1a, 40, 0x20, 0x21, 
              8, 0x22
             };
                  }
                  else {
                      arrSpecialFolderCSIDLs = new int[] { 0x11, 0, 10, 3, 0x12, 0x31, 4, 5, 0x27, 6, 0x1a, 40, 0x20, 0x21, 8, 0x22 };
                  }
                  arrSpecialFolderDipNms = new string[arrSpecialFolderCSIDLs.Length];
                  for(int i = 0; i < arrSpecialFolderCSIDLs.Length; i++) {
                      arrSpecialFolderDipNms[i] = ShellMethods.GetSpecialFolderCLSID(arrSpecialFolderCSIDLs[i], true);
                  }
              }
              cmbSpclFol_NoCapture.Items.AddRange(arrSpecialFolderDipNms);
              cmbSpclFol_NoCapture.SelectedIndex = 0;
              cmbSpclFol_Grp.Items.AddRange(arrSpecialFolderDipNms);
              cmbSpclFol_Grp.SelectedIndex = 0;
              using(RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Quizo\QTTabBar")) {
                  if(key != null) {
                      int[] numArray = QTUtility2.ReadRegBinary<int>("OptionWindowBounds", key);
                      if((numArray != null) && (numArray.Length == 4)) {
                          StartPosition = FormStartPosition.Manual;
                          SetDesktopBounds(numArray[0], numArray[1], numArray[2], numArray[3]);
                      }
                  }
              }
              SetValues();
              tabControl1.SelectedIndex = QTUtility.OptionsDialogTabIndex;
              ResumeLayout();
          }
  
          private void btnAdd_NoCapture_Click(object sender, EventArgs e) {
              listView_NoCapture.BeginUpdate();
              listView_NoCapture.SelectedItems.Clear();
              foreach(ListViewItem item in listView_NoCapture.Items) {
                  if(item.Text.Length == 0 || item.Text == "Enter path") {
                      item.Selected = true;
                      item.BeginEdit();
                      listView_NoCapture.EndUpdate();
                      return;
                  }
              }
              ListViewItem item2 = new ListViewItem("Enter path");
              listView_NoCapture.Items.Add(item2);
              listView_NoCapture.EndUpdate();
              item2.BeginEdit();
          }
  
          private void btnAddPreviewExt_Click(object sender, EventArgs e) {
              EnterExtension(sender == btnAddTextExt);
          }
  
          private void btnAddSep_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              TreeNode parent = tnRoot_UserApps;
              int count = tnRoot_UserApps.Nodes.Count;
              if((selectedNode != null) && (selectedNode.Level > 0)) {
                  if(selectedNode.Tag != null) {
                      count = selectedNode.Index + 1;
                      parent = selectedNode.Parent;
                  }
                  else {
                      count = selectedNode.Nodes.Count;
                      parent = selectedNode;
                  }
              }
              TreeNode node = new TreeNode("----------- Separator -----------");
              node.ImageKey = node.SelectedImageKey = "noimage";
              node.Tag = new MenuItemArguments(string.Empty, string.Empty, string.Empty, 0, MenuGenre.Application);
              node.ForeColor = SystemColors.GrayText;
              parent.Nodes.Insert(count, node);
              treeViewUserApps.SelectedNode = node;
          }
  
          private void btnAddSep_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewGroup.SelectedNode;
              if((selectedNode != null) && (selectedNode.Level != 2)) {
                  TreeNode node = new TreeNode("----------- Separator -----------");
                  node.Tag = MIA_GROUPSEP;
                  node.ForeColor = SystemColors.GrayText;
                  node.ImageKey = node.SelectedImageKey = "noimage";
                  treeViewGroup.BeginUpdate();
                  if(selectedNode.Level == 1) {
                      tnGroupsRoot.Nodes.Insert(selectedNode.Index + 1, node);
                  }
                  else if(selectedNode.Level == 0) {
                      tnGroupsRoot.Nodes.Add(node);
                  }
                  treeViewGroup.EndUpdate();
                  node.EnsureVisible();
              }
          }
  
          private void btnAddSpcFol_Grp_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewGroup.SelectedNode;
              if(selectedNode != null) {
                  string selectedItem = (string)cmbSpclFol_Grp.SelectedItem;
                  int selectedIndex = cmbSpclFol_Grp.SelectedIndex;
                  string specialFolderCLSID = ShellMethods.GetSpecialFolderCLSID(arrSpecialFolderCSIDLs[selectedIndex], false);
                  if((selectedIndex == 3) && !QTUtility.IsXP) {
                      specialFolderCLSID = "::{26EE0668-A00A-44D7-9371-BEB064C98683}";
                  }
                  TreeNode node = new TreeNode(selectedItem);
                  node.Name = specialFolderCLSID;
                  node.ToolTipText = selectedItem;
                  node.ImageKey = node.SelectedImageKey = QTUtility.GetImageKey(specialFolderCLSID, null);
                  if(selectedNode.Level == 0) {
                      selectedItem = CreateUniqueName(selectedItem, null, selectedNode);
                      TreeNode node3 = new TreeNode(selectedItem);
                      node3.ImageKey = node3.SelectedImageKey = node.ImageKey;
                      node3.Nodes.Add(node);
                      node3.Tag = new MenuItemArguments(selectedItem, null, null, 0, MenuGenre.Group);
                      tnGroupsRoot.Nodes.Add(node3);
                      treeViewGroup.SelectedNode = node3;
                      node.Expand();
                      node.BeginEdit();
                  }
                  else {
                      TreeNode node4 = (selectedNode.Level == 1) ? selectedNode : selectedNode.Parent;
                      node4.Nodes.Add(node);
                      node4.Expand();
                      if(node.Index == 0) {
                          node4.ImageKey = node4.SelectedImageKey = node.ImageKey;
                      }
                  }
              }
          }
  
          private void btnAddSpcFol_NoCapture_Click(object sender, EventArgs e) {
              listView_NoCapture.BeginUpdate();
              listView_NoCapture.SelectedItems.Clear();
              string selectedItem = (string)cmbSpclFol_NoCapture.SelectedItem;
              int selectedIndex = cmbSpclFol_NoCapture.SelectedIndex;
              string specialFolderCLSID = ShellMethods.GetSpecialFolderCLSID(arrSpecialFolderCSIDLs[selectedIndex], false);
              if((selectedIndex == 3) && !QTUtility.IsXP) {
                  specialFolderCLSID = "::{26EE0668-A00A-44D7-9371-BEB064C98683}";
              }
              foreach(ListViewItem item in listView_NoCapture.Items) {
                  if(((item.Text.Length == 0) || (item.Text == "Enter path")) || (item.Text == selectedItem)) {
                      if(item.Text != selectedItem) {
                          item.Text = selectedItem;
                          item.Name = specialFolderCLSID;
                      }
                      item.Selected = true;
                      listView_NoCapture.EndUpdate();
                      return;
                  }
              }
              ListViewItem item2 = new ListViewItem(selectedItem);
              item2.Name = specialFolderCLSID;
              listView_NoCapture.Items.Add(item2);
              item2.Selected = true;
              listView_NoCapture.EndUpdate();
          }
  
          private void btnAddToken_Arg_Click(object sender, EventArgs e) {
              CreateTokenMenu();
              cmsAddToken.Items[0].Enabled = true;
              Rectangle rectangle = tabPage6_Apps.RectangleToScreen(btnAddToken_Arg.Bounds);
              cmsAddToken.Show(rectangle.Right, rectangle.Top);
          }
  
          private void btnAddToken_Wrk_Click(object sender, EventArgs e) {
              CreateTokenMenu();
              cmsAddToken.Items[0].Enabled = false;
              Rectangle rectangle = tabPage6_Apps.RectangleToScreen(btnAddToken_Wrk.Bounds);
              cmsAddToken.Show(rectangle.Right, rectangle.Top);
          }
  
          private void btnAddVirtualFolder_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              TreeNode tnParent = tnRoot_UserApps;
              int count = tnRoot_UserApps.Nodes.Count;
              if((selectedNode != null) && (selectedNode.Level > 0)) {
                  if(selectedNode.Tag != null) {
                      count = selectedNode.Index + 1;
                      tnParent = selectedNode.Parent;
                  }
                  else {
                      count = selectedNode.Nodes.Count;
                      tnParent = selectedNode;
                  }
              }
              TreeNode node = new TreeNode(CreateUniqueName("New Folder", null, tnParent));
              node.ImageKey = node.SelectedImageKey = "folder";
              node.Tag = null;
              tnParent.Nodes.Insert(count, node);
              treeViewUserApps.SelectedNode = node;
              node.BeginEdit();
          }
  
          private void btnAlternateColor_Click(object sender, EventArgs e) {
              if(sender == btnAlternate_Default) {
                  QTUtility.ShellViewRowCOLORREF_Background = 0xfaf5f1;
                  Color windowText = SystemColors.WindowText;
                  QTUtility.ShellViewRowCOLORREF_Text = QTUtility2.MakeCOLORREF(windowText);
                  btnAlternateColor.BackColor = QTUtility2.MakeColor(QTUtility.ShellViewRowCOLORREF_Background);
                  btnAlternateColor_Text.ForeColor = windowText;
              }
              else {
                  bool flag = sender == btnAlternateColor;
                  using(ColorDialogEx ex = new ColorDialogEx()) {
                      ex.Color = flag ? btnAlternateColor.BackColor : btnAlternateColor_Text.ForeColor;
                      if(DialogResult.OK == ex.ShowDialog()) {
                          if(flag) {
                              btnAlternateColor.BackColor = ex.Color;
                          }
                          else {
                              btnAlternateColor_Text.ForeColor = ex.Color;
                          }
                      }
                  }
              }
          }
  
          private void btnBFD_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              if((selectedNode != null) && (selectedNode.Tag != null)) {
                  using(FolderBrowserDialog dialog = new FolderBrowserDialog()) {
                      string path = ((MenuItemArguments)selectedNode.Tag).Path;
                      if((path.Length > 2) && !path.StartsWith(@"\\")) {
                          if(Directory.Exists(path)) {
                              if(path.Length > 3) {
                                  path = path.TrimEnd(new char[] { '\\' });
                              }
                          }
                          else if(File.Exists(path)) {
                              path = Path.GetDirectoryName(path);
                          }
                          dialog.SelectedPath = path;
                      }
                      if(dialog.ShowDialog() == DialogResult.OK) {
                          tbPath.Text = dialog.SelectedPath;
                          tbArgs.Text = tbWorking.Text = string.Empty;
                          if(selectedNode.Text.StartsWith("New Item")) {
                              if(dialog.SelectedPath.Length == 3) {
                                  selectedNode.Text = dialog.SelectedPath;
                              }
                              else {
                                  selectedNode.Text = Path.GetFileName(dialog.SelectedPath);
                              }
                          }
                      }
                  }
              }
          }
  
          private void btnBrowseAction_Click(object sender, EventArgs e) {
              using(FolderBrowserDialog dialog = new FolderBrowserDialog()) {
                  dialog.SelectedPath = textBoxAction_BarDblClck.Text;
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      textBoxAction_BarDblClck.Text = dialog.SelectedPath;
                  }
              }
          }
  
          private void btnBrowsePlugin_Click(object sender, EventArgs e) {
              using(OpenFileDialog dialog = new OpenFileDialog()) {
                  dialog.Filter = "Plugin files (*.dll)|*.dll";
                  dialog.RestoreDirectory = true;
                  dialog.Multiselect = true;
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      bool flag = true;
                      foreach(PluginAssembly assembly in dialog.FileNames
                              .Select(str => new PluginAssembly(str))
                              .Where(assembly => assembly.PluginInfosExist)) {
                          CreatePluginViewItem(new PluginAssembly[] { assembly }, true);
                          if(flag) {
                              flag = false;
                              SelectPluginBottom();
                          }
                      }
                  }
              }
          }
  
          private void btnBrowsePluginLang_Click(object sender, EventArgs e) {
              using(OpenFileDialog dialog = new OpenFileDialog()) {
                  dialog.Filter = "Language XML files (*.xml)|*.xml";
                  dialog.RestoreDirectory = true;
                  if(textBoxPluginLang.Text.Length > 0) {
                      dialog.FileName = textBoxPluginLang.Text;
                  }
                  if(dialog.ShowDialog() == DialogResult.OK) {
                      textBoxPluginLang.Text = dialog.FileName;
                  }
              }
          }
  
          private void btnCancel_Click(object sender, EventArgs e) {
              if(callBack != null) {
                  callBack.BeginInvoke(DialogResult.Cancel, null, null);
                  callBack = null;
              }
              Close();
          }
  
          private void btnCheckUpdates_Click(object sender, EventArgs e) {
              UpdateChecker.Check(true);
          }
  
          private void btnClearRecentFile_Click(object sender, EventArgs e) {
              QTUtility.ExecutedPathsList.Clear();
              try {
                  using(RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Quizo\QTTabBar")) {
                      key.DeleteSubKeyTree("RecentFiles");
                  }
              }
              catch {
              }
          }
  
          private void btnCopyKeys_Click(object sender, EventArgs e) {
              string str = string.Empty;
              string str2 = "\t\t";
              for(int i = 0; i < listViewKeyboard.Items.Count; i++) {
                  ListViewItem item = listViewKeyboard.Items[i];
                  Keys tag = (Keys)item.Tag;
                  if(item.Checked && (tag != Keys.None)) {
                      if(item.Group.Name == "general") {
                          string str3 = str;
                          str = str3 + QTUtility2.MakeKeyString(tag) + str2 + item.Text + "\n";
                      }
                      else {
                          string str4 = str;
                          str = str4 + QTUtility2.MakeKeyString(tag) + str2 + item.Text + "  -  " + item.Group.Header + "\n";
                      }
                  }
              }
              foreach(int num2 in QTUtility.dicUserAppShortcutKeys.Keys) {
                  if((num2 & 0x100000) != 0) {
                      MenuItemArguments arguments = QTUtility.dicUserAppShortcutKeys[num2];
                      string str5 = str;
                      str = str5 + QTUtility2.MakeKeyString(((Keys)num2) & ((Keys)(-1048577))) + str2 + "\"" + arguments.Path + "\"";
                      if(!string.IsNullOrEmpty(arguments.Argument)) {
                          str = str + ", " + arguments.Argument;
                      }
                      str = str + "\n";
                  }
              }
              QTTabBarClass.SetStringClipboard(str);
          }
  
          private void btnDefaultImgExt_Click(object sender, EventArgs e) {
              cmbImgExts.Items.Clear();
              cmbImgExts.Items.Add("(Image & movie file)");
              cmbImgExts.Items.AddRange(ThumbnailTooltipForm.MakeDefaultImgExts().ToArray());
              cmbImgExts.SelectedIndex = 0;
          }
  
          private void btnDefaultTextExt_Click(object sender, EventArgs e) {
              cmbTextExts.Items.Clear();
              cmbTextExts.Items.AddRange(new string[] { "(Text file)", ".txt", ".ini", ".inf", ".cs", ".log", ".js", ".vbs" });
              cmbTextExts.SelectedIndex = 0;
          }
  
          private void btnDelPreiviewExt_Click(object sender, EventArgs e) {
              ComboBox box = (sender == btnDelTextExt) ? cmbTextExts : cmbImgExts;
              int selectedIndex = box.SelectedIndex;
              if(selectedIndex > 0) {
                  box.Items.RemoveAt(selectedIndex);
                  if(selectedIndex < box.Items.Count) {
                      box.SelectedIndex = selectedIndex;
                  }
                  else {
                      box.SelectedIndex = 0;
                  }
              }
          }
  
          private void btnExportSettings_Click(object sender, EventArgs e) {
              using(SaveFileDialog dialog = new SaveFileDialog()) {
                  dialog.Filter = "Registry file (*.reg)|*.reg";
                  dialog.RestoreDirectory = true;
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      string fileName = dialog.FileName;
                      try {
                          using(RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Quizo\QTTabBar", true)) {
                              if(key != null) {
                                  key.DeleteSubKey("Cache", false);
                              }
                          }
                          ProcessStartInfo startInfo = new ProcessStartInfo(ShellMethods.GetFolderPath(0x24) + @"\regedit.exe");
                          startInfo.Arguments = "/e \"" + fileName + "\" HKEY_CURRENT_USER\\Software\\Quizo\\QTTabBar";
                          startInfo.ErrorDialog = true;
                          startInfo.ErrorDialogParentHandle = Handle;
                          Process.Start(startInfo);
                      }
                      catch {
                      }
                  }
              }
          }
  
          private void btnFont_Click(object sender, EventArgs e) {
              try {
                  using(FontDialog dialog = new FontDialog()) {
                      dialog.Font = btnTabFont.Font;
                      dialog.ShowEffects = false;
                      dialog.AllowVerticalFonts = false;
                      if(DialogResult.OK == dialog.ShowDialog()) {
                          btnTabFont.Font = dialog.Font;
                      }
                  }
              }
              catch {
                  SystemSounds.Hand.Play();
              }
          }
  
          private void btnLangBrowse_Click(object sender, EventArgs e) {
              using(OpenFileDialog dialog = new OpenFileDialog()) {
                  dialog.Filter = "Language XML files (*.xml)|*.xml";
                  dialog.RestoreDirectory = true;
                  if(textBoxLang.Text.Length > 0) {
                      dialog.FileName = textBoxLang.Text;
                  }
                  if(dialog.ShowDialog() == DialogResult.OK) {
                      textBoxLang.Text = dialog.FileName;
                  }
              }
          }
  
          private void btnMinus_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              if((selectedNode != null) && (selectedNode.Level > 0)) {
                  selectedNode.Remove();
              }
          }
  
          private void btnMinus_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewGroup.SelectedNode;
              if((selectedNode != null) && (selectedNode.Level != 0)) {
                  selectedNode.Remove();
              }
          }
  
          private void btnOFD_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              if((selectedNode != null) && (selectedNode.Tag != null)) {
                  using(OpenFileDialog dialog = new OpenFileDialog()) {
                      dialog.RestoreDirectory = true;
                      dialog.DereferenceLinks = false;
                      string path = ((MenuItemArguments)selectedNode.Tag).Path;
                      if(((path.Length > 3) && !path.StartsWith(@"\\")) && (File.Exists(path) || Directory.Exists(path))) {
                          dialog.FileName = path;
                      }
                      if(dialog.ShowDialog() == DialogResult.OK) {
                          tbPath.Text = dialog.FileName;
                          if(tbWorking.Text.Length == 0) {
                              tbWorking.Text = Path.GetDirectoryName(dialog.FileName);
                          }
                          if(selectedNode.Text.StartsWith("New Item")) {
                              selectedNode.Text = Path.GetFileName(dialog.FileName);
                          }
                      }
                  }
              }
          }
  
          private void btnOFD_NoCapture_Click(object sender, EventArgs e) {
              using(FolderBrowserDialog dialog = new FolderBrowserDialog()) {
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      listView_NoCapture.BeginUpdate();
                      listView_NoCapture.SelectedItems.Clear();
                      bool flag = false;
                      foreach(ListViewItem item in listView_NoCapture.Items) {
                          if(dialog.SelectedPath.PathEquals(item.Name)) {
                              item.Selected = true;
                              flag = true;
                              break;
                          }
                          if(item.Text == "Enter path") {
                              item.Text = item.Name = dialog.SelectedPath;
                              item.Selected = true;
                              flag = true;
                              break;
                          }
                      }
                      if(!flag) {
                          ListViewItem item2 = new ListViewItem(dialog.SelectedPath);
                          item2.Name = dialog.SelectedPath;
                          listView_NoCapture.Items.Add(item2);
                      }
                      listView_NoCapture.EndUpdate();
                  }
              }
          }
  
          private void btnPayPal_Click(object sender, EventArgs e) {
              try {
                  Process.Start(Resources_String.PayPalURL);
              }
              catch {
              }
          }
  
          private void btnPlus_app_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              TreeNode tnParent = tnRoot_UserApps;
              int index = 0;
              if((selectedNode != null) && (selectedNode.Level > 0)) {
                  if(selectedNode.Tag != null) {
                      index = selectedNode.Index + 1;
                      tnParent = selectedNode.Parent;
                  }
                  else {
                      tnParent = selectedNode;
                  }
              }
              else {
                  selectedNode = tnRoot_UserApps;
              }
              TreeNode node = new TreeNode(CreateUniqueName("New Item", null, tnParent));
              node.ImageKey = node.SelectedImageKey = "noimage";
              node.Tag = new MenuItemArguments(string.Empty, string.Empty, string.Empty, 0, MenuGenre.Application);
              if(selectedNode.Tag == null) {
                  selectedNode.Nodes.Add(node);
              }
              else {
                  tnParent.Nodes.Insert(index, node);
              }
              treeViewUserApps.SelectedNode = node;
              node.BeginEdit();
          }
  
          private void btnPlus_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewGroup.SelectedNode;
              if(selectedNode != null) {
                  if((selectedNode.Level == 0) || (selectedNode.Tag == MIA_GROUPSEP)) {
                      int index = (selectedNode.Level == 0) ? tnGroupsRoot.Nodes.Count : (selectedNode.Index + 1);
                      string text = CreateUniqueName("NewGroup", null, tnGroupsRoot);
                      TreeNode node = new TreeNode(text);
                      node.Tag = new MenuItemArguments(text, null, null, 0, MenuGenre.Group);
                      tnGroupsRoot.Nodes.Insert(index, node);
                      treeViewGroup.SelectedNode = node;
                      node.BeginEdit();
                  }
                  else {
                      using(FolderBrowserDialog dialog = new FolderBrowserDialog()) {
                          if(dialog.ShowDialog() == DialogResult.OK) {
                              TreeNode parent;
                              string selectedPath = dialog.SelectedPath;
                              string str3 = QTUtility2.MakePathDisplayText(selectedPath, true);
                              TreeNode node3 = new TreeNode(str3);
                              node3.Name = selectedPath;
                              node3.ToolTipText = str3;
                              node3.ImageKey = node3.SelectedImageKey = QTUtility.GetImageKey(selectedPath, null);
                              if(selectedNode.Level == 1) {
                                  parent = selectedNode;
                              }
                              else {
                                  parent = selectedNode.Parent;
                              }
                              parent.Nodes.Add(node3);
                              parent.Expand();
                              if(node3.Index == 0) {
                                  parent.ImageKey = parent.SelectedImageKey = node3.ImageKey;
                              }
                          }
                      }
                  }
              }
          }
  
          private void btnPreviewFont_Click(object sender, EventArgs e) {
              if(sender == btnPreviewFont) {
                  try {
                      using(FontDialog dialog = new FontDialog()) {
                          dialog.Font = btnPreviewFont.Font;
                          dialog.ShowEffects = false;
                          dialog.AllowVerticalFonts = false;
                          if(DialogResult.OK == dialog.ShowDialog()) {
                              btnPreviewFont.Font = dialog.Font;
                          }
                      }
                  }
                  catch {
                      SystemSounds.Hand.Play();
                  }
              }
              else {
                  btnPreviewFont.Font = null;
              }
          }
  
          private void btnRebarImage_Click(object sender, EventArgs e) {
              using(OpenFileDialog dialog = new OpenFileDialog()) {
                  dialog.Filter = "Image Files(*.PNG;*.BMP;*.JPG;*.GIF)|*.PNG;*.BMP;*.JPG;*.GIF";
                  dialog.FileName = tbRebarImagePath.Text;
                  dialog.RestoreDirectory = true;
                  dialog.Title = "Toolbar background image";
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      tbRebarImagePath.Text = dialog.FileName;
                  }
              }
          }
  
          private void btnRemove_NoCapture_Click(object sender, EventArgs e) {
              int count = listView_NoCapture.SelectedItems.Count;
              if(count > 0) {
                  listView_NoCapture.BeginUpdate();
                  int index = listView_NoCapture.Items.IndexOf(listView_NoCapture.SelectedItems[0]);
                  foreach(ListViewItem item in listView_NoCapture.SelectedItems) {
                      listView_NoCapture.Items.Remove(item);
                  }
                  if(count == 1) {
                      count = listView_NoCapture.Items.Count;
                      if(count > index) {
                          listView_NoCapture.Items[index].Selected = true;
                      }
                      else if(count > 0) {
                          listView_NoCapture.Items[count - 1].Selected = true;
                      }
                  }
                  listView_NoCapture.EndUpdate();
              }
          }
  
          private void btnShadowClrs_Click(object sender, EventArgs e) {
              using(ColorDialogEx ex = new ColorDialogEx()) {
                  ex.Color = ((Button)sender).ForeColor;
                  if(DialogResult.OK == ex.ShowDialog()) {
                      ((Button)sender).ForeColor = ex.Color;
                  }
              }
          }
  
          private void btnStartUpGrp_Click(object sender, EventArgs e) {
              TreeNode selectedNode = treeViewGroup.SelectedNode;
              if((selectedNode != null) && (selectedNode.Level > 0)) {
                  TreeNode parent;
                  if(selectedNode.Level == 1) {
                      parent = selectedNode;
                  }
                  else {
                      parent = selectedNode.Parent;
                  }
                  if(parent.NodeFont == fntStartUpGroup) {
                      parent.NodeFont = treeViewGroup.Font;
                  }
                  else {
                      parent.NodeFont = fntStartUpGroup;
                  }
              }
          }
  
          private void btnTabImage_Click(object sender, EventArgs e) {
              using(OpenFileDialog dialog = new OpenFileDialog()) {
                  dialog.Filter = "Image Files(*.PNG;*.BMP;*.JPG;*.GIF)|*.PNG;*.BMP;*.JPG;*.GIF";
                  dialog.FileName = tbTabImagePath.Text;
                  dialog.RestoreDirectory = true;
                  dialog.Title = "Tab image";
                  if(DialogResult.OK == dialog.ShowDialog()) {
                      tbTabImagePath.Text = dialog.FileName;
                  }
              }
          }
  
          private void btnUpDown_app_Click(object sender, EventArgs e) {
              bool flag = sender == btnUp_app;
              TreeNode selectedNode = treeViewUserApps.SelectedNode;
              if((selectedNode != null) && (selectedNode != tnRoot_UserApps)) {
                  TreeNode parent = selectedNode.Parent;
                  TreeNode node3 = flag ? selectedNode.PrevNode : selectedNode.NextNode;
                  treeViewUserApps.BeginUpdate();
                  if(node3 != null) {
                      selectedNode.Remove();
                      if(node3.Tag != null) {
                          parent.Nodes.Insert(flag ? node3.Index : (node3.Index + 1), selectedNode);
                      }
                      else {
                          node3.Nodes.Insert(flag ? node3.Nodes.Count : 0, selectedNode);
                      }
                  }
                  else if(selectedNode.Level > 1) {
                      TreeNode node4 = parent.Parent;
                      TreeNode node5 = flag ? parent.PrevNode : parent.NextNode;
                      selectedNode.Remove();
                      if(node5 != null) {
                          node4.Nodes.Insert(flag ? (node5.Index + 1) : node5.Index, selectedNode);
                      }
                      else {
                          node4.Nodes.Insert(flag ? parent.Index : (parent.Index + 1), selectedNode);
                      }
                  }
                  treeViewUserApps.SelectedNode = selectedNode;
                  treeViewUserApps.EndUpdate();
                  selectedNode.EnsureVisible();
              }
          }
  
          private void buttonActClr_Click(object sender, EventArgs e) {
              using(ColorDialogEx ex = new ColorDialogEx()) {
                  ex.Color = btnActTxtClr.ForeColor;
                  if(DialogResult.OK == ex.ShowDialog()) {
                      btnActTxtClr.ForeColor = ex.Color;
                  }
              }
          }
  
          private void buttonApply_Click(object sender, EventArgs e) {
              Save(true);
          }
  
          private void buttonHistoryClear_Click(object sender, EventArgs e) {
              QTUtility.ClosedTabHistoryList.Clear();
              try {
                  using(RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Quizo\QTTabBar")) {
                      key.DeleteSubKeyTree("RecentlyClosed");
                  }
              }
              catch {
              }
          }
  
          private void buttonHL_Click(object sender, EventArgs e) {
              using(ColorDialogEx ex = new ColorDialogEx()) {
                  ex.Color = btnHiliteClsc.ForeColor;
                  if(DialogResult.OK == ex.ShowDialog()) {
                      btnHiliteClsc.ForeColor = ex.Color;
                  }
              }
          }
  
          private void buttonInactClr_Click(object sender, EventArgs e) {
              using(ColorDialogEx ex = new ColorDialogEx()) {
                  ex.Color = btnInactTxtClr.ForeColor;
                  if(DialogResult.OK == ex.ShowDialog()) {
                      btnInactTxtClr.ForeColor = ex.Color;
                  }
              }
          }
  
          private void buttonOK_Click(object sender, EventArgs e) {
              Save(false);
          }
  
          private void buttonRstClr_Click(object sender, EventArgs e) {
              btnActTxtClr.ForeColor = btnInactTxtClr.ForeColor = SystemColors.ControlText;
              btnHiliteClsc.ForeColor = SystemColors.Highlight;
              btnTabFont.Font = null;
          }
  
          private void buttonToolBarBGClr_Click(object sender, EventArgs e) {
              using(ColorDialogEx ex = new ColorDialogEx()) {
                  ex.Color = btnToolBarBGClr.BackColor;
                  if(DialogResult.OK == ex.ShowDialog()) {
                      btnToolBarBGClr.BackColor = ex.Color;
                  }
              }
          }
  
          private void chbAlternateColor_CheckedChanged(object sender, EventArgs e) {
              btnAlternate_Default.Enabled = btnAlternateColor.Enabled = btnAlternateColor_Text.Enabled = chbAlternateColor.Checked;
          }
  
          private void chbDrawMode_CheckedChanged(object sender, EventArgs e) {
              propertyGrid1.Enabled = btnHiliteClsc.Enabled = tbTabImagePath.Enabled = btnTabImage.Enabled = chbUseTabSkin.Checked;
          }
  
          private void chbFolderIcon_CheckedChanged(object sender, EventArgs e) {
              chbDriveLetter.Enabled = chbSubDirTipOnTab.Enabled = chbFolderIcon.Checked;
          }
  
          private void chbGroupKey_CheckedChanged(object sender, EventArgs e) {
              if(!fSuppressTextChangeEvent_Group) {
                  TreeNode selectedNode = treeViewGroup.SelectedNode;
                  if(((selectedNode != null) && (selectedNode.Tag != null)) && (selectedNode.Tag is MenuItemArguments)) {
                      MenuItemArguments tag = (MenuItemArguments)selectedNode.Tag;
                      if(chbGroupKey.Checked) {
                          tag.KeyShortcut |= 0x100000;
                      }
                      else {
                          tag.KeyShortcut &= -1048577;
                      }
                      tbGroupKey.Enabled = chbGroupKey.Checked;
                  }
              }
          }
  
          private void chbMMButton_CheckedChanged(object sender, EventArgs e) {
              cmbWhlClick.Enabled = chbWhlClick.Checked;
          }
  
          private void chbNavBtn_CheckedChanged(object sender, EventArgs e) {
              cmbNavBtn.Enabled = chbNavBtn.Checked;
          }
  
          private void chbRebarBGImage_CheckedChanged(object sender, EventArgs e) {
              cmbRebarBGImageMode.Enabled = btnRebarImage.Enabled = tbRebarImagePath.Enabled = chbRebarBGImage.Checked;
          }
  
          private void chbsCloseWindow_CheckedChanged(object sender, EventArgs e) {
              if(sender == chbNeverCloseWndLocked) {
                  if(chbNeverCloseWndLocked.Checked) {
                      chbRestoreLocked.Enabled = chbRestoreLocked.Checked = false;
                  }
                  else {
                      chbRestoreLocked.Enabled = true;
                  }
              }
              else if(sender == chbRestoreLocked) {
                  if(chbRestoreLocked.Checked) {
                      chbRestoreClosed.Checked = true;
                  }
              }
              else if((sender == chbRestoreClosed) && !chbRestoreClosed.Checked) {
                  chbRestoreLocked.Checked = false;
              }
          }
  
          private void chbShowPreviewTooltip_CheckedChanged(object sender, EventArgs e) {
              tabPage9_Misc.SuspendLayout();
              nudPreviewMaxWidth.Enabled = nudPreviewMaxHeight.Enabled = cmbTextExts.Enabled = btnAddTextExt.Enabled = btnDelTextExt.Enabled = btnDefaultTextExt.Enabled = cmbImgExts.Enabled = btnAddImgExt.Enabled = btnDelImgExt.Enabled = btnDefaultImgExt.Enabled = btnPreviewFont.Enabled = btnPreviewFontDefault.Enabled = chbPreviewInfo.Enabled = chbPreviewMode.Enabled = chbShowPreview.Checked;
              tabPage9_Misc.ResumeLayout();
          }
  
          private void chbSubDirTip_CheckedChanged(object sender, EventArgs e) {
              chbSubDirTipMode.Enabled = chbSubDirTipModeFile.Enabled = chbSubDirTipModeHidden.Enabled = chbSubDirTipPreview.Enabled = chbSubDirTipModeSystem.Enabled = chbSubDirTip.Checked;
          }
  
          private void chbTabCloseBtns_CheckedChanged(object sender, EventArgs e) {
              if((sender == chbTabCloseBtnHover) && chbTabCloseBtnHover.Checked) {
                  chbTabCloseBtnAlt.Checked = false;
              }
              else if((sender == chbTabCloseBtnAlt) && chbTabCloseBtnAlt.Checked) {
                  chbTabCloseBtnHover.Checked = false;
              }
          }
  
          private void chbTabCloseButton_CheckedChanged(object sender, EventArgs e) {
              chbTabCloseBtnAlt.Enabled = chbTabCloseBtnHover.Enabled = chbTabCloseButton.Checked;
          }
  
          private void chbTabTitleShadow_CheckedChanged(object sender, EventArgs e) {
              btnShadowAct.Enabled = btnShadowIna.Enabled = chbTabTitleShadow.Checked;
          }
  
          private void chbToolbarBGClr_CheckedChanged(object sender, EventArgs e) {
              btnToolBarBGClr.Enabled = chbToolbarBGClr.Checked;
          }
  
          private void chbUserAppKey_CheckedChanged(object sender, EventArgs e) {
              if(!fSuppressTextChangeEvent_UserApps) {
                  TreeNode selectedNode = treeViewUserApps.SelectedNode;
                  if(((selectedNode != null) && (selectedNode.Tag != null)) && (selectedNode.Tag is MenuItemArguments)) {
                      MenuItemArguments tag = (MenuItemArguments)selectedNode.Tag;
                      if(chbUserAppKey.Checked) {
                          tag.KeyShortcut |= 0x100000;
                      }
                      else {
                          tag.KeyShortcut &= -1048577;
                      }
                      tbUserAppKey.Enabled = chbUserAppKey.Checked;
                  }
              }
          }
  
          private bool CheckExistance_GroupKey(Keys keys, TreeNode tnCurrent) {
              foreach(TreeNode node in tnGroupsRoot.Nodes) {
                  if(((node == tnCurrent) || (node.Tag == null)) || !(node.Tag is MenuItemArguments)) {
                      continue;
                  }
                  MenuItemArguments tag = (MenuItemArguments)node.Tag;
                  int num = tag.KeyShortcut & -1048577;
                  if(num == (int)keys) {
                      string[] strArray = QTUtility.TextResourcesDic["ShortcutKeys_MsgReassign"];
                      string text = string.Format(strArray[0], QTUtility2.MakeKeyString(keys), node.Text);
                      if(DialogResult.OK == MessageBox.Show(text, strArray[1], MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
                          tag.KeyShortcut = 0;
                          if(node == treeViewGroup.SelectedNode) {
                              chbGroupKey.Checked = false;
                              tbGroupKey.Text = " - ";
                          }
                          return true;
                      }
                      return false;
                  }
              }
              return true;
          }
  
          private bool CheckExistance_Shortcuts(Keys keys, ListViewItem lviCurrent) {
              foreach(ListViewItem item in listViewKeyboard.Items) {
                  if((keys == ((Keys)item.Tag)) && (item != lviCurrent)) {
                      string[] strArray = QTUtility.TextResourcesDic["ShortcutKeys_MsgReassign"];
                      string text = string.Format(strArray[0], QTUtility2.MakeKeyString(keys), item.SubItems[0].Text);
                      if(DialogResult.OK == MessageBox.Show(text, strArray[1], MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
                          item.Checked = false;
                          item.SubItems[1].Text = " - ";
                          item.Tag = Keys.None;
                          return true;
                      }
                      return false;
                  }
              }
              return true;
          }
  
          private bool CheckExistance_UserAppKey(Keys keys, TreeNode tnRoot, TreeNode tnCurrent) {
              foreach(TreeNode node in tnRoot.Nodes) {
                  if(((node != tnCurrent) && (node.Tag != null)) && (node.Tag is MenuItemArguments)) {
                      MenuItemArguments tag = (MenuItemArguments)node.Tag;
                      int num = tag.KeyShortcut & -1048577;
                      if(num == (int)keys) {
                          string[] strArray = QTUtility.TextResourcesDic["ShortcutKeys_MsgReassign"];
                          string text = string.Format(strArray[0], QTUtility2.MakeKeyString(keys), node.Text);
                          if(DialogResult.OK == MessageBox.Show(text, strArray[1], MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
                              tag.KeyShortcut = 0;
                              if(node == treeViewUserApps.SelectedNode) {
                                  chbUserAppKey.Checked = false;
                                  tbUserAppKey.Text = " - ";
                              }
                              return true;
                          }
                          return false;
                      }
                  }
                  if(!CheckExistance_UserAppKey(keys, node, tnCurrent)) {
                      return false;
                  }
              }
              return true;
          }
  
          private void cmsAddToken_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
              if(cmsAddToken.Items[0].Enabled) {
                  tbArgs.Paste(e.ClickedItem.Name);
              }
              else {
                  tbWorking.Paste(e.ClickedItem.Name);
              }
          }
  
          private void comboBoxes_SelectedIndexChanged(object sender, EventArgs e) {
              if(sender == cmbBGDblClick) {
                  lblAction_BarDblClick.Enabled = textBoxAction_BarDblClck.Enabled = btnBrowseAction_BarDblClck.Enabled = (cmbBGDblClick.SelectedIndex == 9) || (cmbBGDblClick.SelectedIndex == 10);
              }
              else if(sender == cmbTabSizeMode) {
                  nudTabWidth.Enabled = cmbTabSizeMode.SelectedIndex == 1;
                  nudTabWidthMax.Enabled = nudTabWidthMin.Enabled = cmbTabSizeMode.SelectedIndex == 2;
              }
              else if(sender == cmbTextExts) {
                  iComboBoxTextPreview = cmbTextExts.SelectedIndex;
              }
              else if(sender == cmbImgExts) {
                  iConboBoxImagPreview = cmbImgExts.SelectedIndex;
              }
          }
  
          private void comboBoxPreviewExts_KeyPress(object sender, KeyPressEventArgs e) {
              if(e.KeyChar == '\r') {
                  e.Handled = true;
                  EnterExtension(sender == cmbTextExts);
              }
              else {
                  ComboBox box = (ComboBox)sender;
                  if((box.SelectedIndex == 0) && (box.Text == ((sender == cmbTextExts) ? "(Text file)" : "(Image & movie file)"))) {
                      box.Text = string.Empty;
                  }
              }
          }
  
          private void CreateNoCapturePaths() {
              listView_NoCapture.BeginUpdate();
              foreach(string str in QTUtility.NoCapturePathsList) {
                  ListViewItem item = new ListViewItem(str);
                  if(str.StartsWith("::")) {
                      string displayName = ShellMethods.GetDisplayName(str);
                      if(!string.IsNullOrEmpty(displayName)) {
                          item.Text = displayName;
                      }
                  }
                  item.Name = str;
                  listView_NoCapture.Items.Add(item);
              }
              listView_NoCapture.EndUpdate();
          }
  
          private void CreatePluginViewItem(PluginAssembly[] pluginAssemblies, bool fAddedByUser) {
              foreach(PluginAssembly assembly in pluginAssemblies.Where(assembly => assembly.PluginInfosExist
                      && pluginView.PluginViewItems.All(item => item.PluginInfo.Path != assembly.Path))) {
                  int num = 0;
                  foreach(PluginInformation information in assembly.PluginInformations) {
                      if(fAddedByUser || information.Enabled) {
                          information.Enabled = assembly.Enabled = true;
                      }
                      pluginView.AddPluginViewItem(information, assembly);
                      num++;
                  }
                  if((num > 0) && fAddedByUser) {
                      lstPluginAssembliesUserAdded.Add(assembly);
                  }
              }
          }
  
          private void CreateShortcutItems() {
              string[] strArray = QTUtility.TextResourcesDic["ShortcutKeys_ActionNames"];
              string[] strArray2 = QTUtility.TextResourcesDic["ShortcutKeys_Groups"];
              ListViewGroup group = listViewKeyboard.Groups.Add("general", strArray2[0]);
              listViewKeyboard.BeginUpdate();
              for(int i = 0; i < QTUtility.ShortcutKeys.Length; i++) {
                  bool flag = (QTUtility.ShortcutKeys[i] & 0x100000) == 0x100000;
                  Keys key = ((Keys)QTUtility.ShortcutKeys[i]) & ((Keys)(-1048577));
                  ListViewItem item = new ListViewItem(new string[] { strArray[i], QTUtility2.MakeKeyString(key) });
                  item.Checked = flag;
                  item.Group = group;
                  item.Tag = key;
                  listViewKeyboard.Items.Add(item);
              }
              foreach(string str in QTUtility.dicPluginShortcutKeys.Keys) {
                  Plugin plugin;
                  int[] numArray = QTUtility.dicPluginShortcutKeys[str];
                  if(pluginManager.TryGetPlugin(str, out plugin) && (plugin.PluginInformation.ShortcutKeyActions != null)) {
                      ListViewGroup group2 = listViewKeyboard.Groups.Add(plugin.PluginInformation.PluginID, plugin.PluginInformation.Name + " (" + strArray2[1] + ")");
                      if((numArray != null) && (plugin.PluginInformation.ShortcutKeyActions.Length == numArray.Length)) {
                          for(int k = 0; k < numArray.Length; k++) {
                              bool flag2 = (numArray[k] & 0x100000) == 0x100000;
                              Keys keys2 = ((Keys)numArray[k]) & ((Keys)(-1048577));
                              ListViewItem item2 = new ListViewItem(new string[] { plugin.PluginInformation.ShortcutKeyActions[k], QTUtility2.MakeKeyString(keys2) });
                              item2.Checked = flag2;
                              item2.Group = group2;
                              item2.Tag = keys2;
                              item2.Name = str;
                              item2.ToolTipText = plugin.PluginInformation.Name + " ver:" + plugin.PluginInformation.Version;
                              listViewKeyboard.Items.Add(item2);
                          }
                          continue;
                      }
                      foreach(string action in plugin.PluginInformation.ShortcutKeyActions) {
                          listViewKeyboard.Items.Add(new ListViewItem(new string[] {action, " - "}) {
                                  Checked = false,
                                  Group = group2,
                                  Tag = 0,
                                  Name = str
                          });
                      }
                  }
              }
              listViewKeyboard.EndUpdate();
          }
  
          private void CreateTokenMenu() {
              if(cmsAddToken.Items.Count == 0) {
                  ToolStripMenuItem item = new ToolStripMenuItem("%f%   selected file");
                  ToolStripMenuItem item2 = new ToolStripMenuItem("%d%   selected folder");
                  ToolStripMenuItem item3 = new ToolStripMenuItem("%s%   selected item");
                  ToolStripMenuItem item4 = new ToolStripMenuItem("%c%   current folder");
                  ToolStripMenuItem item5 = new ToolStripMenuItem("%cd%  current or selected folder");
                  item.Name = "%f%";
                  item2.Name = "%d%";
                  item3.Name = "%s%";
                  item4.Name = "%c%";
                  item5.Name = "%cd%";
                  cmsAddToken.Items.AddRange(new ToolStripItem[] { item, item2, item3, item4, item5 });
              }
          }
  
          private static string CreateUniqueName(string strInitialName, TreeNode tnSelf, TreeNode tnParent) {
              int num = 1;
              string b = strInitialName;
              while(tnParent.Nodes.Cast<TreeNode>().Any(node => tnSelf != node && node.Text.PathEquals(b))) {
                  b = strInitialName + "_" + ++num;
              }
              return b;
          }
  
          private static TreeNode CreateUserAppNode(string key, string[] appVals) {
              int result = 0;
              if(appVals.Length == 4) {
                  int.TryParse(appVals[3], out result);
              }
              MenuItemArguments arguments = new MenuItemArguments(appVals[0], appVals[1], appVals[2], result, MenuGenre.Application);
              TreeNode node = new TreeNode();
              node.Tag = arguments;
              if(((appVals[0] == null) || (appVals[0].Length == 0)) || (appVals[0] == "separator")) {
                  node.Text = "----------- Separator -----------";
                  node.ForeColor = SystemColors.GrayText;
                  node.ImageKey = node.SelectedImageKey = "noimage";
                  return node;
              }
              string name = appVals[0];
              try {
                  name = Environment.ExpandEnvironmentVariables(name);
              }
              catch {
              }
              string ext = null;
              if(!name.StartsWith("::")) {
                  ext = Directory.Exists(name) ? null : Path.GetExtension(name);
              }
              node.Text = key;
              node.ImageKey = node.SelectedImageKey = QTUtility.GetImageKey(name, ext);
              return node;
          }
  
          private static bool CreateUserAppNode_Sub(string displayName, RegistryKey rk, out TreeNode tn) {
              List<TreeNode> list = new List<TreeNode>();
              tn = null;
              if(rk != null) {
                  foreach(string str in rk.GetValueNames()) {
                      string[] appVals = QTUtility2.ReadRegBinary<string>(str, rk);
                      if(appVals != null) {
                          if((appVals.Length == 3) || (appVals.Length == 4)) {
                              list.Add(CreateUserAppNode(str, appVals));
                          }
                      }
                      else {
                          using(RegistryKey key = rk.OpenSubKey(str)) {
                              TreeNode node;
                              if((key != null) && CreateUserAppNode_Sub(str, key, out node)) {
                                  list.Add(node);
                              }
                          }
                      }
                  }
              }
              if(list.Count > 0) {
                  tn = new TreeNode(displayName);
                  tn.ImageKey = tn.SelectedImageKey = "folder";
                  tn.Nodes.AddRange(list.ToArray());
                  return true;
              }
              return false;
          }
  
          private void DeletePluginAssembly(PluginAssembly pa) {
              foreach(PluginInformation information in pa.PluginInformations) {
                  RemovePluginShortcutKeys(information.PluginID);
              }
              if(lstPluginAssembliesUserAdded.Contains(pa)) {
                  pa.Dispose();
                  lstPluginAssembliesUserAdded.Remove(pa);
              }
          }
  
          protected override void Dispose(bool disposing) {
              fntStartUpGroup.Dispose();
              sfPlugins.Dispose();
              cmsAddToken.Dispose();
              pluginManager = null;
              foreach(PluginAssembly assembly in lstPluginAssembliesUserAdded) {
                  assembly.Dispose();
              }
              lstPluginAssembliesUserAdded.Clear();
              base.Dispose(disposing);
          }
  
          private void EnterExtension(bool fText) {
              ComboBox box = fText ? cmbTextExts : cmbImgExts;
              string str = fText ? "(Text file)" : "(Image & movie file)";
              int index = fText ? iComboBoxTextPreview : iConboBoxImagPreview;
              if(box.Text.Length > 0) {
                  if((box.SelectedIndex != 0) || (box.Text != str)) {
                      string b = box.Text.ToLower();
                      if(!b.StartsWith(".")) {
                          b = "." + b;
                      }
                      if(box.Items.Cast<string>().Any(str3 => str3.PathEquals(b))) {
                          return;
                      }
                      box.Text = b;
                      if(index == 0) {
                          box.Items.Add(b);
                      }
                      else {
                          box.Items[index] = b;
                      }
                  }
              }
              else if(index > 0) {
                  box.Items.RemoveAt(index);
                  box.SelectedIndex = 0;
              }
              else if(index == 0) {
                  box.Text = str;
              }
          }
  
          private void InitializeComponent() {
              btnOK = new Button();
              btnApply = new Button();
              btnCancel = new Button();
              lblVer = new LinkLabel();
              tabControl1 = new TabControl();
              tabPage1_Gnrl = new TabPage();
              tabPage2_Tabs = new TabPage();
              tabPage3_Wndw = new TabPage();
              tabPage4_View = new TabPage();
              tabPage5_Grps = new TabPage();
              tabPage6_Apps = new TabPage();
              tabPage7_Plug = new TabPage();
              tabPage8_Keys = new TabPage();
              tabPage9_Misc = new TabPage();
              tabPageA_Path = new TabPage();
              chbActivateNew = new CheckBox();
              chbDontOpenSame = new CheckBox();
              chbCloseWhenGroup = new CheckBox();
              chbShowTooltip = new CheckBox();
              chbX1X2 = new CheckBox();
              chbNavBtn = new CheckBox();
              chbNoHistory = new CheckBox();
              chbSaveExecuted = new CheckBox();
              chbDD = new CheckBox();
              chbAutoUpdate = new CheckBox();
              chbPlaySound = new CheckBox();
              cmbNavBtn = new ComboBox();
              btnHistoryClear = new Button();
              btnClearRecentFile = new Button();
              nudMaxUndo = new NumericUpDown();
              nudMaxRecentFile = new NumericUpDown();
  
gt:             lblLang = new Label();