Exemplo n.º 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();
        }
Exemplo n.º 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());
        }
Exemplo n.º 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]);
            }
        }
Exemplo n.º 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));
        }
Exemplo n.º 6
0
 public static IList <Contact> ConvertListBoxToListOfContacts(ListBox.ObjectCollection objects)
 {
     return(objects.Cast <Contact>().ToList());
 }
Exemplo n.º 7
0
 private void Paint(object sender, PaintEventArgs args)
 {
     _plane.Draw(args.Graphics, _model.Cast <FigureDrawer>(), _planeSettings);
 }
Exemplo n.º 8
0
 public static IEnumerable <object> AsEnumerable(this ListBox.ObjectCollection objectCollection)
 {
     return(objectCollection.Cast <object>());
 }
Exemplo n.º 9
0
 public static void SaveToFile(this ListBox.ObjectCollection sender, string FileName)
 {
     System.IO.File.WriteAllLines(FileName, (from Row in sender.Cast <string>() select Row).ToArray());
 }