本文整理汇总了C#中System.Windows.Forms.ItemCheckEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ItemCheckEventArgs类的具体用法?C# ItemCheckEventArgs怎么用?C# ItemCheckEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemCheckEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ItemCheckEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssessmentCheckBox_ItemCheck
private void AssessmentCheckBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (!updating)
{
String value = this.Items[e.Index].Text;
foreach (String key in additionalText.Keys)
{
if (value.Contains(key))
{
value = key;
break;
}
}
if (e.CurrentValue == CheckState.Unchecked && e.NewValue == CheckState.Checked)
{
if (!selectedItems.Contains(value))
{
selectedItems.Add(value);
}
}
else if (e.CurrentValue == CheckState.Checked && e.NewValue == CheckState.Unchecked)
{
if (selectedItems.Contains(value))
{
selectedItems.Remove(value);
}
}
}
}
示例2: checkedListBox_ItemCheck
private void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
Engine.SettingsProvider.Set(
checkedListBox.Items[e.Index],
(e.NewValue == CheckState.Unchecked ? false : true),
PersistHint.AcrossSessions);
}
示例3: expectedWordsListBox_ItemCheck
private void expectedWordsListBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (!this.allowExpectedWordsCheck)
{
e.NewValue = e.NewValue == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked;
}
}
示例4: checkedFrames_ItemCheck
private void checkedFrames_ItemCheck(object sender, ItemCheckEventArgs e) {
if (e.NewValue != CheckState.Checked) {
btnExtract.Enabled = (checkedFrames.CheckedItems.Count > 0 && textBox1.Text.Length > 0);
return;
}
btnExtract.Enabled = (textBox1.Text.Length > 0);
}
示例5: processList_ItemCheck
private void processList_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
string[] spliters = { "-" };
string value = processList.Items[e.Index].ToString();
string instanceName = value.Split(spliters, StringSplitOptions.None).FirstOrDefault();
this.createperfcounter(instanceName);
Series series = new Series(instanceName);
series.ChartType = SeriesChartType.FastLine;
series.BorderWidth = 5;
Series cpuseries = new Series(instanceName);
cpuseries.ChartType = SeriesChartType.FastLine;
cpuseries.BorderWidth = 5;
chart1.Series.Add(series);
chart2.Series.Add(cpuseries);
}
}
示例6: ColumnFirstText_ItemCheck
void ColumnFirstText_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
InvokeCheckStatusSwitched(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, true));
else if (e.NewValue == CheckState.Unchecked)
InvokeCheckStatusSwitched(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, false));
}
示例7: boxFilters_ItemCheck
private void boxFilters_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (ignoreCheck)
e.NewValue = e.CurrentValue;
else
Settings.filters[e.Index].Enabled = e.NewValue == CheckState.Checked;
}
示例8: checkedListBoxSeries_ItemCheck
private void checkedListBoxSeries_ItemCheck(object sender, ItemCheckEventArgs e) {
int index = e.Index;
DBSeries item = (DBSeries)checkedListBoxSeries.Items[index];
// Add/Remove items from list
if (item != null) {
// Item state before item was clicked
if (checkedListBoxSeries.GetItemChecked(index)) {
// Store items changes
if (!UnCheckedItems.Contains(item)) {
UnCheckedItems.Add(item);
}
if (CheckedItems.Contains(item)) {
CheckedItems.Remove(item);
}
CheckedCount -= 1;
labelSeriesSelected.Text = (CheckedCount).ToString() + " Series Selected";
}
else {
// Store items changes
if (!CheckedItems.Contains(item)) {
CheckedItems.Add(item);
}
if (UnCheckedItems.Contains(item)) {
UnCheckedItems.Remove(item);
}
CheckedCount += 1;
labelSeriesSelected.Text = (CheckedCount).ToString() + " Series Selected";
}
}
}
示例9: trapsCheckedListBox_ItemCheck
void trapsCheckedListBox_ItemCheck( object sender, ItemCheckEventArgs e )
{
if ( !ignoreChanges )
{
switch ( e.Index )
{
case 0:
moveFindItem.Unknown1 = e.NewValue == CheckState.Checked;
break;
case 1:
moveFindItem.Unknown2 = e.NewValue == CheckState.Checked;
break;
case 2:
moveFindItem.Unknown3 = e.NewValue == CheckState.Checked;
break;
case 3:
moveFindItem.Unknown4 = e.NewValue == CheckState.Checked;
break;
case 4:
moveFindItem.SteelNeedle = e.NewValue == CheckState.Checked;
break;
case 5:
moveFindItem.SleepingGas = e.NewValue == CheckState.Checked;
break;
case 6:
moveFindItem.Deathtrap = e.NewValue == CheckState.Checked;
break;
case 7:
moveFindItem.Degenerator = e.NewValue == CheckState.Checked;
break;
}
OnDataChanged( this, EventArgs.Empty );
}
}
示例10: AssemblySelected
private void AssemblySelected(object sender, ItemCheckEventArgs e)
{
// When an assembly gets changed, find all classes that belong to it
Type[] Classes;
#if USENAMESPACES
Classes = mAssemblies
.Select(name => Assembly.Load(name))
.SelectMany(assem => assem.GetTypes())
.Where(type => type.Namespace == mNamespaces[e.Index])
.ToArray();
#else
Classes = Assembly.Load(mAssemblies[e.Index].FullName).GetTypes().ToArray();
#endif
// If it got unchecked, then remove its classes from the Classes list
if (e.NewValue != CheckState.Checked)
foreach (Type t in Classes)
mAvailableClasses.Remove(t);
// Else, put them on the Classes list
else
foreach (Type t in Classes)
mAvailableClasses.Add(t);
// Display a sorted list of all available classes
mAvailableClasses = mAvailableClasses.OrderBy(l => l.Name).ToList();
lstClasses.Items.Clear();
lstClasses.Items.AddRange(mAvailableClasses.Select(t => new ListViewItem(t.Name)).ToArray());
// Clear the display of available methods
mAvailableMethods = new MethodInfo[0];
if (cmbSelectionPicker.SelectedIndex == METHODS)
{
lstMethods.Clear();
}
}
示例11: pluginsCLB_ItemCheck
private void pluginsCLB_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
var plugin = (pluginsCLB.Items[e.Index] as PluginInfo).CreateInstance(true);
if (plugin is ParsedPacketsPlugin)
(plugin as ParsedPacketsPlugin).OnClientPacketAdd += OnClientPacketAdd;
if (plugin is L2ObjectsPlugin)
(plugin as L2ObjectsPlugin).World = AccData.World;
plugin.UserStopped += plugin_UserStopped;
plugin.Run();
AccData.LoadedPlugins.Add(plugin);
}
if (e.NewValue == CheckState.Unchecked && !uncheckFromCode)
{
var pluginInfo = pluginsCLB.Items[e.Index] as PluginInfo;
Plugins.BasePlugin selectedPlugin = null;
foreach (var plugin in AccData.LoadedPlugins)
if (plugin.GetType().FullName == pluginInfo.Type.FullName)
{
selectedPlugin = plugin;
break;
}
selectedPlugin.Stop();
AccData.LoadedPlugins.Remove(selectedPlugin);
}
}
示例12: chkListPassenger_ItemCheck
private void chkListPassenger_ItemCheck(object sender, ItemCheckEventArgs e)
{
PassengerDTOs p = ((PassengerDTOs)this.chkListPassenger.Items[e.Index]);
if (e.NewValue == CheckState.Checked)
{
if (myList.Count == 5)
{
e.NewValue = CheckState.Unchecked;
MessageBox.Show("对不起,你最多只能选择5位联系人!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
if (!myList.Contains(p))
{
myList.Add(p);
}
}
}
else
{
myList.Remove(p);
}
mf.myList = myList;
mf.LoadPassenger();
}
示例13: PersonalitiesListBox_ItemCheck
private void PersonalitiesListBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
var p = PersonalitiesListBox.SelectedItem as Personality;
if (p == null)
return;
p.EnabledUser = e.NewValue == CheckState.Checked;
}
示例14: checkedListBox1_ItemCheck
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
//since event fires before event change, we can assume that if some value is changing and all values are currently
//all TRUE, then 1 must be changing to FALSE, so uncheck.
if (checkedListBox1.CheckedItems.Count == checkedListBox1.Items.Count)
checkBox3.Checked = false;
}
示例15: filters_ItemCheck
private void filters_ItemCheck(object sender, ItemCheckEventArgs e)
{
for (int i = 0; i < checkBoxLFilter.Items.Count; i++)
{
if (i != e.Index) checkBoxLFilter.SetItemChecked(i, false);
}
}