public void Init(object bindedObject, dynamic comboBoxEnumItemsList, string AttrName, bool isVENeeded = false) { this.obj = bindedObject; this.AttrName = AttrName; if (comboBoxEnumItemsList != null && comboBoxEnumItemsList.Count > 0) { ComboBox.Items.Clear(); ComboBox.SelectedValuePath = "Value"; Type Etype = comboBoxEnumItemsList[0].GetType(); foreach (object item in comboBoxEnumItemsList) { GingerCore.General.ComboItem CEI = new GingerCore.General.ComboItem(); CEI.text = GingerCore.General.GetEnumValueDescription(Etype, item); CEI.Value = item; ComboBox.Items.Add(CEI); } } if (isVENeeded) { Col.Width = new GridLength(22); VEButton.Visibility = Visibility.Visible; ComboBox.IsEditable = true; GingerCore.General.ObjFieldBinding(ComboBox, ComboBox.TextProperty, bindedObject, AttrName); } else { ComboBox.IsEditable = false; GingerCore.General.ObjFieldBinding(ComboBox, ComboBox.SelectedValueProperty, bindedObject, AttrName); } }
public void Init(ActInputValue AIV, dynamic comboBoxEnumItemsList, bool isVENeeded = false, SelectionChangedEventHandler UCselectionChange = null) { List <GingerCore.General.ComboItem> comboBoxItemsList = new List <GingerCore.General.ComboItem>(); if (comboBoxEnumItemsList != null && comboBoxEnumItemsList.Count > 0) { Type Etype = comboBoxEnumItemsList[0].GetType(); foreach (object item in comboBoxEnumItemsList) { GingerCore.General.ComboItem CEI = new GingerCore.General.ComboItem(); CEI.text = GingerCore.General.GetEnumValueDescription(Etype, item); CEI.Value = item; comboBoxItemsList.Add(CEI); } Init(AIV, comboBoxItemsList, isVENeeded, UCselectionChange); } }
public List <GingerCore.General.ComboItem> GeneratecomboBoxItemsList() { List <GingerCore.General.ComboItem> comboBoxItemsList = new List <GingerCore.General.ComboItem>(); GingerCore.General.ComboItem CBI1 = new GingerCore.General.ComboItem(); CBI1.text = "Value 1"; CBI1.Value = "Value1"; GingerCore.General.ComboItem CBI2 = new GingerCore.General.ComboItem(); CBI2.text = "Value 2"; CBI2.Value = "Value2"; GingerCore.General.ComboItem CBI3 = new GingerCore.General.ComboItem(); CBI3.text = "Value 3"; CBI3.Value = "Value3"; comboBoxItemsList.Add(CBI1); comboBoxItemsList.Add(CBI2); comboBoxItemsList.Add(CBI3); return(comboBoxItemsList); }
public List <GingerCore.General.ComboItem> GeneratecomboBoxItemsListSendkeys() { List <GingerCore.General.ComboItem> comboBoxItemsList = new List <GingerCore.General.ComboItem>(); GingerCore.General.ComboItem CBI1 = new GingerCore.General.ComboItem(); CBI1.text = "{BACKSPACE}"; CBI1.text = "{BACKSPACE}"; GingerCore.General.ComboItem CBI2 = new GingerCore.General.ComboItem(); CBI2.text = "{BREAK}"; CBI2.Value = "{BREAK}"; GingerCore.General.ComboItem CBI3 = new GingerCore.General.ComboItem(); CBI3.text = "{DELETE}"; CBI3.Value = "{DELETE}"; GingerCore.General.ComboItem CBI4 = new GingerCore.General.ComboItem(); CBI4.text = "{CAPSLOCK}"; CBI4.Value = "{CAPSLOCK}"; GingerCore.General.ComboItem CBI5 = new GingerCore.General.ComboItem(); CBI5.text = "DOWN ARROW"; CBI5.Value = "{DOWN}"; GingerCore.General.ComboItem CBI6 = new GingerCore.General.ComboItem(); CBI6.text = "{END}"; CBI6.Value = "{END}"; GingerCore.General.ComboItem CBI7 = new GingerCore.General.ComboItem(); CBI7.text = "{ENTER}"; CBI7.Value = "{ENTER}"; GingerCore.General.ComboItem CBI8 = new GingerCore.General.ComboItem(); CBI8.text = "{ESC}"; CBI8.Value = "{ESC}"; GingerCore.General.ComboItem CBI9 = new GingerCore.General.ComboItem(); CBI9.text = "{HELP}"; CBI9.Value = "{HELP}"; GingerCore.General.ComboItem CBI10 = new GingerCore.General.ComboItem(); CBI10.text = "{HOME}"; CBI10.Value = "{HOME}"; GingerCore.General.ComboItem CBI11 = new GingerCore.General.ComboItem(); CBI11.text = "{INSERT}"; CBI11.Value = "{INSERT}"; GingerCore.General.ComboItem CBI12 = new GingerCore.General.ComboItem(); CBI12.text = "{LEFT}"; CBI12.Value = "{LEFT}"; GingerCore.General.ComboItem CBI13 = new GingerCore.General.ComboItem(); CBI13.text = "{HOME}"; CBI13.Value = "{HOME}"; GingerCore.General.ComboItem CBI14 = new GingerCore.General.ComboItem(); CBI14.text = "{NUMLOCK}"; CBI14.Value = "{NUMLOCK}"; GingerCore.General.ComboItem CBI15 = new GingerCore.General.ComboItem(); CBI15.text = "{PGDN}"; CBI15.Value = "{PGDN}"; GingerCore.General.ComboItem CBI16 = new GingerCore.General.ComboItem(); CBI16.text = "PAGE UP"; CBI16.Value = "{PGUP}"; GingerCore.General.ComboItem CBI17 = new GingerCore.General.ComboItem(); CBI17.text = "{RIGHT}"; CBI17.Value = "{RIGHT}"; GingerCore.General.ComboItem CBI18 = new GingerCore.General.ComboItem(); CBI18.text = "{SCROLLLOCK}"; CBI18.Value = "{SCROLLLOCK}"; GingerCore.General.ComboItem CBI19 = new GingerCore.General.ComboItem(); CBI19.text = "{TAB}"; CBI19.Value = "{TAB}"; GingerCore.General.ComboItem CBI20 = new GingerCore.General.ComboItem(); CBI20.text = "{UP}"; CBI20.Value = "{UP}"; GingerCore.General.ComboItem CBI21 = new GingerCore.General.ComboItem(); CBI21.text = "+"; CBI21.Value = "+"; GingerCore.General.ComboItem CBI22 = new GingerCore.General.ComboItem(); CBI22.text = "^"; CBI22.Value = "^"; GingerCore.General.ComboItem CBI23 = new GingerCore.General.ComboItem(); CBI23.text = "%"; CBI23.Value = "%"; comboBoxItemsList.Add(CBI1); comboBoxItemsList.Add(CBI2); comboBoxItemsList.Add(CBI3); comboBoxItemsList.Add(CBI4); comboBoxItemsList.Add(CBI5); comboBoxItemsList.Add(CBI6); comboBoxItemsList.Add(CBI7); comboBoxItemsList.Add(CBI8); comboBoxItemsList.Add(CBI9); comboBoxItemsList.Add(CBI10); comboBoxItemsList.Add(CBI11); comboBoxItemsList.Add(CBI12); comboBoxItemsList.Add(CBI13); comboBoxItemsList.Add(CBI14); comboBoxItemsList.Add(CBI15); comboBoxItemsList.Add(CBI16); comboBoxItemsList.Add(CBI17); comboBoxItemsList.Add(CBI18); comboBoxItemsList.Add(CBI19); comboBoxItemsList.Add(CBI20); comboBoxItemsList.Add(CBI21); comboBoxItemsList.Add(CBI22); comboBoxItemsList.Add(CBI23); return(comboBoxItemsList); }