Esempio n. 1
0
        private void removeAll_Click(object sender, EventArgs e)
        {
            bool doRemove = confirm("Confirmation", "Are you sure you would like to remove all flag overrides?");

            if (doRemove)
            {
                foreach (string flagName in flagRegistry.GetSubKeyNames())
                {
                    if (flagLookup.ContainsKey(flagName))
                    {
                        int       index = flagLookup[flagName];
                        FVariable flag  = flags[index];
                        flag.ClearEditor();
                    }

                    flagRegistry.DeleteSubKey(flagName);
                }

                overrideStatus.Text      = OVERRIDE_STATUS_OFF;
                overrideStatus.ForeColor = Color.Black;

                overrideTable.Rows.Clear();
                overrideRowLookup.Clear();
            }
        }
Esempio n. 2
0
        private void removeSelected_Click(object sender, EventArgs e)
        {
            var selectedRows = overrideDataGridView.SelectedRows;

            if (selectedRows.Count > 0)
            {
                var    selectedRow = selectedRows[0];
                string flagKey     = getFlagKeyByRow(selectedRow);

                if (flagLookup.ContainsKey(flagKey))
                {
                    int       index = flagLookup[flagKey];
                    FVariable flag  = flags[index];
                    flag.ClearEditor();
                }

                if (overrideRowLookup.ContainsKey(flagKey))
                {
                    DataRow rowToDelete = overrideRowLookup[flagKey];
                    overrideRowLookup.Remove(flagKey);
                    rowToDelete.Delete();
                }

                selectedRow.Visible = false;
                selectedRow.Dispose();

                flagRegistry.DeleteSubKey(flagKey);
            }

            if (overrideDataGridView.Rows.Count == 0)
            {
                overrideStatus.Text      = OVERRIDE_STATUS_OFF;
                overrideStatus.ForeColor = Color.Black;
            }
        }