Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult result = this.folderBrowserDialog1.ShowDialog();
            if (result == DialogResult.OK)
            {
                ud = new update_database();
                foldername = this.folderBrowserDialog1.SelectedPath;
                label1.Text = foldername;
                watcher1 w1 = new watcher1(foldername,this,ud);
                Thread thread = new Thread(new ThreadStart(w1.WorkThreadFunction));
                thread.Start();
                Console.WriteLine("watcher1 started for {0}", foldername);
                Console.Out.Flush();

            }
        }
Exemple #2
0
        public watcher3(string path, Form1 frm, update_database ud)
        {
            this.path = path;
            watcher3.frm = frm;
            watcher3.ud = ud;

            fw1 = new FileSystemWatcher();

            fw1.Path = @path;

            fw1.EnableRaisingEvents = true;
            Console.WriteLine("in watcher1 constructor for {0}", path);
            Console.Out.Flush();
        }
Exemple #3
0
 public XMLParser(string path, string barcode,Form1 frm, update_database ud)
 {
     Console.WriteLine("in XMLParser constructor for {0}", path);
     Console.Out.Flush();
     this.path = path;
     this.barcode = barcode;
     this.frm = frm;
     this.ud = ud;
     set_project(path);
 }
Exemple #4
0
        private void updateLanguageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fd = new FolderBrowserDialog();

               //fd.Description = "Select barcode";
               String barcode = "";
               DialogResult dg = fd.ShowDialog();
             if (dg == DialogResult.OK)
               {
                String path = fd.SelectedPath;
                int index = path.LastIndexOf("\\");
                //string temp = path.Substring(0, index);
                //Console.WriteLine("in set_project with temprORY substring {0}", temp);
                //Console.Out.Flush();
                int index2 = path.LastIndexOf("\\");
                String project = path.Substring(index2 + 1);
                Console.WriteLine("Project is " + project);
                Console.WriteLine("path is " +path);
                string[] filePaths = Directory.GetDirectories(@path);
                string input = Microsoft.VisualBasic.Interaction.InputBox("Language Code", "Input Language", "rom", 0, 0);
                Console.WriteLine("language code is " + input);
                update_database ud = new update_database();
                for (int i = 0; i < filePaths.Length; i++)
                {
                    index = filePaths[i].LastIndexOf("\\");
                    barcode = filePaths[i].Substring(index + 1);
                    Console.WriteLine("doing book" + barcode + " for project " + project + " with language" + input);
                    Console.Out.Flush();
                    ud.updatebook(barcode, project, input, path);
                }

                //index=path.LastIndexOf("\\");
                //barcode = path.Substring(index + 1);
                //Console.WriteLine(barcode);
                //Console.Out.Flush();

                //ud.updatebook(barcode,project, "rom", path);

               }
        }