Example #1
0
        private void lsbSpisokDel_DragDrop(object sender, DragEventArgs e)
        {
            Delo d = new Delo();

            d.DownloadFromFile(e.Data.GetData(DataFormats.StringFormat).ToString());
            d.Name = d.Name + "_1";
            lsbSpisokDel.Items.Add(d.Name);
            Form1.names.Add(d.Name);
            dels.Add(d);
            File.Delete(e.Data.GetData(DataFormats.StringFormat).ToString());
        }
Example #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     dela           = new List <Delo>();
     proekti        = new List <Proekt>();
     names          = new List <string>();
     IsMdiContainer = true;
     if (File.Exists("Dela.txt"))
     {
         try
         {
             foreach (string item in File.ReadAllLines("Dela.txt"))
             {
                 Delo d = new Delo();
                 d.DownloadFromFile(item);
                 dela.Add(d);
                 names.Add(d.Name);
                 File.Delete(item);
             }
         }
         catch { }
     }
     File.Delete("Dela.txt");
     if (File.Exists("Proekti.txt"))
     {
         try
         {
             foreach (string item in File.ReadAllLines("Proekti.txt"))
             {
                 Proekt p = new Proekt();
                 p.DownloadFromFiles(item);
                 proekti.Add(p);
                 names.Add(p.Name);
                 foreach (Delo delo in p.dela)
                 {
                     names.Add(delo.Name);
                 }
                 File.Delete(item);
             }
         }
         catch { }
     }
     File.Delete("Proekti.txt");
 }
Example #3
0
        public void DownloadFromFiles(string path)
        {
            List <string> tmp = new List <string>(File.ReadAllLines(path));

            Name     = tmp[0];
            Opisanie = tmp[1];
            dela     = new List <Delo>();
            foreach (string item in tmp[2].Split(';'))
            {
                if (File.Exists(item))
                {
                    Delo d = new Delo();
                    d.DownloadFromFile(item);
                    dela.Add(d);
                    File.Delete(item);
                }
            }
            Dedline   = DateTime.Parse(tmp[3]);
            tegi      = new List <string>(tmp[4].Split(';'));
            kontacti  = new List <string>(tmp[4].Split(';'));
            prioritet = (Prioritet)int.Parse(tmp[6]);
        }