Example #1
0
        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();
        }
Example #2
0
        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());
        }
Example #4
0
        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]);
            }
        }
Example #5
0
        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));
        }
Example #6
0
 public static IList <Contact> ConvertListBoxToListOfContacts(ListBox.ObjectCollection objects)
 {
     return(objects.Cast <Contact>().ToList());
 }
Example #7
0
 private void Paint(object sender, PaintEventArgs args)
 {
     _plane.Draw(args.Graphics, _model.Cast <FigureDrawer>(), _planeSettings);
 }
Example #8
0
 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());
 }