private void addCldBtn_Click(object sender, EventArgs e) { var ind = this.citizendList.SelectedIndex; var form = new CldForm(citizens.Cast <string>().ToList(), ind, citizen2child.ContainsKey(ind) ? citizen2child[ind] : new List <int>()); form.Owner = this; form.SubmitEvent += OnSelectedChild; form.ShowDialog(); }
private void ApagaLista(ListBox.ObjectCollection Lista) { String[] myArr = (String[])Lista.Cast <string>().ToArray(); File.WriteAllLines($@"{Diretorio.Pasta}\{Diretorio.ArquivoSelecionado}", myArr); }
private static void AddFeature(String feature , ListBox.ObjectCollection items) { List <String> features = new List <String>(items.Cast <String>()); features.Add(feature); features.Sort(); items.Clear(); items.AddRange(features.ToArray()); }
private void refreshObj(ListBox.ObjectCollection obj, List <string> names) { var str = obj.Cast <string>().ToList(); names.Clear(); for (int i = 0; i < str.Count; i++) { names.Add(str[i]); } }
public static string listboxToString(ListBox.ObjectCollection lst) { string result = string.Empty; List <SchemaEntity> se = lst.Cast <SchemaEntity>().ToList(); se.ForEach(s => { result += ("'" + s.name + "',"); }); //delete last coma return(result.Substring(0, result.Length - 1)); }
public static IList <Contact> ConvertListBoxToListOfContacts(ListBox.ObjectCollection objects) { return(objects.Cast <Contact>().ToList()); }
private void Paint(object sender, PaintEventArgs args) { _plane.Draw(args.Graphics, _model.Cast <FigureDrawer>(), _planeSettings); }
public static IEnumerable <object> AsEnumerable(this ListBox.ObjectCollection objectCollection) { return(objectCollection.Cast <object>()); }
public static void SaveToFile(this ListBox.ObjectCollection sender, string FileName) { System.IO.File.WriteAllLines(FileName, (from Row in sender.Cast <string>() select Row).ToArray()); }