private void _SetRadioButtonSetState(ETGModComponent key, bool enabled)
        {
            List <RadioButton> controls;

            if (RadioButtonMap.TryGetValue(key, out controls))
            {
                foreach (var control in controls)
                {
                    control.Enabled        = enabled;
                    control.Parent.Visible = enabled;
                    if (control.Checked)
                    {
                        if (enabled)
                        {
                            SelectedVersions.Add((ComponentVersion)control.Tag);
                        }
                        else
                        {
                            SelectedVersions.Remove((ComponentVersion)control.Tag);
                        }
                    }
                    SelectedVersionsChanged.Invoke(this, new EventArgs());
                }
            }
        }
示例#2
0
        private void listView_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <AnotherJiraRestClient.JiraModel.Version> versions;

            versions = new List <AnotherJiraRestClient.JiraModel.Version>();
            SelectedVersionsEventArgs selectedVersionsEventArgs = new SelectedVersionsEventArgs();

            foreach (ListViewItem item in listView.SelectedItems)
            {
                versions.Add((AnotherJiraRestClient.JiraModel.Version)item.Tag);
            }

            selectedVersionsEventArgs.Versions = versions;
            SelectedVersionsChanged?.Invoke(this, selectedVersionsEventArgs);
        }
        public void RadioCheckEvent(object sender, EventArgs args)
        {
            var radiobutton = (RadioButton)sender;
            var version     = (ComponentVersion)radiobutton.Tag;

            if (radiobutton.Checked)
            {
                SelectedVersions.Add(version);
            }
            else
            {
                SelectedVersions.Remove(version);
            }

            SelectedVersionsChanged.Invoke(this, new EventArgs());
        }