ME3Explorer.KFreonTPFTools3.CheckSelectAllPCCsList C# (CSharp) Method

CheckSelectAllPCCsList() private method

private CheckSelectAllPCCsList ( bool SelectAll, bool FromButton ) : void
SelectAll bool
FromButton bool
return void
        private void CheckSelectAllPCCsList(bool SelectAll, bool FromButton)
        {
            bool state = true;

            // KFreon: Check all unless all already checked, then uncheck all
            if (PCCsCheckListBox.CheckedIndices.Count == PCCsCheckListBox.Items.Count)
                state = false;

            this.Invoke(new Action(() => PCCSelectAllButton.Text = (!state ? "Uncheck All" : "Check All")));

            if (SelectAll)
                for (int i = 0; i < PCCsCheckListBox.Items.Count; i++)
                    PCCsCheckListBox.Items[i].Checked = state;

            if (FromButton)
                PCCsCheckBox_IndexChanged(null, null);
        }
KFreonTPFTools3