void mbar_Closed(object sender, EventArgs e)
        {
            string path = ((MultiProgressBar)sender).CopyDirectory;
            string realpath = ((MultiProgressBar)sender).RealPath;

            DirectoyProgress bar = new DirectoyProgress(path, realpath, 1);
            if(((MultiProgressBar)sender).Name != null)
                bar.Name = ((MultiProgressBar)sender).Name;
            bar.Closed += bar_Closed;
            bar.Show();
        }
        private void GetFile(string copydirectory, string userselectdirectory)
        {
            if (this.Dispatcher.Thread != Thread.CurrentThread)
            {
                SetProgCallBack dele = new SetProgCallBack(GetFile);
                Dispatcher.Invoke(dele, new object[] { copydirectory, userselectdirectory });
            }
            else
            {
                //string path = new FileInfo(copydirectory).Directory.ToString();
                string realpath = userselectdirectory;

                DirectoyProgress bar = new DirectoyProgress(copydirectory, realpath, 0);
                bar.deletefile += deletecompletefile;
                bar.Show();
            }
        }
        private void GetDirectory(object sender, RoutedEventArgs e)
        {
            userdirectoypath = usbpath + @"SchoolInteligentUSB\WindowFolder\";

            System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
            System.Windows.Forms.DialogResult result = dialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                if (dialog.SelectedPath != null)
                {
                    copydirectoypath = dialog.SelectedPath;
                    directoryname = copydirectoypath.Substring(copydirectoypath.LastIndexOf("\\") + 1);

                    DirectoyProgress directorycopy = new DirectoyProgress(copydirectoypath, userdirectoypath + directoryname, 1);
                    directorycopy.Show();
                }
                else
                    return;

                Application.Current.Properties["Resetingicon"] = true;
            }
            else
                return;
        }