示例#1
0
        public void btnSettings_Click(object sender, RibbonControlEventArgs e)
        {
            DialogResult dr = frmSettings.ShowDialog();

            if (dr == DialogResult.OK)
            {
                boolDisplayMessage = frmSettings.chkProduceInitialMessageBox.Checked;
                boolLargeButton    = frmSettings.chkLargeButtons.Checked;
                boolHideText       = frmSettings.chkHideText.Checked;
                boolHideSeperator  = frmSettings.chkHideSeperator.Checked;

                CommonExcelClasses.ButtonSetSize(btnSettings, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnReadFolders, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnCompareSheets, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnZap, boolLargeButton);
                CommonExcelClasses.SplitButtonSetSize(splitButtonDeleteLines, boolLargeButton);

                CommonExcelClasses.ButtonSetSize(btnDeleteBlankLinesA, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnDeleteBlankLinesB, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnDeleteBlankLinesC, boolLargeButton);

                CommonExcelClasses.ButtonSetSize(btnDealWithSingleDuplicates, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnDealWithManyDuplicates, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnLoadADGroupIntoSpreadsheet, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnLoadADGroupIntoSpreadsheetActiveCell, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnReadUsersGroupMembership, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnReadUsersGroupMembershipActiveCell, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnWriteTimeSheet, boolLargeButton);
                CommonExcelClasses.ButtonSetSize(btnPingServers, boolLargeButton);

                separator1.Visible = boolHideSeperator;
                separator2.Visible = boolHideSeperator;
                separator3.Visible = boolHideSeperator;
                separator4.Visible = boolHideSeperator;
                separator5.Visible = boolHideSeperator;
                separator6.Visible = boolHideSeperator;

                if (boolHideText)
                {
                    CommonExcelClasses.ButtonUpdateLabel(btnSettings, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadFolders, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnCompareSheets, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnZap, "");
                    CommonExcelClasses.SplitButtonUpdateLabel(splitButtonDeleteLines, "");

                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesA, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesB, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesC, "");

                    CommonExcelClasses.ButtonUpdateLabel(btnDealWithSingleDuplicates, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnDealWithManyDuplicates, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnLoadADGroupIntoSpreadsheet, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnLoadADGroupIntoSpreadsheetActiveCell, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadUsersGroupMembership, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadUsersGroupMembershipActiveCell, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnWriteTimeSheet, "");
                    CommonExcelClasses.ButtonUpdateLabel(btnPingServers, "");
                }
                else
                {
                    CommonExcelClasses.ButtonUpdateLabel(btnSettings, "Settings");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadFolders, "Read Folders");

                    myData = myData.LoadMyData();               // read data from settings file

                    CommonExcelClasses.ButtonUpdateLabel(btnCompareSheets, "Compare: (" + myData.CompareOrColour + ")");
                    CommonExcelClasses.ButtonUpdateLabel(btnZap, "Zap Worksheet");
                    CommonExcelClasses.SplitButtonUpdateLabel(splitButtonDeleteLines, "Delete Blank Lines");
                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesA, "Mode: A");
                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesB, "Mode: B");
                    CommonExcelClasses.ButtonUpdateLabel(btnDeleteBlankLinesC, "Mode: C");

                    CommonExcelClasses.ButtonUpdateLabel(btnDealWithSingleDuplicates, "Duplicates (Cols: Single): (" + myData.ColourOrDelete + ")");
                    CommonExcelClasses.ButtonUpdateLabel(btnDealWithManyDuplicates, "Duplicates (Cols: Many): (" + myData.ColourOrDelete + ")");
                    // CommonExcelClasses.ButtonUpdateLabel(btnDealWithManyDuplicates, "Duplicates (Cols: Many)");
                    CommonExcelClasses.ButtonUpdateLabel(btnLoadADGroupIntoSpreadsheet, "AD Group Members");
                    CommonExcelClasses.ButtonUpdateLabel(btnLoadADGroupIntoSpreadsheetActiveCell, "AD Members - Active Cell");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadUsersGroupMembership, "Users AD Membership");
                    CommonExcelClasses.ButtonUpdateLabel(btnReadUsersGroupMembershipActiveCell, "Details from AD Name");
                    CommonExcelClasses.ButtonUpdateLabel(btnWriteTimeSheet, "Update timesheet");
                    CommonExcelClasses.ButtonUpdateLabel(btnPingServers, "Ping Servers");
                }
            }
        }